# User getting deactivated/login not possible

**URL:** <https://forums.rocket.chat/t/user-getting-deactivated-login-not-possible/18807>\
**Category:** Community Support\
**Tags:** snap\
**Created:** [December 8, 2023, 7:49am UTC](https://forums.rocket.chat/t/user-getting-deactivated-login-not-possible/18807 "2023-12-08T07:49:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peer-Joachim.Koch](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Peer-Joachim.Koch](https://forums.rocket.chat/u/Peer-Joachim.Koch)\
**Post date:** [December 8, 2023, 7:49am UTC](https://forums.rocket.chat/t/user-getting-deactivated-login-not-possible/18807/1 "2023-12-08T07:49:07Z")

</div>

### Description

Yesterday our rocket.chat server is blocking users. We are using LDAP. Whenever a user  
is trying to log in the account is getting deactivated.  
When we try to go to Administration → USER we see only an error message:  
“PlanExecutor error during aggregation :: caused by :: can’t convert from BSON type array to String”  
and a plain screen.  
In the log we see the following message:  
Aggregate command executor error",“attr”:{“error”:{“code”:16007,“codeName”:“Location16007”,“errmsg”:“can’t convert from BSON type array to String”},“stats”:{},“cmd”:{“aggregate”:“users”,“pipeline”:[{“$match”:{“$or”:[{“emails.address”:{“$regex”:“”,“$options”:“i”}},{“username”:{“$regex”:“”,“$options”:“i”}},{“name”:{“$regex”:“”,“$options”:“i”}}]}\>

What does it mean ?  
How can we fix it ?  
What caused this behavior ?

Thanks a lot!

### Server Setup Information

- Version of Rocket.Chat Server: 6.5
- Operating System: ubuntu 22.04
- Deployment Method: snap
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: 14.21.2
- MongoDB Version: 5.0.15
- Proxy: apache
- Firewalls involved:

### Any additional Information

---

<div class="post-metadata">

**Author:** ![Peer-Joachim.Koch](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Peer-Joachim.Koch](https://forums.rocket.chat/u/Peer-Joachim.Koch)\
**Post date:** [January 16, 2024, 3:46pm UTC](https://forums.rocket.chat/t/user-getting-deactivated-login-not-possible/18807/2 "2024-01-16T15:46:58Z")

</div>

OK,  
I can add some information now:

The user is getting deactivated, because the ldap data are synced every time  
the user is trying to log on.

The LDAP mapping is going wrong and therefore the account is getting disabled and the login fails.

Disabling the LDAP sync shows the effect, taht the account _will not_ be deactivated.

However the login process fails … ;(

,“msg”:“Executing callback with id mapLDAPCustomFields for hook mapLDAPUserData”} {“level”:20,“time”:“2024-01-16T15:29:27.106Z”,“pid”:1638,“hostname”:“chat”,“name”:“LDAP”,“section”:“Mapping”,“msg”:“User account was manually disabled by an admin (attribute loginDisabled)”}

A little bit later:  
{“level”:20,“time”:“2024-01-16T15:29:27.120Z”,“pid”:1638,“hostname”:“chat”,“name”:“Callbacks”,“msg”:“Executing callback with id validateLdapLoginFallback for hook beforeValidateLogin”} Exception while invoking method login errorClass [Error]: Unrecognized options for login request [400] at packages/accounts-base/accounts\_server.js:606:14 at /snap/rocketchat-server/1599/programs/server/npm/node\_modules/meteor/promise/node\_modules/meteor-promise/fiber\_pool.js:43:40 =\> awaited here: at Function.Promise.await (/snap/rocketchat-server/1599/programs/server/npm/node\_modules/meteor/promise/node\_modules/meteor-promise/promise\_server.js:56:12) at packages/accounts-base/accounts\_server.js:653:7 at /snap/rocketchat-server/1599/programs/server/npm/node\_modules/meteor/promise/node\_modules/meteor-promise/fiber\_pool.js:43:40 =\> awaited here: at Function.Promise.await (/snap/rocketchat-server/1599/programs/server/npm/node\_modules/meteor/promise/node\_modules/meteor-promise/promise\_server.js:56:12) at packages/meteor.js:367:22 at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1389:31) at packages/ddp-server/livedata\_server.js:1818:36 at new Promise () at Server.applyAsync (packages/ddp-server/livedata\_server.js:1817:12) at Server.callAsync (packages/ddp-server/livedata\_server.js:1743:17) at app/api/server/v1/misc.ts:617:33 at /snap/rocketchat-server/1599/programs/server/npm/node\_modules/meteor/promise/node\_modules/meteor-promise/fiber\_pool.js:43:40 =\> awaited here: at Function.Promise.await (/snap/rocketchat-server/1599/programs/server/npm/node\_modules/meteor/promise/node\_modules/meteor-promise/promise\_server.js:56:12) at app/api/server/v1/misc.ts:617:17 at /snap/rocketchat-server/1599/programs/server/npm/node\_modules/meteor/promise/node\_modules/meteor-promise/fiber\_pool.js:43:40 { isClientSafe: true, error: 400, reason: ‘Unrecognized options for login request’, details: undefined, errorType: ‘Meteor.Error’ } {“level”:35,“time”:“2024-01-16T15:29:27.126Z”,“pid”:1638,“hostname”:“chat”,“name”:“API”,“method”:“POST”,“url”:“/api/v1/method.callAnon/login”,“userAgent”:“Mozilla/5.0 (X11; Linux x86\_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36”,“length”:“174”,“host”:“XXXX”,“referer”:“[https://chat.hki-jena.de/home",“remoteIP”:“XXXX”,“status”:200,"responseTime](https://chat.hki-jena.de/home%22,%22remoteIP%22:%22XXXX%22,%22status%22:200,%22responseTime)”:171}
