Can not start passenger stand alone with nodeJS sample app

843 views
Skip to first unread message

Ahmed El-Sokkary

unread,
Aug 23, 2015, 7:46:06 AM8/23/15
to Phusion Passenger Discussions
I followed the guide: "

Launching a server on Digital Ocean

"
From:

https://www.phusionpassenger.com/library/walkthroughs/deploy/nodejs/digital_ocean/nginx/oss/launch_server.html

but when it comes to finally start up the sample node js application I got the following error:

Error: Cannot find module '/var/www/test/passenger-nodejs-connect-demo//var/www/test/passenger-nodejs-connect-demo/app.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at loadApplication (/usr/share/passenger/helper-scripts/node-loader.js:120:2)
    at setupEnvironment (/usr/share/passenger/helper-scripts/node-loader.js:91:2)
    at /usr/share/passenger/helper-scripts/node-loader.js:63:5
    at LineReader.readLine (/usr/share/passenger/node/phusion_passenger/line_reader.js:123:3)
    at readNextOption (/usr/share/passenger/helper-scripts/node-loader.js:61:15)
    at /usr/sh

Command used to start up the application from the same application folder:
passenger start --app-type node --startup-file app.js

I don't know why it tries to start the module with duplicate application path?!!!


Hongli Lai

unread,
Aug 23, 2015, 7:52:29 AM8/23/15
to phusion-passenger
You have unfortunately run into a regression in Passenger 5.0.15.
We've already fixed this, and plan on releasing the fix on Monday. In
the mean time, try passing an absolute path to app.js, like this:

passenger start --app-type node --startup-file
/var/www/test/passenger-nodejs-connect-demo/app.js
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/21fcc9f8-50e3-4880-81e5-f4d3c359edc7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 63501007 (The Netherlands)

Ahmed El-Sokkary

unread,
Aug 23, 2015, 7:55:31 AM8/23/15
to Phusion Passenger Discussions, hon...@phusion.nl
I tried this solution but still getting the same error:

passenger start --app-type node --startup-file /var/www/test/passenger-nodej                                                                                    s-connect-demo/app.js
=============== Phusion Passenger Standalone web server started ===============
PID file: /var/www/test/passenger-nodejs-connect-demo/passenger.3000.pid
Log file: /var/www/test/passenger-nodejs-connect-demo/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
===============================================================================
App 6800 stdout:
App 6800 stderr:
App 6800 stderr: module.js:340
App 6800 stderr:     throw err;
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr:
App 6800 stderr: ^
App 6800 stderr:
App 6800 stderr: Error: Cannot find module '/var/www/test/passenger-nodejs-connect-demo//var/www/test/passenger-nodejs-co                                                                                    nnect-demo/app.js'
App 6800 stderr:     at Function.Module._resolveFilename (module.js:338:15)
App 6800 stderr:     at Function.Module._load (module.js:280:25)
App 6800 stderr:     at Module.require (module.js:364:17)
App 6800 stderr:     at require (module.js:380:17)
App 6800 stderr:     at loadApplication (/usr/share/passenger/helper-scripts/node-loader.js:120:2)
App 6800 stderr:     at setupEnvironment (/usr/share/passenger/helper-scripts/node-loader.js:91:2)
App 6800 stderr:     at /usr/share/passenger/helper-scripts/node-loader.js:63:5
App 6800 stderr:     at LineReader.readLine (/usr/share/passenger/node/phusion_passenger/line_reader.js:123:3)
App 6800 stderr:     at readNextOption (/usr/share/passenger/helper-scripts/node-loader.js:61:15)
App 6800 stderr:     at /usr/share/passenger/helper-scripts/node-loader.js:70:5
[ 2015-08-23 07:53:59.4454 6764/7fb4cc5b2700 App/Implementation.cpp:303 ]: Could not spawn process for application /var/w                                                                                    ww/test/passenger-nodejs-connect-demo: An error occurred while starting the web application. It exited before signalling                                                                                     successful startup back to Phusion Passenger.
  Error ID: 5794cfa8
  Error details saved to: /tmp/passenger-error-j54tWV.html
  Message from application: An error occurred while starting the web application. It exited before signalling successful                                                                                     startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-s                                                                                    tartup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>

Hongli Lai

unread,
Aug 23, 2015, 8:08:05 AM8/23/15
to Ahmed El-Sokkary, Phusion Passenger Discussions
Try this then. Edit
/usr/share/passenger/helper-scripts/node-loader.js. Look for this
line:

require(appRoot + '/' + startupFile);

Replace it with:

require(startupFile);

This should fix it until we've published the next version.

On Sun, Aug 23, 2015 at 1:55 PM, Ahmed El-Sokkary

Ahmed El-Sokkary

unread,
Aug 23, 2015, 8:14:22 AM8/23/15
to Phusion Passenger Discussions, ahmed....@gmail.com, hon...@phusion.nl
Thank you very much for your great support! appreciated :-)
Reply all
Reply to author
Forward
0 new messages