[GH-ISSUE #1184] [BUG] Unable to start 0.6.1 with mariadb as db backend. #420

Closed
opened 2026-02-27 08:17:12 +03:00 by kerem · 2 comments
Owner

Originally created by @Pierre-Lannoy on GitHub (Jun 3, 2025).
Original GitHub issue: https://github.com/lldap/lldap/issues/1184

Hello!

Describe the bug
Unable to start 0.6.1 with mariadb as db backend.

To Reproduce
Steps to reproduce the behavior:

  1. Create a docker-compose.yml (see content below)
  2. execute docker compose up -d
  3. try to access to web ui curl http://127.0.0.1:17170 => Couldn't connect to server

Expected behavior
It should work.

Logs
docker compose logs gives:

lldap-1    | > Setup permissions..
lldap-1    | > Starting lldap..
lldap-1    |
lldap-1    | Loading configuration from /data/lldap_config.toml
lldap-1    | WARNING: A key_seed was given, we will ignore the key_file and generate one from the seed! Set key_file to an empty string in the config to silence this message.
lldap-1    | Error: Connection Error: pool timed out while waiting for an open connection
lldap-1    |
lldap-1    | Caused by:
lldap-1    |     0: pool timed out while waiting for an open connection
lldap-1    |     1: pool timed out while waiting for an open connection
lldap-1    | 2025-06-03T16:52:20.947737523+00:00  INFO     set_up_server [ 3.28ms | 100.00% ]
lldap-1    | 2025-06-03T16:52:20.947768982+00:00  INFO     ┕━ i [info]: Starting LLDAP version 0.6.1

Additional context
When switching to sqlite, it's working

docker-compose.yml content:

   ldapdb:
    image: "mariadb:11"
    environment:
      MYSQL_DATABASE: "${DB_DATABASE}"
      MYSQL_USER: "${DB_USERNAME}"
      MYSQL_PASSWORD: "${DB_PASSWORD}"
      MYSQL_RANDOM_ROOT_PASSWORD: "true"
    volumes:
      - "./ldapdb:/var/lib/mysql"
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 5s
      retries: 12
      timeout: 5s
  lldap:
    image: lldap/lldap:stable
    env_file: .env
    ports:
      - "127.0.0.1:3890:3890"
      - "127.0.0.1:17170:17170"
    volumes:
      - "./lldap/data:/data"
    depends_on:
      ldapdb:
        condition: service_healthy
    environment:
      - UID=1000
      - GID=1000
      - TZ=Europe/Paris
      - LLDAP_JWT_SECRET=${LDAP_JWT_SECRET}
      - LLDAP_KEY_SEED=${LDAP_KEY_SEED}
      - LLDAP_LDAP_BASE_DN=${LDAP_LDAP_BASE_DN}
      - LLDAP_LDAP_USER_PASS=${LDAP_LDAP_USER_PASS}
      - LLDAP_DATABASE_URL=mysql://${DB_USERNAME}:${DB_PASSWORD}@127.0.0.1:${DB_PORT}/${DB_DATABASE}
      - LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=true
      - LLDAP_SMTP_OPTIONS__SERVER=${MAIL_HOST}
      - LLDAP_SMTP_OPTIONS__PORT=${MAIL_PORT}
      - LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION=TLS
      - LLDAP_SMTP_OPTIONS__USER=${MAIL_USERNAME}
      - LLDAP_SMTP_OPTIONS__PASSWORD=${MAIL_PASSWORD}
      - LLDAP_SMTP_OPTIONS__FROM=${MAIL_FROM_NAME} <${MAIL_FROM_ADDRESS}>
Originally created by @Pierre-Lannoy on GitHub (Jun 3, 2025). Original GitHub issue: https://github.com/lldap/lldap/issues/1184 Hello! **Describe the bug** Unable to start 0.6.1 with mariadb as db backend. **To Reproduce** Steps to reproduce the behavior: 1. Create a `docker-compose.yml` (see content below) 2. execute `docker compose up -d` 3. try to access to web ui `curl http://127.0.0.1:17170` => Couldn't connect to server **Expected behavior** It should work. **Logs** `docker compose logs` gives: ```console lldap-1 | > Setup permissions.. lldap-1 | > Starting lldap.. lldap-1 | lldap-1 | Loading configuration from /data/lldap_config.toml lldap-1 | WARNING: A key_seed was given, we will ignore the key_file and generate one from the seed! Set key_file to an empty string in the config to silence this message. lldap-1 | Error: Connection Error: pool timed out while waiting for an open connection lldap-1 | lldap-1 | Caused by: lldap-1 | 0: pool timed out while waiting for an open connection lldap-1 | 1: pool timed out while waiting for an open connection lldap-1 | 2025-06-03T16:52:20.947737523+00:00 INFO set_up_server [ 3.28ms | 100.00% ] lldap-1 | 2025-06-03T16:52:20.947768982+00:00 INFO ┕━ i [info]: Starting LLDAP version 0.6.1 ``` **Additional context** When switching to sqlite, it's working `docker-compose.yml` content: ```yml ldapdb: image: "mariadb:11" environment: MYSQL_DATABASE: "${DB_DATABASE}" MYSQL_USER: "${DB_USERNAME}" MYSQL_PASSWORD: "${DB_PASSWORD}" MYSQL_RANDOM_ROOT_PASSWORD: "true" volumes: - "./ldapdb:/var/lib/mysql" healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] interval: 5s retries: 12 timeout: 5s lldap: image: lldap/lldap:stable env_file: .env ports: - "127.0.0.1:3890:3890" - "127.0.0.1:17170:17170" volumes: - "./lldap/data:/data" depends_on: ldapdb: condition: service_healthy environment: - UID=1000 - GID=1000 - TZ=Europe/Paris - LLDAP_JWT_SECRET=${LDAP_JWT_SECRET} - LLDAP_KEY_SEED=${LDAP_KEY_SEED} - LLDAP_LDAP_BASE_DN=${LDAP_LDAP_BASE_DN} - LLDAP_LDAP_USER_PASS=${LDAP_LDAP_USER_PASS} - LLDAP_DATABASE_URL=mysql://${DB_USERNAME}:${DB_PASSWORD}@127.0.0.1:${DB_PORT}/${DB_DATABASE} - LLDAP_SMTP_OPTIONS__ENABLE_PASSWORD_RESET=true - LLDAP_SMTP_OPTIONS__SERVER=${MAIL_HOST} - LLDAP_SMTP_OPTIONS__PORT=${MAIL_PORT} - LLDAP_SMTP_OPTIONS__SMTP_ENCRYPTION=TLS - LLDAP_SMTP_OPTIONS__USER=${MAIL_USERNAME} - LLDAP_SMTP_OPTIONS__PASSWORD=${MAIL_PASSWORD} - LLDAP_SMTP_OPTIONS__FROM=${MAIL_FROM_NAME} <${MAIL_FROM_ADDRESS}> ```
kerem 2026-02-27 08:17:12 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@nitnelave commented on GitHub (Jun 3, 2025):

It looks like LLDAP is not able to reach the DB.

Looking at your docker compose, I noticed you used localhost as your DB URL. In docker, that's not going to work, you need the DB container name (lldapdb in your case)

<!-- gh-comment-id:2936656536 --> @nitnelave commented on GitHub (Jun 3, 2025): It looks like LLDAP is not able to reach the DB. Looking at your docker compose, I noticed you used localhost as your DB URL. In docker, that's not going to work, you need the DB container name (lldapdb in your case)
Author
Owner

@Pierre-Lannoy commented on GitHub (Jun 3, 2025):

OMG! You're definitely right!
How could I have missed this despite having checked this file 100 times?

Thank you so much for your help and this great piece of work…

<!-- gh-comment-id:2937130966 --> @Pierre-Lannoy commented on GitHub (Jun 3, 2025): OMG! You're definitely right! How could I have missed this despite having checked this file 100 times? Thank you so much for your help and this great piece of work…
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#420
No description provided.