BSONElement: bad type 101

Description

display admin page “users” not working:

logs:

May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]: Exception while invoking method 'spotlight' MongoError: BSONElement: bad type 101
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at MessageStream.messageHandler (/snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:272:20)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at MessageStream.emit (events.js:400:28)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at MessageStream.emit (domain.js:475:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at processIncomingData (/snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at MessageStream._write (/snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at writeOrBuffer (internal/streams/writable.js:358:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at MessageStream.Writable.write (internal/streams/writable.js:303:10)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Socket.ondata (internal/streams/readable.js:731:22)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Socket.emit (events.js:400:28)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Socket.emit (domain.js:475:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at addChunk (internal/streams/readable.js:293:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at readableAddChunk (internal/streams/readable.js:267:9)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Socket.Readable.push (internal/streams/readable.js:206:10)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at TCP.callbackTrampoline (internal/async_hooks.js:130:17)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:  => awaited here:
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Function.Promise.await (/snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Spotlight._searchOutsiderUsers (server/lib/spotlight.js:105:16)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Spotlight.searchUsers (server/lib/spotlight.js:225:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at MethodInvocation.spotlight (server/publications/spotlight.js:24:34)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at MethodInvocation.methodsMap.<computed> (app/lib/server/lib/debug.js:74:34)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1885:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at packages/ddp-server/livedata_server.js:769:19
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at packages/ddp-server/livedata_server.js:767:46
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at packages/ddp-server/livedata_server.js:765:46
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at new Promise (<anonymous>)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at Session.method (packages/ddp-server/livedata_server.js:739:23)
May  9 15:43:43 rocketchat rocketchat-server.rocketchat-server[3493]:     at packages/ddp-server/livedata_server.js:603:43

Server Setup Information

  • Version of Rocket.Chat Server: 4.6.2
  • Operating System: linux
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: v14.18.3
  • MongoDB Version: 4.2.17
  • Proxy: caddy
  • Firewalls involved:

maybe my mongodb is damaged? how could i fix it? Thx!

Erik

Hi!

I did a quick search, and indeed a lot of results pointed out to mongodb corruption.

I am not sure how one could fix that, but I suggest your looking for something at the mongo docs or mongo community :grimacing:

Here some more info:

i could fix it with a mongodb repair:

sudo /snap/rocketchat-server/current/bin/mongod --repair --dbpath /var/snap/rocketchat-server/common/
1 Like

That’s awesome, @erik.test

Thanks for sharing!