strongloop / strong-pm

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

slc start giving error Error: pm failed, exit with status 1 #179

Closed sandipp closed 9 years ago

sandipp commented 9 years ago

I'm running nodeapp on Centos6, AWS ec2 machine. I've installed strongloop using this command npm install -g strongloop slc -h is available for me. I'm having express.js application my application start point is in /app_path/bin/www for both slc start and slc start www command in /app_path/bin/ giving me following error

Error: pm failed, exit with status 1

sandipp commented 9 years ago

even for your sample app giving me same error

$ git clone https://github.com/strongloop/express-example-app.git
$ cd express-example-app
$ npm install
$ slc start
sam-github commented 9 years ago

Can I have the debug output, please (as a gist, it will be very long):

$ DEBUG=* slc start >debug.log 2>&1
sam-github commented 9 years ago

Your immediate problem happens with the example-express-app, but keep in mind that you must configure the start point for your application:

I'm having express.js application my application start point is in /app_path/bin/www for both slc start and slc start www command in /app_path/bin/ giving me following error

And neither of the above approaches are going to work.

Packages will be run by requiring the first that is found of:

  1. server.js
  2. app.js
  3. main property of package.json
  4. index.js

Creating a server.js consisting of require("app_path/bin/www") might be the most convenient.

sandipp commented 9 years ago

@sam-github I've created server.js then tried modifying package.json as per your instructions, none of it worked, I'm still getting exact same error. Please find output of DEBUG=* slc start >debug.log 2>&1 command as a gist file. slc_debug.log

sandipp commented 9 years ago

@sam-github fyi if I run slc run bin/www or node bin/www for the same project then its working fine, but I really want to use strong-pm.

slc run bin/www 
INFO strong-agent API key not found, StrongOps dashboard reporting disabled.
Generate configuration with:
    npm install -g strongloop
    slc strongops
See http://docs.strongloop.com/strong-agent for more information.
supervisor running without clustering (unsupervised)
rmg commented 9 years ago

@sandipp are you running this on the same server you installed PM as a service on? slc start is failing because there is already something running on its port.

sandipp commented 9 years ago

@rmg, I thought same so, I've reverted all settings and setup new instance with centos7. But now I'm getting new error. I've followed following commands to run strong-pm as service

sudo slc pm-install   --systemd  
sudo /usr/bin/systemctl start strong-pm
systemctl daemon-reload
sudo /usr/bin/systemctl enable strong-pm.service
sudo /usr/bin/systemctl status strong-pm

The last status command sent me this output

strong-pm.service - StrongLoop Process Manager
   Loaded: loaded (/etc/systemd/system/strong-pm.service; enabled)
   Active: active (running) since Wed 2015-04-15 17:55:36 UTC; 142ms ago
 Main PID: 3234 (node)
   CGroup: /system.slice/strong-pm.service
           └─3234 /usr/local/bin/node /usr/local/lib/node_modules/strongloop/node_modules/strong-pm/bin/sl-pm.js --listen 8701 --base /var/lib/strong-pm

Apr 15 17:55:36 ip-172-31-10-33.us-west-2.compute.internal systemd[1]: Starting StrongLoop Process Manager...
Apr 15 17:55:36 ip-172-31-10-33.us-west-2.compute.internal systemd[1]: Started StrongLoop Process Manager.

Now I'm not sure how to add my application path to this daemon?

sandipp commented 9 years ago

I also have tried following command to add my but no success.

sudo slc pm-install   --systemd  --base /path/to/app

I think strong-pm documentation is should be more specific.

sam-github commented 9 years ago

--base is the working directory of pm, not your app, see the pm-install usage.

I recommend you install using the documented procedure: http://strong-pm.io/prod/#npm-install

However, it looks from the output of https://github.com/strongloop/strong-pm/issues/179#issuecomment-93503412 that you sucessfully installed pm.

To add your app, follow the directions here: http://strong-pm.io/prod/ , particularly "Build your application" and "Deploy to a remote host".

ile commented 9 years ago

I got this same error message, and the reason what that https://www.npmjs.com/package/minkelite failed to install with npm install -g strongloop.

More specifically, sqlite3 failed to install with the error message node-pre-gyp: not found. Installing node-pre-gyp manually/globally fixed the problem.

despairblue commented 8 years ago

Same here:

node ../../node_modules/strong-pm/bin/sl-pm.js --base ../../.strong-pm/ 
module.js:328
    throw err;
    ^

Error: Cannot find module '/Users/danny/node_modules/sqlite3/lib/binding/node-v47-darwin-x64/node_sqlite3.node'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/danny/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)

Somehow the sqlite3 install was borked.

npm i sqlite3 fixed it.

NathanBWaters commented 8 years ago

Just had the same problem as @despairblue. The sqlite3 installation that came with Strongloop was acting up.

jason-ivy commented 7 years ago

@sandipp have you solved this problem ?

pineshmenat commented 5 years ago

@jason-ivy I still have that problem, even though I installed sqlite3