Closed NukeRusich closed 9 years ago
Comment by barisusakli Monday Jun 17, 2013 at 11:09 GMT
Hi prabhu, can you post your config.json file? Seems like the base url isn't set properly.
Comment by julianlam Monday Jun 17, 2013 at 12:25 GMT
Prabhu,
In addition to posting your config.json file, I'd also like to point out that the README.md contains installation instructions that apply to an older version of NodeBB.
After cloning the repository, and running npm install
to resolve deps, you should just need to run node app --setup
to initiate the setup script.
Comment by prabhu Monday Jun 17, 2013 at 14:39 GMT
Hi Guys,
Thanks for coming back quickly!
I noticed the bug in your config generation code, where it was generating url with http:// in it, whereas src/app.js was prefixing http:// at line 15. I quietly tried fixing it. Still getting the same error. Here is my modified config.json.
public/config.json
{
"socket": {
"address": "localhost",
"port": 4567
},
"api_url": "http://localhost:4567/api/"
}
config.json
{
"secret": "secret",
"base_url": "http://localhost",
"port": 4567,
"use_port": true,
"upload_path": "/public/uploads/",
"redis": {
"host": "127.0.0.1",
"port": 6379
}
}
Not to mention getting the same error, while trying from a fresh checkout from git with no modifications.
Hope it helps.
Comment by psychobunny Monday Jun 17, 2013 at 16:24 GMT
Hey Prabhu, welcome to NodeBB :)
Am wondering if you're getting any errors serverside - typically a 500 coming back means something crashed in node.js
If you can provide the node.js stack trace we'll look into it. Thanks!
Comment by julianlam Monday Jun 17, 2013 at 16:32 GMT
By comparing our config files, it looks to be your public/config.json
that is misconfigured (which is odd, as the socket address should match base_url
in the server configuration.)
Try restoring the code to the latest version (back up any changes as necessary!) and try prepending http://
to the "socket address" value in public/config.json
, or by running node app --setup
again.
$ git reset --hard HEAD
$ git pull
$ node app --setup
Comment by prabhu Monday Jun 17, 2013 at 21:25 GMT
I had manually changed the url, since src/app.js was also prefixing http:// resulting in an invalid url.
// Problematic line 15 socket = io.connect('http://' + config.socket.address + config.socket.port? ':' + config.socket.port : '');
I have reset everything like you suggested, still no luck. There is nothing in the console even though there is 500 being returned. Let me try to produce a stack trace somehow.
Comment by julianlam Monday Jun 17, 2013 at 21:43 GMT
Hi Prabhu,
Thanks for being patient with us! Looks like there was an improper usage of the tertiary if in line 15 of public/src/app.js
. I've added the proper parenthesis around it which might help, and removed the vestigial "http://".
Fingers crossed this was the issue!
Comment by prabhu Monday Jun 17, 2013 at 21:49 GMT
I had suspected this too and tried adding the parenthesis last night. Still the same (Just tried as well). Other things I tried are:
Can you let me know what version of node you are using?
Comment by prabhu Monday Jun 17, 2013 at 22:13 GMT
Some logs after enabling logging in websockets.js
Info: Base Configuration OK. info - socket.io started Info: Checking categories... Info: Good. debug - authorized warn - handshake error No cookie transmitted debug - authorized warn - handshake error No cookie transmitted
Comment by prabhu Monday Jun 17, 2013 at 22:28 GMT
ok silly me. Chrome content settings was set to block cookies. Not sure if this is the default setting for this version of chrome. Changing the setting in chrome resolved the issue. Closing this issue.
Comment by barisusakli Monday Jun 17, 2013 at 22:30 GMT
Glad you figured it out. For future reference the minimum version of nodejs required is 0.8.
Issue by prabhu Monday Jun 17, 2013 at 10:07 GMT Originally opened as https://github.com/NodeBB/NodeBB/issues/1
Doesn't work on this version of Chrome. Getting the following socket.io related error.
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Stack trace
GET http://localhost:4567/socket.io/1/?t=1371463646460 500 (Internal Server Error) socket.io.js:1659 Socket.handshake socket.io.js:1659 Socket.connect socket.io.js:1699 Socket socket.io.js:1551 io.connect socket.io.js:94 $.ajax.success app.js:15 fire jquery.js:3074 self.fireWith jquery.js:3186 done jquery.js:8253 callback jquery.js:8796 send jquery.js:8802 jQuery.extend.ajax jquery.js:8154 (anonymous function) app.js:9 (anonymous function) app.js:294