Ionic serve doesn't work/ exits batch - ionic-framework

I am struggling to get the ionic serve command working .
Right now whener I go into my project folder inside the cmd and run the command it gives me the following output:
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[01:44:47] watch started ...
[01:44:47] build dev started ...
[01:44:47] clean started ...
[01:44:47] clean finished in 6 ms
[01:44:47] copy started ...
[01:44:47] deeplinks started ...
[01:44:47] deeplinks finished in 21 ms
[01:44:47] transpile started ...
[01:44:50] transpile finished in 3.19 s
[01:44:50] preprocess started ...
[01:44:50] preprocess finished in less than 1 ms
[01:44:50] webpack started ...
[01:44:50] copy finished in 3.37 s
[01:44:55] webpack finished in 5.10 s
[01:44:55] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[01:44:56] sass finished in 974 ms
[01:44:56] postprocess started ...
[01:44:56] postprocess finished in 8 ms
[01:44:56] lint started ...
[01:44:56] build dev finished in 9.44 s
[01:44:57] watch ready in 9.52 s
[01:44:57] dev server running: http://localhost:8100/
[OK] Development server running!
Local: http://localhost:8100
External: http://111.111.1.111:8100
DevApp: foo#8100 on DESKTOP-11QG111
It seems to be working fine but it doesn't stay inside the batch, instead it just exits it and therefore the server is not running. I am confused on why it doesn't work.

For the benfit of anyone stumbling onto this, the solution on Windows is to make sure that
C:\windows\system32 is in the PATH environment variable

Related

Script hangs only when started via SystemD

I am trying to start the Kafka Connect component alongside Cloudera and want to wrap the Kafka Connect startup script in a systemd service file such that it can start on boot once the Cloudera services start.
For some strange reason if I start this script outside of systemd it works just fine, but when I start it via systemctl start kafka-connect it just hangs at the following log entry lines.
[Unit]
Description=Kafka Connect - Distributed
After=network.target cloudera-scm-agent
[Service]
Type=forking
ExecStart=/bin/bash -c "/app/cloudera/parcels/KAFKA/lib/kafka/bin/connect-distributed.sh -daemon /app/cloudera/kafka-connect/connect-distributed.properties"
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
2019-07-18 13:40:27,962 INFO (main) [ConnectDistributed(main:69)] Scanning for plugin classes. This might take a moment ...
2019-07-18 13:40:27,992 INFO (main) [DelegatingClassLoader(registerPlugin:184)] Loading plugin from: /app/cloudera/kafka-connect/plugins/splunk-kafka-connect.jar
2019-07-18 13:40:27,993 DEBUG (main) [DelegatingClassLoader(registerPlugin:191)] Loading plugin urls: [file:/app/cloudera/kafka-connect/plugins/splunk-kafka-connect.jar]
2019-07-18 13:40:29,206 DEBUG (main) [VersionUtils(getVersionFromProperties:63)] found git version string=v1.1.0 in version.properties file
2019-07-18 13:40:29,219 INFO (main) [DelegatingClassLoader(scanUrlsAndAddPlugins:207)] Registered loader: PluginClassLoader{pluginLocation=file:/app/cloudera/kafka-connect/plugins/splunk-kafka-connect.jar}
2019-07-18 13:40:29,220 INFO (main) [DelegatingClassLoader(addPlugins:136)] Added plugin 'com.splunk.kafka.connect.SplunkSinkConnector'
2019-07-18 13:40:29,220 INFO (main) [DelegatingClassLoader(addPlugins:136)] Added plugin 'org.apache.kafka.connect.storage.StringConverter'
My next thought was to try something a bit simpler and just create an init.d script at /etc/init.d/kafka-connect which works fine because it is nothing more than a shell script wrapper UNTIL I source in the /etc/init.d/functions file which causes this to be started via systemd again.
Two main questions -
What does systemctl do differently than a regular shell script that would cause this shell script (which in turn launches a java process) to hang at that exact same step everytime.
If my /etc/init.d/kafka-connect script works, is it okay to use on RHEL7? If so, is there a way to load that init.d script on boot of the server?
Thanks in advance!

Angular end-to-end tests on random port

