hoodiehq-archive / my-first-hoodie

⛔ deprecated
Other
157 stars 35 forks source link

Hoodie failing on nodejitsu for no appearent reason. #25

Closed cristiano-belloni closed 11 years ago

cristiano-belloni commented 11 years ago

Hi all, I followed the README tutorial and deployed my app (hh) into nodejitsu. hoodie start in my local directory works fine (server goes up, browser test program works and gives no console error), and deploying to nodejitsu seems to work fine too.

When I try to use http://hoodie-hh.jit.su/, the interface loads correctly, but the console says:

_api/ GET 500 Internal Server Error

The nodejitsu logs are quite unuseful:

[06/24 17:29:53 GMT+0100] [users] creating skeleton/user database ??? [06/24 17:29:53 GMT+0100] [users] [Setup] /modules/users not yet setup [06/24 17:29:53 GMT+0100] [users] [Setup] creatinging object in modules database ??? [06/24 17:30:08 GMT+0100] [www] GET / 200 17ms [06/24 17:30:09 GMT+0100] [www] GET /css/main.css 200 7ms [06/24 17:30:09 GMT+0100] [www] GET /css/bootstrap.min.css 200 13ms [06/24 17:30:09 GMT+0100] [www] GET /js/hoodie.accountbar.bootstrap.js 200 5ms [06/24 17:30:09 GMT+0100] [www] GET /js/vendor/bootstrap.js 200 8ms [06/24 17:30:09 GMT+0100] [www] GET /js/vendor/hoodie.js 200 8ms [06/24 17:30:09 GMT+0100] [www] GET /js/vendor/jquery-1.9.1.js 200 9ms [06/24 17:30:09 GMT+0100] [www] GET /js/bootstrap.modalform.js 200 2ms [06/24 17:30:09 GMT+0100] [www] DELETE /_api/_session 500 74ms [06/24 17:30:09 GMT+0100] [www] GET /js/main.js 200 2ms [06/24 17:30:09 GMT+0100] [www] GET /img/pattern_130.gif 200 1ms - 3.85kb [06/24 17:30:10 GMT+0100] [www] GET /_api/ 500 73ms [06/24 17:30:16 GMT+0100] [www] GET /favicon.ico 200 2ms [06/24 17:30:16 GMT+0100] [www] GET /_api/ 500 45ms [06/24 17:30:19 GMT+0100] [www] GET /_api/ 500 43ms [06/24 17:30:23 GMT+0100] [www] GET /_api/ 500 44ms [06/24 17:30:25 GMT+0100] [www] GET /_api/ 500 45ms [06/24 17:30:29 GMT+0100] [www] GET /_api/ 500 43ms [06/24 17:30:32 GMT+0100] [www] GET /_api/ 500 45ms [06/24 17:30:35 GMT+0100] [www] GET /_api/ 500 44ms [06/24 17:30:39 GMT+0100] [www] GET /_api/ 500 47ms [06/24 17:30:42 GMT+0100] [www] GET /_api/ 500 44ms [06/24 17:30:45 GMT+0100] [www] GET /_api/ 500 43ms

my package.json is as such:

{ "name": "hh", "version": "1.0.0-1", "type": "app", "dependencies": { "hoodie-app": "git://github.com/hoodiehq/hoodie-app.git", "hoodie-worker-users": "git://github.com/hoodiehq/worker-users.git" }, "subdomain": "hoodie-hh", "domains": [ "admin.hoodie-hh.jit.su", "couch.hoodie-hh.jit.su" ], "scripts": { "start": "node node_modules/hoodie-app/bin/start" }, "engines": { "node": "0.8.x" } }

My node is v0.8.2 and npm is 1.1.36

How can I debug this behaviour?

janl commented 11 years ago

I am definitely seeing this as well.

cristiano-belloni commented 11 years ago

NODE_ENV=production npm start works perfectly on local, so it's not an environment issue (double-checked with nodejitsu support)

janl commented 11 years ago

Maybe @caolan has an idea?

cristiano-belloni commented 11 years ago

More info from nodejitsu support:

I also noticed that you have node_modules in .npmignore. There's no reason to include node_modules in .npmignore, because it is already ignored by NPM unless you have bundledDependencies specified in package.json.

I'm not sure what's happening here, but you may want to check what req.url is when it gets to this point: ./node_modules/hoodie-app/lib/middleware/api.js:30: if (!/^\/_api/.test(req.url)) {

Also, not sure if this has anything to do with it: ./node_modules/hoodie-app/node_modules/hoodie-pocket/www/scripts/app.js:5: whereTheMagicHappens = "http://pocket.dev/_api";

There's no logs other than the 500 errors that show it's a problem on our side, so this is definitely something in the application going haywire.

caolan commented 11 years ago

@janesconference do you have COUCH_ADMIN_USER and COUCH_ADMIN_PASS environment variables set on nodejitsu?

cristiano-belloni commented 11 years ago

Mmh, no, I have HOODIE_ADMIN_PASS and HOODIE_ADMIN_USER, as the readme says.

cristiano-belloni commented 11 years ago

@caolan Here's a list of my nodejitsu environment variables:

 SUBDOMAIN  hoodie-hh
 NODE_ENV  production
 COUCH_URL  http://nodejitsudb<mycouchdbnumber>.iriscouch.com:5984
 HOODIE_ADMIN_USER  admin
 HOODIE_ADMIN_PASS  <mypassword>

(please note that NODE_ENV=production npm start works perfectly in local)

cristiano-belloni commented 11 years ago

@caolan I event tried to set them, but the server will give me back a 500 error as usual.

gr2m commented 11 years ago

We had tons of updates and I walked through the whole process again. I was not able to reproduce the issue any more, so I'm going to close it. But feel free to reopen or create a new issue if you still run into a problem