-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PM2 fails to start NodeJS Express Webapps, no errors though #2540
Comments
Would you have a sample app to reproduce this issue? |
As I mentioned, it is on an intranet. But I see the same behavior on two different webapps. |
I created an uber-simple webapp in nodejs. The service runs over https, and all it does is respond to a simple query with a string. And the problem persists even for this simple app. This is about as simple as it gets. So possibly running under https creates an issue |
More details: using NPM packages express, body-parser, mysql, properties-reader, debug. The sample webapp is a plain vanilla webapp. I removed the https, making the app run under plain http. Still the same behavior. So I stripped the app down to the bare metal. app.js:
web/svr:
services/test/test.js is just a simple response (but it never even gets to that point). It crashes immediately,. |
No logs in ~/.pm2/logs ? Can you try using an up-to-date LTS version of nodejs like 4 or 6 ? |
There are log files in .pm2/logs, but they are empty. That's the latest version available on our intranet. |
The weird thing is that pm2 did run successfully with my apps at one point (initially), but then something happened (not sure?), and it got into its current state. So I assume there's some sort of internal switch in pm2 that got changed. |
The pm2 log file is located in ˜/.pm2/pm2.log @edswing any progress? |
I know where the log file was. But it didn't show anything. I've given up and used the linux init.d scripts to configure the processes as daemons. |
I have a web app written in NodeJS/Express that runs fine when I run it from the command line. I am trying to get it to run under pm2 so that it runs continuously, restarting when necessary.
It worked fine for a while, but then stopped working for some reason. Now, when I try to restart it in pm2, it seems to start fine (it gets to the "online" state), but then errors out (changing to the "errored" state). But there are no errors in any of the log files.
I've added a function to the Express app that should log any error stack traces (app.use(function(err, req, res, next) { console.error(err.stack)... ), but that doesn't even show up in the pm2 log files.
I've tried reinstalling pm2, deleting various things in the .pm2 directory, and a few other things, but nothing seems to work at all.
NOTE: This is (failing to) run on an intranet, so copying files for review is not feasible at this time.
Expected behaviour
Expect that PM2 will run properly to run webapps
...
Actual behaviour
Webapp crashes within a second or so with no error messages or other information.
...
Steps to reproduce
(in /home/tomcat/WebMetrics):
pm2 start app.js
...
Software versions used
PM2 Log output
App name:app id:0 online
App [app] with id [0] and [pid [14256] , exited with code [0] via signal [SIGINT]
Script /home/tomcat/WebMetrics/app.js jad too many unstable restarts (16). Stopped. "errored"
cf CONTRIBUTING.md for more informations
The text was updated successfully, but these errors were encountered: