Closed psychobunny closed 10 years ago
when your DB connection conks out.
Oh, I had no idea this was the reason, but it makes complete sense.
Related to these lines of code -- should we:
process.exit()
-- loader will restart NodeBB automaticallyIf those lines were printing the error there would be a stacktrace no? I think doing a process exit in there causes the stack traces to disappear.
They do show up -- the stack trace is output, and then 3 or 4 _csrf-related stack traces show up, and the NodeBB becomes inaccessible.
At least, they do on development mode, not sure about production mode.
FWIW, when the DB connection dies, the Redis process appears alive and well. For example, right now I can connect to Redis using redis-cli
and run redis-benchmark
, but NodeBB displays {"error":"Cannot read property '_csrf' of undefined"}
.
http://fpaste.org/104601/ http://fpaste.org/104602/ http://fpaste.org/104603/
@frenchja Yep, that's what I'm seeing as well. It's not Redis itself that's failing, just bad usage of it on our end (possibly due to a plugin?), so the db handler dies, and never gets reconnected.
@barisusakli Could we just do db.init()
and call it a day?
I'll begin selectively disabling plugins to see if it is a specific plugin problem. Any ones I should try first in the experiment?
I'm having the same error and i'm only using :
I hope this will help.
@Sakarias-Longhorn If you could give us a full stack trace (from the file logs/output.log
or logs/error.log
, that would help diagnose the underlying issue.
@frenchja -- offhand, none of this plugins look suspicious -- possibly imgbed?
I think that's what you're searching for :
{"level":"error","message":"TypeError: undefined is not a function\n at Object.Topics.createTags (C:\Users\Administrateur\Documents\GitHub\NodeBB\src\topics\tags.js:13:11)\n at C:\Users\Administrateur\Documents\GitHub\NodeBB\src\topics\tags.js:96:14\n at C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\async\lib\async.js:232:13\n at C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\async\lib\async.js:119:25\n at C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\async\lib\async.js:24:16\n at C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\async\lib\async.js:229:17\n at C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\async\lib\async.js:516:34\n at try_callback (C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\redis\index.js:573:9)\n at RedisClient.return_reply (C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\redis\index.js:661:13)\n at ReplyParser.
(C:\Users\Administrateur\Documents\GitHub\NodeBB\node_modules\redis\index.js:309:14)","timestamp":"2014-05-24T23:45:50.074Z"}
Fixed in https://github.com/NodeBB/NodeBB/commit/9079d7f26f0ab94c833febf3f40ac707d99fe3c3 thanks for reporting @Sakarias-Longhorn
Hi!
I'm getting the same error ({ "error": "Cannot read property '_csrf' of undefined"}) , but right after giving in my email/password. Then I have to restart NodeBB to get the forum to work.
When I see the error, the URL is http://192.168.1.120:4567/?loggedin. In the logs/errors.log:
{"level":"error","message":"Error: ERR unknown command 'pexpire'
at ReplyParser.
at ReplyParser.send_error (/home/dusi/nodebb2/node_modules/redis/lib/parser/javascript.js:296:10)
at ReplyParser.execute (/home/dusi/nodebb2/node_modules/redis/lib/parser/javascript.js:181:22)
at RedisClient.on_data (/home/dusi/nodebb2/node_modules/redis/index.js:534:27)
at Socket.
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.
Hey there, sounds like your Redis is out of date. You need a minimum of redis 2.6 for NodeBB :-)
Thanks for the info, its working fine now. :)
From what I could find, this error is caused not by our database handler, but by connect-redis
, which elects to not automatically reconnect when an error is encountered, but just blindly sets req.session
to null
with absolutely no error logging.
My attempts to restart the redis sessionStore from the redis error callback were unsuccessful, so NodeBB will crash with error code 1, which is caught by the loader, and should bring NodeBB back up again.
Related upstream issue: visionmedia/connect-redis#95, but even if merged, would only add more verbose error messages, and not resolve the problem.
This error is the first error to happen when your DB connection conks out. Because of that, loading NodeBB in the browser will display this error and not the related connection error.
I guess this happens because Redis error handling is event based now