Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: rdb.connect is not a function #8560

Closed
rez0n opened this issue Aug 12, 2020 · 5 comments
Closed

TypeError: rdb.connect is not a function #8560

rez0n opened this issue Aug 12, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@rez0n
Copy link

rez0n commented Aug 12, 2020

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.

  • NodeBB version: 1.14.2
  • NodeBB git hash: 28970b0
  • Installed NodeBB Plugins: Just default plugins from release archive
  • Database type: redis
  • Database version: redis:latest
  • Exact steps to cause this issue:
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)
@rez0n
Copy link
Author

rez0n commented Aug 12, 2020

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}]}

@barisusakli
Copy link
Member

Your second error is fixed in 3268273

@barisusakli barisusakli self-assigned this Aug 21, 2020
@barisusakli barisusakli added this to the 1.15.0 milestone Aug 21, 2020
@barisusakli
Copy link
Member

@rez0n let me know if the issue is resolved after above change.

@rez0n
Copy link
Author

rez0n commented Aug 23, 2020

@barisusakli thank you. Work perfectly.

@rez0n
Copy link
Author

rez0n commented Nov 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants