Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Broken app can appear to be working even if it's not #64

Closed
goatslacker opened this Issue Jul 12, 2011 · 7 comments

Comments

Projects
None yet
4 participants

By restarting the app, stopping it, then starting it again, jitsu list tells me the app was started properly when in fact it's not working. See the workflow below:

josh@n0va:~/Development/nms-server-deploy$ jitsu apps start nms-server
info:   Welcome to Nodejitsu
info:   It worked if it ends with Nodejitsu ok
info:   Executing command apps start nms-server
info:   Authenticated as goatslacker
info:   Starting app nms-server
help:   
help:   Usage:
help:   Starts the application in the current directory. If <name>
help:   is supplied then that application is started instead.
help:   
help:   jitsu apps start
help:   jitsu apps start <name>
help:   
error:  Error running command apps start nms-server
error:  Nodejitsu Error (500): Internal Server Error
warn:   Error returned from Nodejitsu
error:  Error: ECONNREFUSED, Connection refused
error:      at Socket._onConnect (net.js:601:18)
error:      at IOWatcher.onWritable [as callback] (net.js:186:12)
info:   Nodejitsu not ok
josh@n0va:~/Development/nms-server-deploy$ jitsu apps restart nms-server
info:   Welcome to Nodejitsu
info:   It worked if it ends with Nodejitsu ok
info:   Executing command apps restart nms-server
info:   Authenticated as goatslacker
info:   Restarting app nms-server
info:   App nms-server has been restarted
info:   Nodejitsu ok
josh@n0va:~/Development/nms-server-deploy$ jitsu apps list
info:   Welcome to Nodejitsu
info:   It worked if it ends with Nodejitsu ok
info:   Executing command apps list
info:   Authenticated as goatslacker
info:   Listing apps
data:   name        state   subdomain   start     latest                            
data:   nms-server  stopped nms         server.js goatslacker-nms-server-1.0.0.tgz  
data:   nodefighter stopped nodefighter server.js goatslacker-nodefighter-0.0.0.tgz 
info:   Nodejitsu ok
josh@n0va:~/Development/nms-server-deploy$ jitsu apps start nms-server
info:   Welcome to Nodejitsu
info:   It worked if it ends with Nodejitsu ok
info:   Executing command apps start nms-server
info:   Authenticated as goatslacker
info:   Starting app nms-server
info:   App nms-server is now started
info:   http://nms.nodejitsu.com on Port 80
info:   Nodejitsu ok
josh@n0va:~/Development/nms-server-deploy$ jitsu apps list
info:   Welcome to Nodejitsu
info:   It worked if it ends with Nodejitsu ok
info:   Executing command apps list
info:   Authenticated as goatslacker
info:   Listing apps
data:   name        state   subdomain   start     latest                            
data:   nms-server  started nms         server.js goatslacker-nms-server-1.0.0.tgz  
data:   nodefighter stopped nodefighter server.js goatslacker-nodefighter-0.0.0.tgz 
info:   Nodejitsu ok
Contributor

AvianFlu commented Aug 11, 2011

I can confirm that running jitsu apps restart <appname> on a stopped app will return a success message without restarting the app. Jitsu v0.4.0. I will look into this.

As for the ECONNREFUSED, @goatslacker , was that a recurring issue? Do you have any other information?

Yes, but only with this particular app. In the code I'm requiring a JSON file which I refuse to publish to github and therefore never gets downloaded onto nodejitsu so the app throws an error.

Contributor

AvianFlu commented Aug 11, 2011

Gotcha. Thanks for the info!

Owner

indexzero commented Aug 11, 2011

@goatslacker Thanks for the tip. We are working on supporting environment variables on nodejitsu very soon.

Contributor

AvianFlu commented Aug 12, 2011

Upon further inspection, https://github.com/nodejitsu/jitsu/blob/master/lib/jitsu/api/apps.js#L109-114 does not appear to be making any distiction between successful and unsuccessful app restart attempts. Furthermore, the API seems to be returning a 200 OK regardless of whether or not the app was started in the first place.

@indexzero sweet! great news for nodejitsu.

@AvianFlu If res is the request response object then I see all the methods there aren't checking status code and handling errors properly, or am I mistaken?

Contributor

jfhbrook commented Nov 16, 2011

As far as I know, this issue has been resolved.

If you are still having problems, feel free to contact us again.

@jfhbrook jfhbrook closed this Nov 16, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment