Hi, I working on creating docker image for NodeBB that can work with persistent storage and k8s and faced with a strange issue.
NodeBB upgrade script crashing if system have less than 4GB RAM.
Once I expanded my DO droplet to the 4GB of RAM it goes works, then I shrink droplet configuration to the 1GB RAM and again getting error.
docker run --name nodebb -d -p 4567:4567 \
-e DATABASE="redis" \
-e DB_NAME="0" \
-e DB_HOST="192.168.65.2" \
-e DB_PORT="6379" \
nibrev/nodebb:stable
Error
Parsing upgrade scripts...
OK | 68 script(s) found, 22 skipped
Error occurred
โ [2017/4/16] Delete accidentally long-lived sessions...2020-08-12T21:55:47.461Z [7] - warn: NodeBB Setup Aborted.
TypeError: rdb.connect is not a function
at /usr/src/app/src/upgrades/1.4.6/delete_sessions.js:26:23
at nextTask (/usr/src/app/node_modules/async/dist/async.js:4576:27)
at Object.waterfall (/usr/src/app/node_modules/async/dist/async.js:4587:9)
at Object.awaitable [as waterfall] (/usr/src/app/node_modules/async/dist/async.js:208:32)
at Object.method (/usr/src/app/src/upgrades/1.4.6/delete_sessions.js:22:9)
at Promise (internal/util.js:274:30)
at new Promise (<anonymous>)
at Object.method (internal/util.js:273:12)
at Upgrade.process (/usr/src/app/src/upgrade.js:156:6)
at process._tickCallback (internal/process/next_tick.js:68:7)
And one more error in a case when used MongoDB.
1. Updating NodeBB data store schema...2020-08-12T23:07:48.719Z [4567/30] - warn: You have no mongo username/password setup!
Parsing upgrade scripts...
OK | 89 script(s) found, 1 skipped
โ [2015/12/23] Chat room hashes... OK
โ [2015/12/23] Adding theme to active plugins sorted set... OK
โ [2016/1/14] Creating user best post sorted sets... OK
โ [2016/1/20] Creating users:notvalidated... OK
โ [2016/1/23] Creating Global moderators group... OK
โ [2016/2/25] Social: Post Sharing... OK
โ [2016/4/14] Group title from settings to user profile... OK
โ [2016/4/19] Users post count per tid... OK
โ [2016/4/29] Dismiss flags from deleted topics... OK
โ [2016/5/28] Giving topics:read privs to any group that was previously allowed to Find & Access Category... OK
โ [2016/6/13] Store upvotes/downvotes separately... OK
โ [2016/7/12] Giving upload privileges... OK
โ [2016/8/5] Removing best posts with negative scores... OK
โ [2016/8/7] Granting edit/delete/delete topic on existing categories... OK
โ [2016/9/22] Category recent tids... OK
โ [2016/10/8] Favourites to Bookmarks... OK
โ [2016/10/14] Sorted sets for post replies... OK
โ [2016/11/22] Update global and user language keys... OK
โ [2016/11/25] Sorted set for pinned topics... OK
โ [2017/2/25] Update global and user sound settings... OK
โ [2017/2/28] Upgrading config urls to use assets route... OK
โ [2017/4/16] Delete accidentally long-lived sessions... OK
โ [2016/12/7] Migrating flags to new schema... OK
โ [2017/2/27] New sorted set posts:votes... OK
โ [2017/3/22] Update moderation notes to zset... OK
โ [2017/4/14] Set default allowed file extensions... OK
โ [2017/4/26] Remove relative_path from uploaded profile cover urls... OK
โ [2017/5/26] rename user mod privileges group... OK
โ [2017/6/16] Give tag privilege to registered-users on all categories... OK
โ [2017/7/5] Wipe all existing RSS tokens... OK
โ [2017/7/10] Fix incorrect robots.txt schema... OK
โ [2017/7/17] Generate email logo for use in email header... OK
โ [2017/9/6] Clearing stale digest templates that were accidentally saved as custom... OK
โ [2017/9/7] Changing ip blacklist storage to object... OK
โ [2017/10/30] New sorted set cid:<cid>:tids:lastposttime... OK
โ [2017/10/12] Generate customHTML block from old customJS setting... OK
โ [2017/11/15] Convert old notification digest settings... OK
โ [2017/12/8] Add votes to topics... OK
โ [2017/12/18] Change the schema of simple keys so they don't use value field (mongodb only)... OK
โ [2017/12/18] Give chat privilege to registered-users... OK
โ [2018/1/3] Give upload privilege to registered-users globally if it is given on a category... OK
โ [2018/1/8] Fix sort by votes for moved topics... OK
โ [2018/1/9] Give vote privilege to registered-users on all categories... OK
โ [2018/1/12] Rename privileges:downvote and privileges:flag to min:rep:downvote, min:rep:flag respectively... OK
โ [2018/1/22] Fix topics in categories per user if they were moved... OK
โ [2018/2/14] Add default settings for notification delivery types... OK
โ [2018/2/17] Flatten navigation data... OK
โ [2018/2/21] Revising minimum password strength to 1 (from 0)... OK
โ [2018/1/31] Give category access privileges to spiders system group... OK
โ [2018/2/28] Give registered users signature privilege... OK
โ [2018/3/15] Reformatting post diffs to be stored in lists and hash instead of single zset... OK
โ [2018/4/16] Refresh post-upload associations... OK
โ [2018/5/28] Give global search privileges... OK
โ [2018/6/7] Give post history viewing privilege to registered-users on all categories... OK
โ [2018/6/8] Give deleted post viewing privilege to moderators on all categories... OK
โ [2018/6/22] Hash all IP addresses stored in Recent IPs zset... OK
โ [2018/8/28] Record first entry in username/email history... OK
โ [2018/9/24] Upgrade bans to hashes... OK
โ [2018/9/28] Give global local login privileges... OK
โ [2018/10/1] Optimize PostgreSQL sessions... OK
โ [2018/10/4] add filters to events... OK
โ [2018/10/10] Fix category post zsets... OK
โ [2018/10/11] Fix category topic zsets... OK
โ [2018/10/24] Rename maximumImageWidth to resizeImageWidth... OK
โ [2018/11/10] Navigation item visibility groups... OK
โ [2018/11/10] Widget visibility groups... OK
โ [2018/12/11] Remove uid:<uid>:ignored:cids... OK
โ [2018/12/13] Update category watch data... OK
โ [2019/1/4] Group create global privilege... OK
โ [2019/1/5] Global view privileges... OK
Error occurred
Error occurred during upgrade: TypeError: Cannot read property 'uploads' of undefined
at /usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js:16:33
at /usr/src/app/node_modules/async/dist/async.js:148:38
at /usr/src/app/node_modules/async/dist/async.js:2154:44
at replenish (/usr/src/app/node_modules/async/dist/async.js:440:21)
at /usr/src/app/node_modules/async/dist/async.js:445:13
at eachLimit$1 (/usr/src/app/node_modules/async/dist/async.js:2243:34)
at awaitable (/usr/src/app/node_modules/async/dist/async.js:208:32)
at Object.eachSeries (/usr/src/app/node_modules/async/dist/async.js:2271:16)
at Object.awaitable (/usr/src/app/node_modules/async/dist/async.js:208:32)
at batch.processSortedSet.progress (/usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js:15:10)
โ [2019/3/16] Calculate image sizes of all uploaded images...2020-08-12T23:07:52.347Z [4567/30] - error: uncaughtException: Cannot read property 'uploads' of undefined
TypeError: Cannot read property 'uploads' of undefined
at /usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js:16:33
at /usr/src/app/node_modules/async/dist/async.js:148:38
at /usr/src/app/node_modules/async/dist/async.js:2154:44
at replenish (/usr/src/app/node_modules/async/dist/async.js:440:21)
at /usr/src/app/node_modules/async/dist/async.js:445:13
at eachLimit$1 (/usr/src/app/node_modules/async/dist/async.js:2243:34)
at awaitable (/usr/src/app/node_modules/async/dist/async.js:208:32)
at Object.eachSeries (/usr/src/app/node_modules/async/dist/async.js:2271:16)
at Object.awaitable (/usr/src/app/node_modules/async/dist/async.js:208:32)
at batch.processSortedSet.progress (/usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js:15:10) {"error":{},"stack":"TypeError: Cannot read property 'uploads' of undefined\n at /usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js:16:33\n at /usr/src/app/node_modules/async/dist/async.js:148:38\n at /usr/src/app/node_modules/async/dist/async.js:2154:44\n at replenish (/usr/src/app/node_modules/async/dist/async.js:440:21)\n at /usr/src/app/node_modules/async/dist/async.js:445:13\n at eachLimit$1 (/usr/src/app/node_modules/async/dist/async.js:2243:34)\n at awaitable (/usr/src/app/node_modules/async/dist/async.js:208:32)\n at Object.eachSeries (/usr/src/app/node_modules/async/dist/async.js:2271:16)\n at Object.awaitable (/usr/src/app/node_modules/async/dist/async.js:208:32)\n at batch.processSortedSet.progress (/usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js:15:10)","exception":true,"date":"Wed Aug 12 2020 23:07:52 GMT+0000 (Coordinated Universal Time)","process":{"pid":30,"uid":0,"gid":0,"cwd":"/usr/src/app","execPath":"/usr/local/bin/node","version":"v10.22.0","argv":["/usr/local/bin/node","/usr/src/app/nodebb","upgrade","-sb"],"memoryUsage":{"rss":143126528,"heapTotal":110088192,"heapUsed":65989760,"external":18283823}},"os":{"loadavg":[0.78125,0.5517578125,0.31591796875],"uptime":97880},"trace":[{"column":33,"file":"/usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js","function":null,"line":16,"method":null,"native":false},{"column":38,"file":"/usr/src/app/node_modules/async/dist/async.js","function":null,"line":148,"method":null,"native":false},{"column":44,"file":"/usr/src/app/node_modules/async/dist/async.js","function":null,"line":2154,"method":null,"native":false},{"column":21,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"replenish","line":440,"method":null,"native":false},{"column":13,"file":"/usr/src/app/node_modules/async/dist/async.js","function":null,"line":445,"method":null,"native":false},{"column":34,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"eachLimit$1","line":2243,"method":null,"native":false},{"column":32,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"awaitable","line":208,"method":null,"native":false},{"column":16,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"Object.eachSeries","line":2271,"method":"eachSeries","native":false},{"column":32,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"Object.awaitable","line":208,"method":"awaitable","native":false},{"column":10,"file":"/usr/src/app/src/upgrades/1.12.1/post_upload_sizes.js","function":"batch.processSortedSet.progress","line":15,"method":"progress","native":false}]}
Your second error is fixed in https://github.com/NodeBB/NodeBB/commit/326827382a11b0df6e3592cda0f0989dd5301cad
@rez0n let me know if the issue is resolved after above change.
@barisusakli thank you. Work perfectly.
Hi, @barisusakli this issue appearing again on updating to node 12 starting from NodeBB v1.15.0-rc.0
nodebb_1 | โ [2017/4/16] Delete accidentally long-lived sessions...Error occurred
nodebb_1 | Error occurred during upgrade: TypeError: rdb.connect is not a function
nodebb_1 | at /usr/src/app/src/upgrades/1.4.6/delete_sessions.js:26:23
nodebb_1 | at nextTask (/usr/src/app/node_modules/async/dist/async.js:4576:27)
nodebb_1 | at Object.waterfall (/usr/src/app/node_modules/async/dist/async.js:4587:9)
nodebb_1 | at Object.awaitable [as waterfall] (/usr/src/app/node_modules/async/dist/async.js:208:32)
nodebb_1 | at Object.method (/usr/src/app/src/upgrades/1.4.6/delete_sessions.js:22:9)
nodebb_1 | at internal/util.js:297:30
nodebb_1 | at new Promise (<anonymous>)
nodebb_1 | at Object.method (internal/util.js:296:12)
nodebb_1 | at Upgrade.process (/usr/src/app/src/upgrade.js:156:6)
nodebb_1 | at processTicksAndRejections (internal/process/task_queues.js:97:5)
nodebb_1 | 2020-11-01T19:25:18.163Z [4567/11] - error: uncaughtException: rdb.connect is not a function
nodebb_1 | TypeError: rdb.connect is not a function
nodebb_1 | at /usr/src/app/src/upgrades/1.4.6/delete_sessions.js:26:23
nodebb_1 | at nextTask (/usr/src/app/node_modules/async/dist/async.js:4576:27)
nodebb_1 | at Object.waterfall (/usr/src/app/node_modules/async/dist/async.js:4587:9)
nodebb_1 | at Object.awaitable [as waterfall] (/usr/src/app/node_modules/async/dist/async.js:208:32)
nodebb_1 | at Object.method (/usr/src/app/src/upgrades/1.4.6/delete_sessions.js:22:9)
nodebb_1 | at internal/util.js:297:30
nodebb_1 | at new Promise (<anonymous>)
nodebb_1 | at Object.method (internal/util.js:296:12)
nodebb_1 | at Upgrade.process (/usr/src/app/src/upgrade.js:156:6)
nodebb_1 | at processTicksAndRejections (internal/process/task_queues.js:97:5) {"error":{},"stack":"TypeError: rdb.connect is not a function\n at /usr/src/app/src/upgrades/1.4.6/delete_sessions.js:26:23\n at nextTask (/usr/src/app/node_modules/async/dist/async.js:4576:27)\n at Object.waterfall (/usr/src/app/node_modules/async/dist/async.js:4587:9)\n at Object.awaitable [as waterfall] (/usr/src/app/node_modules/async/dist/async.js:208:32)\n at Object.method (/usr/src/app/src/upgrades/1.4.6/delete_sessions.js:22:9)\n at internal/util.js:297:30\n at new Promise (<anonymous>)\n at Object.method (internal/util.js:296:12)\n at Upgrade.process (/usr/src/app/src/upgrade.js:156:6)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","exception":true,"date":"Sun Nov 01 2020 19:25:18 GMT+0000 (Coordinated Universal Time)","process":{"pid":11,"uid":0,"gid":0,"cwd":"/usr/src/app","execPath":"/usr/local/bin/node","version":"v12.19.0","argv":["/usr/local/bin/node","/usr/src/app/nodebb","upgrade","-sbi"],"memoryUsage":{"rss":127987712,"heapTotal":87781376,"heapUsed":55243168,"external":1697635,"arrayBuffers":200466}},"os":{"loadavg":[2.07,1.72,1.49],"uptime":257028},"trace":[{"column":23,"file":"/usr/src/app/src/upgrades/1.4.6/delete_sessions.js","function":null,"line":26,"method":null,"native":false},{"column":27,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"nextTask","line":4576,"method":null,"native":false},{"column":9,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"Object.waterfall","line":4587,"method":"waterfall","native":false},{"column":32,"file":"/usr/src/app/node_modules/async/dist/async.js","function":"Object.awaitable [as waterfall]","line":208,"method":"awaitable [as waterfall]","native":false},{"column":9,"file":"/usr/src/app/src/upgrades/1.4.6/delete_sessions.js","function":"Object.method","line":22,"method":"method","native":false},{"column":30,"file":"internal/util.js","function":null,"line":297,"method":null,"native":false},{"column":null,"file":null,"function":"new Promise","line":null,"method":null,"native":false},{"column":12,"file":"internal/util.js","function":"Object.method","line":296,"method":"method","native":false},{"column":6,"file":"/usr/src/app/src/upgrade.js","function":"Upgrade.process","line":156,"method":"process","native":false},{"column":5,"file":"internal/process/task_queues.js","function":"processTicksAndRejections","line":97,"method":null,"native":false}]}
docker-nodebb_nodebb_1 exited with code 1