Error on ./nodebb log every few minutes

General Discussion
  • Hello. When I'm looking at the log on my host machine through ./nodebb log, I get this like every 2 minutes:

    (node:5880) UnhandledPromiseRejectionWarning: MongoError: ‘$set’ is empty. You must specify a field like so: {$set: {<field>: …}}
    at Function.create (/var/www/nodebb/node_modules/mongodb/lib/core/error.js:57:12)
    at toError (/var/www/nodebb/node_modules/mongodb/lib/utils.js:123:22)
    at /var/www/nodebb/node_modules/mongodb/lib/operations/common_functions.js:379:39
    at handler (/var/www/nodebb/node_modules/mongodb/lib/core/sdam/topology.js:942:24)
    at /var/www/nodebb/node_modules/mongodb/lib/cmap/connection_pool.js:350:13
    at handleOperationResult (/var/www/nodebb/node_modules/mongodb/lib/core/sdam/server.js:558:5)
    at MessageStream.messageHandler (/var/www/nodebb/node_modules/mongodb/lib/cmap/connection.js:277:5)
    at MessageStream.emit (events.js:315:20)
    at processIncomingData (/var/www/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
    at MessageStream._write (/var/www/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
    (node:5880) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 116)
    

    The "rejection ID" at the end increases every time I get the error. This causes no misfunction in my NodeBB forum whatsoever, I just want to know what is going on and where this error is coming from and what it means.

    Any help or replies are thanked in advance.

  • This could happen if db.setObject is called with an empty object like this db.setObject('someKey', {});.

    Can you put a console log in src/database/mongo/hash.js here. Place the below code and let me know the output.

    if (!Object.keys(data).length) {
       console.log('empty data', new Error('a').stack);
    }
    


Suggested Topics