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

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“

{“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/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

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?

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.

And the .env.example says:

Change these

REG_TOKEN=
DOMAIN=localhost
ROOT_URL=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.)

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?

1 Like