We are running angular e2e tests on a CI environment where tests are run at the same time on the same build slave (for example for different branches).
Since our recent upgrade to angular 7 (from angular 5) protractor uses the default port (4200).
CI jobs now occasionally are failing because port 4200 is in use.
I found the option to run with port 0:
ng e2e --port 0
This does seem to use a random port, but the tests fail, see below.
I tried on a clean new angular project created with angular cli, no changes.
ng e2e
works fine
How can I get the e2e tests to run without port number clashes?
Angular CLI: 7.1.0
node: v8.9.3
OS: Windows 10 Version 1607
Thanks in advance,
Rob
This output is from the failing run:
$ ng e2e --port 0
** Angular Live Development Server is listening on localhost:49152, open your browser on http://localhost:49152/ **
Date: 2018-12-03T15:16:48.890Z
Hash: 97006afaee956149f40f
Time: 7337ms
chunk {main} main.js, main.js.map (main) 9.77 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 223 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.3 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.43 MB [initial] [rendered]
i 「wdm」: Compiled successfully.
[16:16:49] I/update - chromedriver: file exists C:\Users\rob.gansevles\tmp\noot\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.44.zip
[16:16:49] I/update - chromedriver: unzipping chromedriver_2.44.zip
[16:16:49] I/update - chromedriver: chromedriver_2.44.exe up to date
[16:16:50] I/launcher - Running 1 instances of WebDriver
[16:16:50] I/direct - Using ChromeDriver directly...
DevTools listening on ws://127.0.0.1:50805/devtools/browser/7ee01341-be32-4d52-ae53-0794c11c8864
Jasmine started
[23540:12920:1203/161652.814:ERROR:tcp_socket_win.cc(861)] connect failed: 10049
[23540:12920:1203/161652.814:ERROR:tcp_socket_win.cc(861)] connect failed: 10049
[23540:12920:1203/161652.823:ERROR:tcp_socket_win.cc(861)] connect failed: 10049
[23540:12920:1203/161652.823:ERROR:tcp_socket_win.cc(861)] connect failed: 10049
[16:17:03] E/protractor - Could not find Angular on page http://localhost:0/ : retries looking for angular exceeded
workspace-project App
× should display welcome message
- Failed: Angular could not be found on the page http://localhost:0/. If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
at executeAsyncScript_.then (C:\Users\rob.gansevles\tmp\noot\node_modules\protractor\built\browser.js:720:27)
at ManagedPromise.invokeCallback_ (C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\promise.js:1376:14)
at TaskQueue.execute_ (C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\promise.js:2927:27)
at C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\promise.js:668:7
at
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: Run it("should display welcome message") in control flow
at ControlFlow.emit (C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\events.js:62:21)
at ControlFlow.shutdown_ (C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\promise.js:2674:10)
at shutdownTask_.MicroTask (C:\Users\rob.gansevles\tmp\noot\node_modules\selenium-webdriver\lib\promise.js:2599:53)
From asynchronous test:
Error
at Suite. (C:\Users\rob.gansevles\tmp\noot\e2e\src\app.e2e-spec.ts:10:3)
at Object. (C:\Users\rob.gansevles\tmp\noot\e2e\src\app.e2e-spec.ts:3:1)
at Module._compile (module.js:635:30)
at Module.m._compile (C:\Users\rob.gansevles\tmp\noot\node_modules\ts-node\src\index.ts:439:23)
at Module._extensions..js (module.js:646:10)
at Object.require.extensions.(anonymous function) [as .ts] (C:\Users\rob.gansevles\tmp\noot\node_modules\ts-node\src\index.ts:442:12)
Failures *
1) workspace-project App should display welcome message
- Failed: Angular could not be found on the page http://localhost:0/. If this is not an Angular application, you may need to turn off waiting for Angular.
Please see
https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
Executed 1 of 1 spec (1 FAILED) in 10 secs.
[16:17:03] I/launcher - 0 instance(s) of WebDriver still running
[16:17:03] I/launcher - chrome #01 failed 1 test(s)
[16:17:03] I/launcher - overall: 1 failed spec(s)
[16:17:03] E/launcher - Process exited with error code 1
An unexpected error occurred: undefined
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command

Ionic Serve Not Serving

When I run ionic serve, it builds the app but the server isn't run. Here's the trail:
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729
--dev-logger-port 53703 --nobrowser - Ctrl+C to cancel
[17:55:35] watch started ...
[17:55:35] build dev started ...
[17:55:36] clean started ...
[17:55:36] clean finished in 2 ms
[17:55:36] copy started ...
[17:55:36] deeplinks started ...
[17:55:37] deeplinks finished in 589 ms
[17:55:37] transpile started ...
[17:55:44] transpile finished in 7.38 s
[17:55:44] preprocess started ...
[17:55:44] copy finished in 8.56 s
[17:55:44] preprocess finished in 206 ms
[17:55:44] webpack started ...
After webpack started the cli just exits and i see the normal terminal prompt.
Trying out the npm run ionic:serve command instead results into this error:
TypeError: Cannot read property 'substr' of undefined
So far I've re-installed ionic, same result. A bit unsure how to deal with this one...
It turns out that this is caused when creating multiple component classes in one ts file. Splitting those classes each into their own file solves the problem.
Related to this https://github.com/ionic-team/ionic-app-scripts/issues/796

meteor-up deploy on Amazon EC not working, wait-for-mongo: failed to connect to [127.0.0.1:27017]

