jitsu deploy reports 500 error, yet app is deployed #40

Closed
dominictarr opened this Issue Jun 8, 2011 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

dominictarr commented Jun 8, 2011

two problems here:

Usage is printed even though a valid command was entered.

server returns 500, yet the app is deployed

info:   Welcome to Nodejitsu
info:   It worked if it ends with Nodejitsu ok
info:   Executing command deploy
info:   Authenticated as dominictarr
info:   Analyzing your application dependencies in server.js
warn:   Your package.json version will be incremented for you automatically.
warn:   About to write /home/dominic/source/dev/nodejitsu-tester/helloworld-fullstacktest/package.json
data:   
data:   {
data:       main: 'server.js',
data:       name: 'helloworld-fullstacktest',
data:       scripts: { start: 'server.js' },
data:       subdomain: 'helloworld-fullstacktest',
data:       version: '0.0.0-49'
data:   }
data:   
prompt: Is this ok? (yes): 
warn:   Creating new snapshot for version 0.0.0-49
info:   Done creating snapshot 0.0.0-49
info:   Updating application helloworld-fullstacktest
info:   Activating snapshot 0.0.0-49 for helloworld-fullstacktest
info:   Starting app helloworld-fullstacktest
help:   
help:   Usage:
help:   
help:   Deploys an application using the following steps:
help:   
help:     1. Creates the application (if necessary)
help:     2. Creates or validates the package.json
help:     3. Packages and creates a new snapshot
help:     4. Stops the application (if neccessary)
help:     5. Starts the application
help:   
help:   jitsu deploy
help:   jitsu apps deploy
help:   
error:  Error running command deploy
error:  Nodejitsu Error (500): Internal Server Error
warn:   Error returned from Nodejitsu
error:  Error: Attempt to start running application
error:      at /root/nodejitsu/lib/nodejitsu/resources/app/controller.js:282:23
error:      at /root/nodejitsu/lib/nodejitsu/resources/app/controller.js:255:5
error:      at /root/nodejitsu/vendor/resourcer/lib/resourcer/resource.js:147:21
error:      at loop (/root/nodejitsu/vendor/resourcer/lib/resourcer/resource.js:63:17)
error:      at Function.runAfterHooks (/root/nodejitsu/vendor/resourcer/lib/resourcer/resource.js:65:10)
error:      at /root/nodejitsu/vendor/resourcer/lib/resourcer/resource.js:144:22
error:      at Object.callback (/root/nodejitsu/vendor/resourcer/lib/resourcer/engines/database.js:39:21)
error:      at /root/nodejitsu/node_modules/cradle/lib/cradle.js:276:26
error:      at IncomingMessage.<anonymous> (/root/nodejitsu/node_modules/cradle/lib/cradle.js:214:72)
error:      at IncomingMessage.emit (events.js:81:20)
info:   Nodejitsu not ok
Owner

indexzero commented Jun 8, 2011

Did you try:

jitsu apps stop
jitsu apps start

Let me know the output there. Usage is shown whenever an error is returned, I agree this is a little clunky.

Contributor

dominictarr commented Jun 8, 2011

Okay,
If you try to start or deploy an app that is already started, then you get an error.

If the app is stopped when you deploy or start then there will not be an error.

It should probably just say that the app is already started, or that it was stopped, deployed, and started.

Owner

indexzero commented Jun 8, 2011

@dominictarr This is unexpected. Checkout out apps.deploy:startApp(). We currently stop the application before trying to deploy it, so I'm unsure why you're getting this error. Can you investigate further?

Contributor

dominictarr commented Jun 8, 2011

will do.

On Wed, Jun 8, 2011 at 4:16 PM, indexzero <
reply@reply.github.com>wrote:

@dominictarr This is unexpected. Checkout out apps.deploy:startApp().
We currently stop the application before trying to deploy it, so I'm unsure
why you're getting this error. Can you investigate further?

Reply to this email directly or view it on GitHub:
#40 (comment)

@dominictarr dominictarr added a commit that referenced this issue Jun 9, 2011

@dominictarr dominictarr [fix] fix issue #40. some errors where introduced in 7087476 . existi…
…ng.state is deleted, so the branch which stops the app only when exiting.state === 'started' never gets executed.
e68f368
Contributor

dominictarr commented Jun 9, 2011

okay, so basically the control flow in deploy has been broken in 7b23e4d

this section of code needs re-factoring. but there are no tests, at least the API client needs tests. will open another issue for that.

dominictarr closed this Jun 9, 2011

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