RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.57k stars 10.58k forks source link

CursorNotFound on LDAP import #19426

Open bellegarde-c opened 4 years ago

bellegarde-c commented 4 years ago

Description:

LDAP import fails to finish

Steps to reproduce:

  1. Run LDAP import

Expected behavior:

No crash

Actual behavior:

Crash

Server Setup Information:

Client Setup Information

Additional context

Relevant logs:


Nov  1 00:38:57 srv-rocket-test rocketchat[15817]: server.js:204 LDAPSync ➔ error MongoError: cursor id 1850802509835155859 not found
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Connection.<anonymous> (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:451:61)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Connection.emit (events.js:210:5)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Connection.EventEmitter.emit (domain.js:475:20)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at processMessage (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:452:10)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Socket.<anonymous> (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:621:15)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Socket.emit (events.js:210:5)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Socket.EventEmitter.emit (domain.js:475:20)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at addChunk (_stream_readable.js:309:12)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at readableAddChunk (_stream_readable.js:290:11)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Socket.Readable.push (_stream_readable.js:224:10)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:  => awaited here:
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Function.Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at packages/mongo/mongo_driver.js:1073:14
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at /opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:  => awaited here:
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Promise.await (/opt/Rocket.Chat/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:60:12)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at SynchronousCursor._nextObject (packages/mongo/mongo_driver.js:1122:38)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at SynchronousCursor.forEach (packages/mongo/mongo_driver.js:1136:22)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Cursor.<computed> [as forEach] (packages/mongo/mongo_driver.js:918:44)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at sync (app/ldap/server/sync.js:574:10)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at MethodInvocation.ldap_sync_now (app/ldap/server/syncUsers.js:24:3)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at MethodInvocation.methodsMap.<computed> (app/lib/server/lib/debug.js:67:34)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at packages/ddp-server/livedata_server.js:719:19
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at packages/ddp-server/livedata_server.js:717:46
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at packages/ddp-server/livedata_server.js:715:46
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at new Promise (<anonymous>)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at Session.method (packages/ddp-server/livedata_server.js:689:23)
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     at packages/ddp-server/livedata_server.js:559:43 {
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:   operationTime: Timestamp { _bsontype: 'Timestamp', low_: 12, high_: 1604187535 },
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:   ok: 0,
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:   code: 43,
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:   codeName: 'CursorNotFound',
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:   '$clusterTime': {
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 12, high_: 1604187535 },
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:     signature: { hash: [Binary], keyId: 0 }
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:   },
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]:   name: 'MongoError'
Nov  1 00:38:57 srv-rocket-test rocketchat[15817]: }
Nov  1 00:38:58 srv-rocket-test rocketchat[15817]: server.js:204 LDAP ➔ Search.info Idle
bellegarde-c commented 4 years ago

Related to this ?

https://docs.mongodb.com/manual/reference/method/cursor.noCursorTimeout/#cursor.noCursorTimeout

bellegarde-c commented 4 years ago

This has fixed my issue:

db.adminCommand( { setParameter: 1, cursorTimeoutMillis: 3600000 } )

paulopera commented 3 years ago

This has fixed my issue:

db.adminCommand( { setParameter: 1, cursorTimeoutMillis: 3600000 } )

This procedure has fixed my issue too, where LDAP import fails to finish. Deployment Method: Docker Version: 3.17.0 Apps Engine Version: 1.27.1 Node Version: v12.22.1 Database Migration: 228 (August 6, 2021 6:47 AM) MongoDB: 4.0.24 / mmapv1 (oplog Enabled) Operating System: Ubuntu 18.04.5 LTS Number of Running Instances: 1