3.3.0 Upgrade Support
-
I see this:
Updating NodeBB... 1. Updating package.json file with defaults... OK 2. Bringing base dependencies up to date... started changed 2 packages, and audited 886 packages in 5s 94 packages are looking for funding run `npm fund` for details 8 vulnerabilities (7 moderate, 1 high) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. npm notice npm notice New minor version of npm available! 9.6.7 -> 9.8.1 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.8.1 npm notice Run npm install -g [email protected] to update! npm notice 3. Checking installed plugins for updates...Checking installed plugins and themes for updates... OK All packages up-to-date! 4. Updating NodeBB data store schema... Parsing upgrade scripts... OK | 1 script(s) found, 129 skipped → [2023/7/27] Set mid on message objects and create messages:mid... [##############] (15/15) 100%
-
this was the first try:
4. Updating NodeBB data store schema... Parsing upgrade scripts... OK | 5 script(s) found, 125 skipped → [2023/7/2] Update chat messages to add roomId field... [##############] (15/15) 100% OK (0.36 seconds) → [2023/7/3] Store list of chat rooms... [##############] (15/15) 100% OK (0.40 seconds) → [2023/7/14] Create chat:room:<room_id>uids:online zset... [##############] (15/15) 100% OK (0.04 seconds) → [2023/7/17] Create chat:room:<room_id>:owners zset... [##############] (15/15) 100% OK (0.07 seconds) → [2023/7/27] Set mid on message objects and create messages:mid... [##############] (15/15) 100%
-
@baris it's the teaser
a href
which I expected to use the default, and thealert
classes which I had defined and we're working prior to3.3
and now seem to have changed CSS classes.Not an issue, but a bit of additional and unexpected work.
-
Can you modify this file https://github.com/NodeBB/NodeBB/blob/master/src/upgrades/3.3.0/chat_message_mids.js#L43-L44 at that line and change it to
console.log('1'); const count = await db.sortedSetCard(`messages:mid`); console.log('2'); await db.setObjectField('global', 'messageCount', count); console.log('3');
Then run the upgrade again with
./nodebb upgrade chat_message_mids
let me know what output you get. Seems like that upgrade script is getting stuck. -
When I test on psql I get the following output, obviously I don't have the same data as you.
Updating NodeBB... Parsing upgrade scripts... OK | 1 script(s) found → [2023/7/27] Set mid on message objects and create messages:mid... [##############] (2/2) 100% 1 2 3 OK (0.04 seconds) Schema update complete!
-
@baris
I replaced L17 - L18 with this:await batch.processSortedSet(`chat:room:${roomId}:mids`, async (mids) => { console.log(`mids: ${mids}`); let messageData = await db.getObjects(mids.map(mid => `message:${mid}`)); console.log(`messageData: ${messageData}`);
and get this:
Updating NodeBB... Parsing upgrade scripts... OK | 1 script(s) found → [2023/7/27] Set mid on message objects and create messages:mid... [##############] (15/15) 100% mids: 24,25,26,27,28,29 mids: 7,8,9,10,22,23 mids: 30,31,32 mids: 33,34,35,36,37,38,39 mids: 15 mids: 11,12,13,14,16,17,18,19 mids: 4,6,20,21 mids: 1,2 mids: 3,5
looks like
messageData
is never resolving... -
@sweetp Actually can you modify the getObjects method here https://github.com/NodeBB/NodeBB/blob/master/src/database/postgres/hash.js#L131-L153 and let me know the output.
module.getObjects = async function (keys, fields = []) { if (!Array.isArray(keys) || !keys.length) { return []; } console.log('a', keys.length, fields.length); if (fields.length) { return await module.getObjectsFields(keys, fields); } console.log('b'); const res = await module.pool.query({ name: 'getObjects', text: ` SELECT h."data" FROM UNNEST($1::TEXT[]) WITH ORDINALITY k("_key", i) LEFT OUTER JOIN "legacy_object_live" o ON o."_key" = k."_key" LEFT OUTER JOIN "legacy_hash" h ON o."_key" = h."_key" AND o."type" = h."type" ORDER BY k.i ASC`, values: [keys], }); console.log('c'); return res.rows.map(row => row.data); };
Let me know what you see after you run the upgrade again with those modifications.