Can't start hello world app #375

Closed
bompo opened this Issue May 16, 2012 · 16 comments

Projects

None yet

2 participants

@bompo
bompo commented May 16, 2012

Can't start the initial hello world app :/

bompo@bompo-Dell-System-XPS-L502X:~/nodester/backyardpirates$ nodester app start
nodester info Attemping to start app: backyardpirates
nodester warn false
bompo@bompo-Dell-System-XPS-L502X:~/nodester/backyardpirates$ nodester app info
nodester info Gathering information about: backyardpirates

/usr/lib/node_modules/nodester-cli/lib/app.js:43
      if (data[i].running.hasOwnProperty('indexOf') &&  (data[i].running.index
               ^
ReferenceError: i is not defined
    at /usr/lib/node_modules/nodester-cli/lib/app.js:43:16
    at Request._callback (/usr/lib/node_modules/nodester-cli/node_modules/nodester-api/lib/nodester.js:240:41)
    at Request.callback (/usr/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/main.js:119:22)
    at Request. (native)
    at Request.emit (events.js:70:17)
    at Request. (/usr/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/main.js:521:16)
    at Request.emit (events.js:67:17)
    at IncomingMessage. (/usr/lib/node_modules/nodester-cli/node_modules/nodester-api/node_modules/request/main.js:483:14)
    at IncomingMessage.emit (events.js:88:20)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:127:21)
Collaborator

@bompo did you try to reinstall nodester-cli? The latest version of the tool fixed this error. Can you confirm this?

Collaborator

Fixed on nodester-cli@0.2.50 try:

> npm install -g nodester-cli@latest

We've fixed it in that version.

@alejandro alejandro closed this May 17, 2012
bompo commented May 17, 2012

Info works now but app still refuses to start :/

bompo@bompo-Dell-System-XPS-L502X:~/nodester/backyardpirates$ nodester app startnodester info Attemping to start app: backyardpirates
nodester warn false
bompo@bompo-Dell-System-XPS-L502X:~/nodester/backyardpirates$ nodester app info
nodester info Gathering information about: backyardpirates
nodester info backyardpirates on port 17700 running: failed-to-start 
nodester info gitrepo: git@nodester.com:/node/git/bompo/9547-9cec07b96319c1dbcd8e90e879bee7a0.git
nodester info appfile: server.js
Collaborator

Agh sorry for the previous message wrong window. What are the logs saying?

@ghost
ghost commented May 18, 2012

Also, is there a file in the git repo called "server.js", that's the main file? If not, that'd be the culprit.

bompo commented May 18, 2012

I didn't change the code of the app at all. I just created an app and tried to start it.
Here are my commands for a new example app. Don't know which password the system wanted, I tried my root, user and nodester pass...

bompo@bompo-Dell-System-XPS-L502X:~$ cd nodester
bompo@bompo-Dell-System-XPS-L502X:~/nodester$ nodester app create testb
nodester info creating app: testb server.js
nodester info successfully created app testb to will run on port 17756 from server.js
nodester info run nodester app init testb to setup this app.
bompo@bompo-Dell-System-XPS-L502X:~/nodester$ nodester app init testb
nodester info initializing git repo for testb into folder testb
nodester info cloning the repo git clone git@nodester.com:/node/git/bompo/9603-d6ca31a6b247c2c8216d87cd210af748.git testb
Password: 
Password: 
Password: 
nodester info clone complete
nodester info Writing app data to config in testb/.nodester.appconfig
nodester info writing app files
nodester info writing the package.json file
nodester info processing the initial commit
nodester info testb started.
nodester info Some helpful app commands:

     cd ./testb
     curl http://testb.nodester.com/
      nodester app info
      nodester app logs
      nodester app stop|start|restart
bompo@bompo-Dell-System-XPS-L502X:~/nodester$ nodester app start
nodester info Attemping to start app: 
nodester ERROR Fatal Error! API Response: Cannot PUT /apps/
Reason: HTTP Error 404 returned.
bompo@bompo-Dell-System-XPS-L502X:~/nodester$ cd 
backyardpirates/ testb/           
bompo@bompo-Dell-System-XPS-L502X:~/nodester$ cd testb/
bompo@bompo-Dell-System-XPS-L502X:~/nodester/testb$ nodester app start
nodester info Attemping to start app: testb
nodester warn false
bompo@bompo-Dell-System-XPS-L502X:~/nodester/testb$ nodester app info
nodester info Gathering information about: testb
nodester info testb on port 17756 running: failed-to-start 
nodester info gitrepo: git@nodester.com:/node/git/bompo/9603-d6ca31a6b247c2c8216d87cd210af748.git
nodester info appfile: server.js
@ghost
ghost commented May 18, 2012

What's the contents of the folder testb/?

@alejandro alejandro reopened this May 18, 2012
bompo commented May 18, 2012

looks right to me :/

bompo@bompo-Dell-System-XPS-L502X:~$ cd nodester/testb/
bompo@bompo-Dell-System-XPS-L502X:~/nodester/testb$ ls
package.json  server.js
bompo@bompo-Dell-System-XPS-L502X:~/nodester/testb$ cat server.js 
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\nApp (testb) is running on Node.JS ' + process.version);
}).listen(process.env['app_port'] || 3000);
bompo@bompo-Dell-System-XPS-L502X:~/nodester/testb$ cat package.json 
{
  "name":"testb",
  "node":"0.6.17",
  "author":"bompo"
}
Collaborator

Again, what are the logs saying?

bompo commented May 19, 2012
bompo@bompo-Dell-System-XPS-L502X:~/nodester/testb$ nodester app info
nodester info Gathering information about: testb
nodester info testb on port 17756 running: failed-to-start 
nodester info gitrepo: git@nodester.com:/node/git/bompo/9603-d6ca31a6b247c2c8216d87cd210af748.git
nodester info appfile: server.js
@ghost
ghost commented May 19, 2012

I believe he's referring to the output of nodester app logs.

Collaborator

yes that's what I want and meant:

nodester app logs {appname}
bompo commented May 20, 2012

No logs :/

bompo@bompo-Dell-System-XPS-L502X:~/nodester$ nodester app logs testb
nodester ERROR Fatal Error! API Response: {"status":"failure","message":"No logs available."}
Reason: No logs available.
Collaborator

That's weird. What I'd do is to delete that app and run again the command. This should work.

bompo commented May 20, 2012

Deleted the app, reseted my pass and resend my ssh keys and now it works! :)
Thanks!

@bompo bompo closed this May 20, 2012
Collaborator

Cool! I guess that the initial setup just went wrong.

Hack the planet m/

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