After upgrade to Mongo 4.4 NodeBB fails to start with the following error:
(node:269) DeprecationWarning: Db.createCollection option [strict] is deprecated and will be removed in a later version.
MongoError: Collection already exists. NS: nodebb.pubsub
at MessageStream.messageHandler (/usr/src/app/node_modules/@nodebb/mubsub/node_modules/mongodb/lib/cmap/connection.js:268:20)
at MessageStream.emit (events.js:315:20)
at processIncomingData (/usr/src/app/node_modules/@nodebb/mubsub/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/usr/src/app/node_modules/@nodebb/mubsub/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at doWrite (_stream_writable.js:403:12)
at writeOrBuffer (_stream_writable.js:387:5)
at MessageStream.Writable.write (_stream_writable.js:318:11)
at Socket.ondata (_stream_readable.js:716:22)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12) {
I have tested it locally and I have found out, that:
config.json (e. g. "port": ["4567", "4568"]). It starts without errors when there is a single port (e. g. "port": "4567").mongodb to version 3.3.3 in node_modules/@nodebb/mubsub (even with multiple NodeBB instances = with an array of ports in the config).[*] I have used Docker Mongo images mongo:4.4 and mongo:4.2 for testing.
mongodb 3.6.0:I think I fixed this in https://github.com/NodeBB/mubsub/commit/2d653b9c2156b00b4cb0d9c11d5ba2b26d6e9ed4
"@nodebb/mubsub": "1.7.0",
"@nodebb/socket.io-adapter-mongo": "3.1.0",
I have checked our installation and we have @nodebb/mubsub 1.7.0 and @nodebb/socket.io-adapter-mongo 3.0.1. I think it uses this package.json file.
We plan on releasing 1.15.0 this week you can either wait for that or manually update the socket.io-adapter-mongo dependency.
We will wait for 1.15.0, thanks! 馃檪
1.15.0 is released let us know after updating.
It seems that there is the same problem on 1.15.0:
nodebb_1 | 2020-11-05T12:17:08.829Z [4567/183] - info: Initializing NodeBB v1.15.0 http://localhost:4567
nodebb_1 | (node:183) DeprecationWarning: The option `autoReconnect` is incompatible with the unified topology, please read more by visiting http://bit.ly/2D8WfT6
nodebb_1 | (node:183) DeprecationWarning: Db.createCollection option [strict] is deprecated and will be removed in a later version.
nodebb_1 | (node:189) DeprecationWarning: The option `autoReconnect` is incompatible with the unified topology, please read more by visiting http://bit.ly/2D8WfT6
nodebb_1 | (node:189) DeprecationWarning: Db.createCollection option [strict] is deprecated and will be removed in a later version.
nodebb_1 | MongoError: Collection already exists. NS: nodebb.pubsub
nodebb_1 | at MessageStream.messageHandler (/usr/src/app/node_modules/mongodb/lib/cmap/connection.js:268:20)
nodebb_1 | at MessageStream.emit (events.js:315:20)
nodebb_1 | at processIncomingData (/usr/src/app/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
nodebb_1 | at MessageStream._write (/usr/src/app/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
nodebb_1 | at doWrite (_stream_writable.js:403:12)
nodebb_1 | at writeOrBuffer (_stream_writable.js:387:5)
nodebb_1 | at MessageStream.Writable.write (_stream_writable.js:318:11)
nodebb_1 | at Socket.ondata (_stream_readable.js:716:22)
nodebb_1 | at Socket.emit (events.js:315:20)
nodebb_1 | at addChunk (_stream_readable.js:295:12) {
nodebb_1 | ok: 0,
nodebb_1 | code: 48,
nodebb_1 | codeName: 'NamespaceExists'
nodebb_1 | }
Did you check the install versions of these dependencies?
"@nodebb/mubsub": "1.7.0",
"@nodebb/socket.io-adapter-mongo": "3.1.0",
npm ls @nodebb/mubsub
npm ls @nodebb/socket.io-adapater-mongo