3.3.0 Upgrade Support
-
-
@baris said in 3.3.0 Upgrade Support:
You could try adding
.allowDiskUse(true)
to the query at https://github.com/NodeBB/NodeBB/blob/master/src/database/mongo/sorted.js#L397-L401.It throws that error because the data is too big to sort in memory (the default limit is 100mb).
I am working on the new upgrade script that should be aviable later today as 3.3.1.
Hello @baris . Today after update to 3.3.1 I see a new error:
Parsing upgrade scripts... OK | 5 script(s) found, 124 skipped → [2023/7/2] Update chat messages to add roomId field... Error occurred 2023-08-18T19:43:48.782Z [4567/9] - warn: NodeBB Setup Aborted. TypeError: midsSeen.hasOwnProperty is not a function at /usr/src/app/nodebb/src/upgrades/3.3.0/chat_room_refactor.js:41:55 at Array.filter (<anonymous>) at batch.processSortedSet.batch (/usr/src/app/nodebb/src/upgrades/3.3.0/chat_room_refactor.js:41:31) at module.processSortedSet (/usr/src/app/nodebb/src/database/mongo/sorted.js:588:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async exports.processSortedSet (/usr/src/app/nodebb/src/batch.js:30:10) at async batch.processSortedSet.batch (/usr/src/app/nodebb/src/upgrades/3.3.0/chat_room_refactor.js:40:8) at async module.processSortedSet (/usr/src/app/nodebb/src/database/mongo/sorted.js:588:5) at async exports.processSortedSet (/usr/src/app/nodebb/src/batch.js:30:10) at async batch.processArray.batch (/usr/src/app/nodebb/src/upgrades/3.3.0/chat_room_refactor.js:38:6)
Any idea how can I fix this ?
Thank you
-
@baris I am still unable to do the upgrade.. the mongo connection goes down after several minutes running the update:
nodebb | Parsing upgrade scripts... nodebb | OK | 5 script(s) found, 124 skipped nodebb | → [2023/7/2] Update chat messages to add roomId field... nodebb | Error occurred [### ] (502/1775) 28% 2023-08-19T18:27:29.351Z [4567/10] - warn: NodeBB Setup Aborted. nodebb | MongoServerError: cursor id 8839582387884439579 not found nodebb | at Connection.onMessage (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/connection.js:202:26) nodebb | at MessageStream.<anonymous> (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/connection.js:61:60) nodebb | at MessageStream.emit (node:events:513:28) nodebb | at processIncomingData (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:124:16) nodebb | at MessageStream._write (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:33:9) nodebb | at writeOrBuffer (node:internal/streams/writable:392:12) nodebb | at _write (node:internal/streams/writable:333:10) nodebb | at Writable.write (node:internal/streams/writable:337:10) nodebb | at Socket.ondata (node:internal/streams/readable:766:22) nodebb | at Socket.emit (node:events:513:28) nodebb exited with code 1
I guess my only option is to remove chat messages. Is there any tool for this or am I gonna have to figure it out in the DB ? Can I just run a delete on
{_key:"message:*"}
where the timestamp is older than 1 month or something ?If I run this, would i break something ?
db.objects.deleteMany({ "_key": { "$regex": /^message:\d+$/ }, "timestamp": { "$lt": oneMonthAgoTimestamp } });
-
Looks like mongodb cursors have a lifetime of 10minutes so it might be throwing that error after that
Can you run this in your mongo cli?
db.objects.count({_key: "chat:room:<replace_with_global_chat_roomid>:uids"}); db.objects.count({_key: "uid:<replace_with_your_uid>chat:room:<replace_with_global_chat_roomid>:mids"});
So we can get an idea of how many users/messages are in that global chat room.
You can trim those zsets in mongo cli since this is most like only caused by that one room that has all users in the forum but that is a last resort.
-
@baris said in 3.3.0 Upgrade Support:
Looks like mongodb cursors have a lifetime of 10minutes so it might be throwing that error after that
Can you run this in your mongo cli?
db.objects.count({_key: "chat:room:<replace_with_global_chat_roomid>:uids"}); db.objects.count({_key: "uid:<replace_with_your_uid>chat:room:<replace_with_global_chat_roomid>:mids"});
So we can get an idea of how many users/messages are in that global chat room.
You can trim those zsets in mongo cli since this is most like only caused by that one room that has all users in the forum but that is a last resort.
![alt text]( image url)
This is after I removed messages (which btw I believe did not help, I might need to recover a backup of the db).
-
-
@fgallese said in 3.3.0 Upgrade Support:
Thank you @baris for all your help and support, our forum is back online thanks to you.
@fgallese thanks for debugging with me, released 3.3.4 that has the fixes for the upgrade script.
If you don't have a lot of chat messages this doesn't effect you. In @fgallese case the upgrade script took ~2.5 hours due to one room having 150 users and 40k messages.
-
The upgrade script asked me to upgrade the plugin @nodebb/nodebb-plugin-reactions, I do it but it doesn't working after upgrade. no reactions icon appears on topic
Need to uninstall the plugin, rebuild, install and activate the plugin again for working