Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

deployment issues #477

Open
pbunyasrie opened this issue Mar 30, 2015 · 1 comment
Open

deployment issues #477

pbunyasrie opened this issue Mar 30, 2015 · 1 comment

Comments

@pbunyasrie
Copy link

I'm trying to run self-hosted badgekit under phusion passenger 5.0.5 (and nodejs v0.10.33), but get this error:

App 9560 stdout:
App 9560 stdout: [Function]
App 9560 stderr: connect.multipart() will be removed in connect 3.0
App 9560 stderr: visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
App 9560 stderr: connect.limit() will be removed in connect 3.0
[ 2015-03-30 13:46:11.3136 9479/7fac4818b700 App/Implementation.cpp:287 ]: Could not spawn process for application /www/badgekit.local/html: An error occurred while starting the web application: it did not write a startup response in time.
  Error ID: f3e2ea58
  Error details saved to: /tmp/passenger-error-nE1kpZ.html
  Message from application: An error occurred while starting the web application: it did not write a startup response in time. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>
[Function]
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
</pre>

[ 2015-03-30 13:46:11.3268 9479/7fac4a2cd700 age/Hel/Req/CheckoutSession.cpp:252 ]: [Client 2-1] Cannot checkout session because a spawning error occurred. The identifier of the error is f3e2ea58. Please see earlier logs for details about the error.

I have the badgekit-api running in a separete process (independent of phusion passenger).
Badgekit-web works fine if I use forever/node instead of passenger.

I've confirmed that node.js is working under phusion passenger by creating a quick Express app.
Has anyone gotten badgekit working under phusion passenger? What is the recommended way to deploy self-hosted badgekit to the public internet?

FooBarWidget added a commit to phusion/openbadges-badgekit that referenced this issue Apr 16, 2015
BadgeKit calls `app.listen()` based on whether `module.parent` is null.
But when BadgeKit is loaded from Passenger, `module.parent` is not null
because Passenger does not run `index.js` directly, but `require()`s it
from another file.

So in this commit we also check for `module.parent.isApplicationLoader`
in the conditional. Passenger sets this flag, and it is proposed that
other apps (e.g. PM2) could set this flag in the future too.

The `module.parent.isApplicationLoader` mechanism is used by for example
the CompoundJS framework, which suffered from a similar problem. The
discussion is here:
https://groups.google.com/forum/#!topic/phusion-passenger/6Cojr55tzfw

The mechanism is documented in the Passenger 4.0.34 changelog entry:
https://github.com/phusion/passenger/blob/release-5.0.6/CHANGELOG#L577-L590

This issue was originally reported here:
phusion/passenger#1460
mozilla#477
@FooBarWidget
Copy link

This issue can be closed in favor of the pull request I just sent.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants