# Ldap Test connection is working, but "User not found" issue

**URL:** <https://forums.rocket.chat/t/ldap-test-connection-is-working-but-user-not-found-issue/22493>\
**Category:** Community Support\
**Tags:** rocketchat-apps, docker\
**Created:** [August 27, 2025, 12:00pm UTC](https://forums.rocket.chat/t/ldap-test-connection-is-working-but-user-not-found-issue/22493 "2025-08-27T12:00:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshay.jain](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@akshay.jain](https://forums.rocket.chat/u/akshay.jain)\
**Post date:** [August 27, 2025, 12:00pm UTC](https://forums.rocket.chat/t/ldap-test-connection-is-working-but-user-not-found-issue/22493/1 "2025-08-27T12:00:47Z")

</div>

### Description

I have run the containers :

1. rocketchat-compose-rocketchat-1
2. rocketchat-compose-nats-1
3. rocketchat-compose-mongodb-1
4. rocketchat-compose-mongodb-exporter-1
5. rocketchat-compose-nats-exporter-1

So, containers are running, and my container error logs are below. I have configured the LDAP (on-prem active directory).

When I perform an LDAP search from the rocketchat-compose-rocketchat-1 container, it works, but from Rocket Chat, it does not. Even though the test connection is working fine, when I do a test search is not working, and also when I try to log in, it also gives the same error “User not found“

 ![connection](https://us1.discourse-cdn.com/flex021/uploads/rocketchat/original/2X/e/e4b962b188a13fc5ef0f65f537084c428f47b780.png)

{“level”:50,“time”:“2025-08-27T11:40:48.182Z”,“pid”:1,“hostname”:“6a16f1cbcc0f”,“name”:“LDAP”,“err”:{“type”:“Error”,“message”:“User not found”,“stack”:“Error: User not found\n at Function.testSearch (server/lib/ldap/Manager.ts:127:11)\n at processTicksAndRejections (node:internal/process/task\_queues:105:5)\n at Object.post (app/api/server/v1/ldap.ts:55:4)\n at Object.\_internalRouteActionHandler (app/api/server/ApiClass.ts:908:18)\n at /app/bundle/programs/server/npm/node\_modules/@rocket.chatrocket.chat/http-router/src/Router.ts:229:21\n at dispatch (/app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/compose.js:52:17)\n at dispatch (/app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/compose.js:52:17)\n at app/api/server/middlewares/tracer.ts:20:4\n at dispatch (/app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/compose.js:52:17)\n at app/api/server/middlewares/metrics.ts:22:3\n at dispatch (/app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/compose.js:52:17)\n at app/api/server/middlewares/logger.ts:30:3\n at dispatch (/app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/compose.js:52:17)\n at app/api/server/middlewares/cors.ts:18:4\n at dispatch (/app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/compose.js:52:17)\n at dispatch (/app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/compose.js:52:17)\n at /app/bundle/programs/server/npm/node\_modules/hono/dist/cjs/hono-base.js:217:25\n at /app/bundle/programs/server/npm/no@rocket.chate\_modules/[@rocket.chat](https://forums.rocket.chat/groups/rocket.chat)/http-router/src/middlewares/honoAdapterForExpress.ts:15:18”},“msg”:“User not found”}

### Server Setup Information

- Version of Rocket.Chat Server: 7.9.3
- Operating System: Ubuntu 20.04.6 LTS
- Deployment Method: Docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 22.16.0 - x64
- MongoDB Version: 6.0.13
- Proxy: No
- Firewalls involved: No

### Any additional Information

Compose file

services:  
rocketchat:  
image: ${IMAGE:-registry.rocket.chat/rocketchat/rocket.chat}:${RELEASE:-latest}  
restart: always  
labels:  
prometheus. io/ scrape: “true”  
prometheus. io/ port: ${METRICS\_PORT:-9458}  
environment:  
#ROOT\_URL: ${ROOT\_URL:-http:// localhost}  
PORT: ${PORT:-3000}  
DEPLOY\_METHOD: docker  
DEPLOY\_PLATFORM: compose  
REG\_TOKEN: ${REG\_TOKEN:-}  
LICENSE\_DEBUG: true  
OVERWRITE\_SETTING\_Prometheus\_Enabled: true  
OVERWRITE\_SETTING\_Prometheus\_Port: “${METRICS\_PORT:-9458}”  
MONGO\_URL: ${MONGO\_URL:-mongodb://mongodb:27017/rocketchat?replicaSet=rs0}  
TRANSPORTER: “${NATS\_URL-monolith+nats://nats:4222}”  
INSTANCE\_IP: “${INSTANCE\_IP:-}”  
LDAP\_DEBUG: true  
DEBUG: ldap\*  
ROCKETCHAT\_DEBUG: true  
OVERWRITE\_SETTING\_Logs\_Level: 2  
ROOT\_URL: ‘http:// 192.168.100.45:3000’  
expose:

- ${PORT:-3000}
- ${METRICS\_PORT:-9458}  
ports:
- “${BIND\_IP:-0.0.0.0}:${HOST\_PORT:-3000}:${PORT:-3000}”
- “${BIND\_IP:-0.0.0.0}:${METRICS\_PORT:-9458}:${METRICS\_PORT:-9458}”

due to limitation I have added whitespaces at

1. prometheus. io/ scrape
2. prometheus. io/ port:
3. http:// 192.168.100.45:3000
4. http:// localhost

Thanks

Akshay

---

<div class="post-metadata">

**Author:** ![reetp](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/reetp/32/5546_2.png) [@reetp](https://forums.rocket.chat/u/reetp)\
**Post date:** [August 27, 2025, 3:02pm UTC](https://forums.rocket.chat/t/ldap-test-connection-is-working-but-user-not-found-issue/22493/2 "2025-08-27T15:02:32Z")

</div>

> [@akshay.jain](#):
>
> Operating System: Ubuntu 20.04.6 LTS

Are you on Ubuntu Pro support? If you not you should upgrade as it is EOL May 2025.

What Licence type are you you running and approximate number of users?

> [@akshay.jain](#):
>
> ROOT\_URL: ‘http:// 192.168.100.45:3000’

You should not be doing this. As per the docs you should be using https + a reverse proxy and domain name.

The docs say:

> Edit `.env` to fit your deployment. Recommended changes - we recommend to keep other values from the example for reference.

> **[GitHub - RocketChat/rocketchat-compose: Docker / Podman Compose](https://github.com/RocketChat/rocketchat-compose)**
>
> Docker / Podman Compose

And the .env.example says:

> Change these
> 
> REG\_TOKEN=  
> DOMAIN=localhost  
> ROOT\_URL=[http://localhost](http://localhost)  
> RELEASE=latest

(I suggest you NEVER EVER use ‘latest’ unless you like nasty surprises. Use a fixed version and upgrade when you are ready.)

> [@akshay.jain](#):
>
> When I perform an LDAP search from the rocketchat-compose-rocketchat-1 container, it works, but from Rocket Chat, it does not.

OK - so how do you demo it on the CLI?

Why would it work there and the not in the admin panel?

What does your LDAP server tell you when it fails?

What settings are you using under LDAP/Authentication?
