General information:
NodeBB-Version: v1.10.2
MongoDB: v3.6.8
NodeJS: v8.12.0
npm: 6.4.1
OS: Ubuntu 16.04.5 LTS
Language: German (de-DE)
Installation directory: /srv/nodebb/
Guide used: https://docs.nodebb.org/installing/os/ubuntu/
This error caused NodeBB to not start at all:
2018-11-12T15:37:37.229Z [11150] - error: message=Cannot read property 'forEach' of undefined, stack=TypeError: Cannot read property 'forEach' of undefined
at getPostsRecursive (/srv/nodebb/src/categories/recentreplies.js:188:18)
at /srv/nodebb/src/categories/recentreplies.js:193:4
at Array.forEach (<anonymous>)
at getPostsRecursive (/srv/nodebb/src/categories/recentreplies.js:192:21)
at /srv/nodebb/src/categories/recentreplies.js:193:4
at Array.forEach (<anonymous>)
at getPostsRecursive (/srv/nodebb/src/categories/recentreplies.js:192:21)
at /srv/nodebb/src/categories/recentreplies.js:176:4
at Array.forEach (<anonymous>)
at bubbleUpChildrenPosts (/srv/nodebb/src/categories/recentreplies.js:171:16)
at /srv/nodebb/src/categories/recentreplies.js:104:5
at nextTask (/srv/nodebb/node_modules/async/dist/async.js:5324:14)
at next (/srv/nodebb/node_modules/async/dist/async.js:5331:9)
at /srv/nodebb/node_modules/async/dist/async.js:969:16
at /srv/nodebb/node_modules/async/dist/async.js:473:16
at next (/srv/nodebb/node_modules/async/dist/async.js:5329:29)
I had to comment out following line from /srv/nodebb/src/categories/recentreplies.js (line 188-196) to make my NodeBB run:
function getPostsRecursive(category, posts) {
// category.posts.forEach(function (p) {
// posts.push(p);
// });
//
// category.children.forEach(function (child) {
// getPostsRecursive(child, posts);
// });
}
I'm not sure if this has anything to do with it, but when clicking on certain flags, following error happens. I think a user flagged his own message (somehow?!), however I'm not sure because I can't click on the flag without crashing NodeBB:
2018-11-12T15:46:57.149Z [11883] - error: message=Cannot convert undefined or null to object, stack=TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at /srv/nodebb/src/controllers/mods.js:140:26
at Array.reduce (<anonymous>)
at /srv/nodebb/src/controllers/mods.js:136:41
at /srv/nodebb/node_modules/async/dist/async.js:3888:9
at /srv/nodebb/node_modules/async/dist/async.js:473:16
at iterateeCallback (/srv/nodebb/node_modules/async/dist/async.js:992:24)
at /srv/nodebb/node_modules/async/dist/async.js:969:16
at /srv/nodebb/node_modules/async/dist/async.js:3885:13
at /srv/nodebb/node_modules/async/dist/async.js:473:16
at next (/srv/nodebb/node_modules/async/dist/async.js:5329:29)
at /srv/nodebb/node_modules/async/dist/async.js:969:16
at Object.Categories.buildForSelectCategories (/srv/nodebb/src/categories.js:369:2)
at /srv/nodebb/src/categories.js:341:15
at nextTask (/srv/nodebb/node_modules/async/dist/async.js:5324:14)
at next (/srv/nodebb/node_modules/async/dist/async.js:5331:9)
It seems as this is a database problem because I've retested this on a fresh NodeBB installation (while copying and reusing the database). I'm not that into Databases, so please let me know if I should post any command-outputs here for additional information.