I have the following in my mup.json
// Install MongoDB in the server, does not destroy local MongoDB on future setup
"setupMongo": true,
// WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
"setupNode": true,
// WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number.
"nodeVersion": "0.10.43",
// Install PhantomJS in the server
"setupPhantom": false,
// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,
// Application name (No spaces)
"appName": "myapp",
// Location of app (local directory)
"app": "/path/to/myapp",
// Configure environment
"env": {
"PORT": 5555,
"ROOT_URL": "http://myserver.com"
},
I got this in the deploy log
Started TaskList: Deploy app 'myapp' (linux)
[myserver.com] - Uploading bundle
[myserver.com] - Uploading bundle: SUCCESS
[myserver.com] - Setting up Environment Variables
[myserver.com] - Setting up Environment Variables: SUCCESS
[myserver.com] - Invoking deployment process
[myserver.com] x Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
eding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm#2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
js-bson: Failed to load c++ bson extension, using pure JS version
/usr/lib/node_modules/wait-for-mongo/bin/wait-for-mongo:14
throw err;
^
Error: TIMEOUTED_WAIT_FOR_MONGO
at null._onTimeout (/usr/lib/node_modules/wait-for-mongo/lib/waitForMongo.js:20:14)
at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
-----------------------------------STDOUT-----------------------------------
.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
when I ssh to the ec2 server and it looks like mongod is not started?
/opt/myapp$ ps -aux | grep mongod
ubuntu 9566 0.7 2.1 661524 22144 ? Sl 22:32 0:00 node /usr/bin/wait-for-mongo mongodb://127.0.0.1/myapp 300000
ubuntu 9569 0.0 0.0 10464 916 pts/0 S+ 22:33 0:00 grep --color=auto mongod
/opt/myapp$ mongo myapp
MongoDB shell version: 2.6.12
connecting to: myapp
2016-04-05T22:44:07.802+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2016-04-05T22:44:07.803+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
I'm not sure how to gain access to mongo on the server, given that I "handed over" responsibility to meteor-up with "setup-mongo":true.
Any ideas would be appreciated.
update
switched to mupx, and set "deployCheckWaitTime": 300 mongo is now loading correctly. But now I am getting this error:
/bundle/bundle/programs/server/node_modules/fibers/future.js:278
throw(ex);
^
MongoError: driver is incompatible with this server version
at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:398:15)
at [object Object].MongoConnection._ensureIndex (packages/mongo/mongo_driver.js:790:1)
at [object Object].Mongo.Collection._ensureIndex (packages/mongo/collection.js:635:1)
It seems to be related to these issues:
https://github.com/arunoda/meteor-up/issues/841
https://github.com/meteor/meteor/issues/5809
SOLVED
I must had incompatible versions on my system from using mup and also meteor create; meteor mongo earlier on the ec2 server. I linked /opt to an empty folder in a different partition (had space problems) and ran mupx setup/deploy again from scratch. This time it worked fine (with Meteor 1.3).
Strangely, I noticed there was no /opt/nodejs folder, which was probably a leftover from my first attempt with mup.
also, the docker daemon doesn't seem to be running, but I can connect to my mongoDB from an ssh session the mup way
$ mongo myapp // works fine
$ docker exec -it mongodb mongo myapp
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Eclipse using MinGW make fails without msys

As background, I'm trying to build ChibiOS for STM32 on a Windows 8.1 host. This works perfectly well if I simply run make in the demo directory in the msys.bat command prompt. The toolchain and paths should thus be fine.
Now, if I simply set up an Eclipse project, it will try to run make.exe directly and fails. The output is similar to running make (either make.exe or mingw32-make.exe) from a plain cmd prompt.
make all
0 [main] sh 5524 sync_with_child: child 2444(0x188) died before initialization with status code 0xC0000142
22 [main] sh 5524 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 188 sync_with_child: child 1152(0x188) died before initialization with status code 0xC0000142
26 [main] sh 188 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 5096 sync_with_child: child 3200(0x18C) died before initialization with status code 0xC0000142
25 [main] sh 5096 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
0 [main] sh 5232 sync_with_child: child 3820(0x184) died before initialization with status code 0xC0000142
25 [main] sh 5232 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
make: Nothing to be done for 'all'.
20:39:33 Build Finished (took 4s.171ms)
I've seen some info saying this is some aspect of Windows 8.1. Can I convince Eclipse to use msys somehow or is there another known clean way to make a make (any make) work without it?
Possibly related:
http://forum.chibios.org/phpbb/viewtopic.php?p=16023
http://sourceforge.net/p/mingw/bugs/1013/?page=0
Bizarrely, the issue was solved for me by replacing msys-1.0.dll in WinAVR directory with the msys one. I'm guessing there is an ancient version there that somehow gets loaded while it's not in the system path as far as I can tell.
The links in the question refer to updating the dll or replacing it with a patched one.