Ionic Serve Not Serving - ionic-framework

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

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 doesn't work/ exits batch

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

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?

iRODS configuration - Could not start iRODS server during

I've installed postgres as database and then iRODS in Ubuntu 14.04. Then I start its configuration
sudo /var/lib/irods/packaging/setup_irods.sh
After the configuration phase, when iRODS starts the updtating, the first 4 steps go well
Stopping iRODS server...
-----------------------------
Running irods_setup.pl...
Step 1 of 4: Configuring database user...
Updating user's .pgpass...
Skipped. File already uptodate.
Step 2 of 4: Creating database and tables...
Checking whether iCAT database exists...
[mydb] on [localhost] found.
Updating user's .odbc.ini...
Creating iCAT tables...
Skipped. Tables already created.
Testing database communications...
Step 3 of 4: Configuring iRODS server...
Updating /etc/irods/server_config.json...
Updating /etc/irods/database_config.json...
Step 4 of 4: Configuring iRODS user and starting server...
Updating iRODS user's ~/.irods/irods_environment.json...
Starting iRODS server...
but at the end I get this error
Could not start iRODS server.
Starting iRODS server...
Traceback (most recent call last):
File "/var/lib/irods/iRODS/scripts/python/get_db_schema_version.py", line 77, in <module>
current_schema_version = get_current_schema_version(cfg)
File "/var/lib/irods/iRODS/scripts/python/get_db_schema_version.py", line 61, in get_current_schema_version
'get_current_schema_version: failed to find result line for schema_version\n\n{}'.format(format_cmd_result(result)))
RuntimeError: get_current_schema_version: failed to find result line for schema_version
return code: [0]
stdout:
stderr:
ERROR: relation "r_grid_configuration" does not exist
LINE 1: ...option_value from R_GRID_CON...
^
Confirming catalog_schema_version... Success
Validating [/var/lib/irods/.irods/irods_environment.json]... Success
Validating [/etc/irods/server_config.json]... Success
Validating [/etc/irods/hosts_config.json]... Success
Validating [/etc/irods/host_access_control_config.json]... Success
Validating [/etc/irods/database_config.json]... Success
(1) Waiting for process bound to port 5432 ... [-]
(2) Waiting for process bound to port 5432 ... [-]
(4) Waiting for process bound to port 5432 ... [-]
Port 5432 In Use ... Not Starting iRODS Server
Install problem:
Cannot start iRODS server.
Found 0 processes:
There are no iRODS servers running.
Abort.
Have you any ideas on what went wrong?
Because I don't have enough reputation to comment:
Which version of iRODS are you using?
This portion of the output:
Creating iCAT tables...
Skipped. Tables already created.
combined with this portion:
ERROR: relation "r_grid_configuration" does not exist
suggests that the setup ran before, but only partially completed, leaving the system in a broken state. I would recommend reinstallating from scratch, which includes:
Uninstalling the iRODS icat and db plugin packages:
sudo dpkg -P irods-icat irods-database-plugin-postgres
note: make sure to use the -P, so that the configuration files are removed from dpkg's database.
Dropping and remaking the database
Deleting the following directories:
sudo rm -rf /tmp/irods /etc/irods /var/lib/irods
Reinstalling the packages and running sudo /var/lib/irods/packaging/setup_irods.sh
This portion of the output:
(1) Waiting for process bound to port 5432 ... [-]
(2) Waiting for process bound to port 5432 ... [-]
(4) Waiting for process bound to port 5432 ... [-]
Port 5432 In Use ... Not Starting iRODS Server
suggests that you are using port 5432 as your iRODS server port. This will conflict with the default Postgres port. I recommend using the default iRODS server port of 1247. This value was queried during setup as:
iRODS server's port [1247]:
and is recorded in /etc/irods/server_config.json under the zone_port entry.
iRODS-Chat:
It may be easier to continue this on the iRODS-Chat google group. Repairing installs can require back-and-forth communication, which may not be inline with standard stackoverflow usage.