I am trying to control the process of a nodejs server with a supervisor, but I am having problems working on supervisord.conf. When I deploy, I get the following error:
WARNING: The service crashed at startup or is listening to the wrong port. It failed to respond on port "node" (42801) within 30 seconds. Please check the application logs.
However, when I ssh to the dotcloud server and start the nodejs process manually, it works just fine, indicating that the supervisor is not starting the node instance.
My supervisord.conf looks like this:
[program:node] command = node /home/dotcloud/current/app/server.js autostart=true autorestart=true
And my directory structure is as follows:
.dotcloudignore dotcloud.yml .gitignore app/ app/package.json app/server.js app/supervisord.conf
At this moment, I donβt see what I am doing wrong, since it looks like the same directory structure as here , so I donβt understand what the solution is. Any ideas?
Edit:
After trying a supervisorctl status I get the following:
node FATAL Exited too quickly (process log may have details)
I found that the following error message appears in / var / log / supervisor:
module.js:337 throw new Error("Cannot find module '" + request + "'"); ^ Error: Cannot find module '/home/dotcloud/current/app/server.js' at Function._resolveFilename (module.js:337:11) at Function._load (module.js:279:25) at Array.0 (module.js:484:10) at EventEmitter._tickCallback (node.js:190:38)
I am not sure what causes this.