strongloop / strong-pm

deployer for node applications
http://strong-pm.io
Other
1k stars 71 forks source link

Loopback App Not Listening On Any Ports When Deployed to Remote Ubuntu Instance Running Strong-PM #301

Closed pvijeh closed 4 years ago

pvijeh commented 8 years ago

I am attempting to deploy a strongloop app to a Digitalocean remote box running Strongloop Process Manager. I have gotten as far as successfully running the deploy command as follows:

USER ~/projects/loopback/places-api $ slc deploy http://IPADDRESS deploy

Counting objects: 5215, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4781/4781), done.
Writing objects: 100% (5215/5215), 7.06 MiB | 4.27 MiB/s, done.
Total 5215 (delta 1130), reused 0 (delta 0)
To http://104.131.66.124:8701/api/services/1/deploy/default
 * [new branch]      deploy -> deploy
Deployed `deploy` as `placesAPI` to `http://IPADDRESS:8701/`

Next, I check the status of my Strongloop app by running the following command:

slc ctl -C http://IPADDRESS:8701

Service ID: 1
Service Name: placesAPI
Environment variables:
No environment variables defined

Instances:
    Version  Agent version  Debugger version  Cluster size  Driver metadata
     5.1.0       2.0.2             n/a              1             N/A
Processes:
       ID      PID  WID  Listening Ports  Tracking objects?  CPU profiling?  Tracing?  Debugging?
    1.1.1050  1050   0
    1.1.2065  2065   49

At this point, I am not able to access my app by visiting IPADDRESS:3001 as the Strongloop documentation would suggest and there are no processes listed in the above app status running on port 3001 as would be expected according to the Strongloop documentation.

Comparing my app status to the app status at this state of deployment shown in the Strongloop documentation, It appears I should have some processes listening to port 3001 which are not running in my app.

Here is the app status shown in the Strongloop documentation:

$ slc ctl -C http://prod.foo.com:7777

Service ID: 1 Service Name: appone Environment variables: No environment variables defined

Instances: Version Agent version Cluster size 4.0.30 1.4.15 4 Processes: ID PID WID Listening Ports Tracking objects? CPU profiling? 1.1.22555 22555 0 1.1.22741 22741 5 prod.foo.com:3001 1.1.22748 22748 6 prod.foo.com:3001 1.1.22773 22773 7 prod.foo.com:3001 1.1.22793 22793 8 prod.foo.com:3001 Notice the additional processes listening to port 3001.

My question is: how do I get my strongloop app to run and listen to these ports?

If it helps here are my package.json and config.json files:

:::::::::::::::::::::::package.json::::::::::::::::

{ "name": "placesAPI", "version": "1.0.0", "main": "server/server.js", "scripts": { "start": "node .", "pretest": "jshint ." }, "dependencies": { "body-parser": "^1.9.0", "compression": "^1.0.3", "connect-ensure-login": "^0.1.1", "cookie-parser": "^1.3.2", "cors": "^2.5.2", "errorhandler": "^1.1.1", "express-flash": "0.0.2", "express-session": "^1.7.6", "jade": "^1.7.0", "loopback": "^2.22.0", "loopback-boot": "^2.6.5", "loopback-component-explorer": "^2.1.0", "loopback-component-passport": "^1.5.0", "loopback-connector-postgresql": "^2.4.0", "loopback-datasource-juggler": "^2.39.0", "passport": "^0.3.2", "passport-facebook": "^1.0.3", "passport-google-oauth": "^0.2.0", "passport-local": "^1.0.0", "passport-oauth2": "^1.1.2", "passport-twitter": "^1.0.3", "serve-favicon": "^2.0.1" }, "devDependencies": { "jshint": "^2.5.6" }, "repository": { "type": "", "url": "" }, "description": "placesAPI", "bundleDependencies": [ "body-parser", "compression", "connect-ensure-login", "cookie-parser", "cors", "errorhandler", "express-flash", "express-session", "jade", "loopback", "loopback-boot", "loopback-component-explorer", "loopback-component-passport", "loopback-connector-postgresql", "loopback-datasource-juggler", "passport", "passport-facebook", "passport-oauth2", "serve-favicon" ] } :::::::::::::::::::::::config.json::::::::::::::::

{ "restApiRoot": "/api", "host": "0.0.0.0", "port": 3000, "cookieSecret": "REDACTED", "remoting": { "context": { "enableHttpContext": false }, "rest": { "normalizeHttpPath": false, "xml": false }, "json": { "strict": false, "limit": "100kb" }, "urlencoded": { "extended": true, "limit": "100kb" }, "cors": false, "errorHandler": { "disableStackTrace": false } }, "legacyExplorer": false }

bistmaster commented 8 years ago

Check on the error logs of the deployment. Might be there is an error upon deploying the application that is why it wont run on the specific port. You do it by "slc ctl --control http://your.remote.host log-dump express-example-app --follow"

wushan commented 7 years ago

For whom is still struggling.

I've the same problem here and I followed @bistmaster 's solution to identify the real problem. In my case i have too much mysql errors which result to a blocked server. Using flush-hosts fixed the problem now.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding.