Docker-openldap: New container failing to initiliase ldap

Created on 5 Sep 2020  路  4Comments  路  Source: osixia/docker-openldap

I am having issues trying to just start a container off of this image.
I've used the following docker-compose file section:

version: "2" services: ldap-server: build: context: $LDAPServerBuildDir args: LDAP_OPENLDAP_GID: $GroupID LDAP_OPENLDAP_UID: $UserID container_name: ldap-server command: --loglevel debug environment: - LDAP_OPENLDAP_UID=$UserID - LDAP_OPENLDAP_GID=$GroupID - LDAP_ORGANISATION=Temp - LDAP_DOMAIN=temp.local - LDAP_ADMIN_PASSWORD=temp volumes: - $AppsDir/swag/keys:/container/service/slapd/assets/certs - $AppsDir/ldap-server/db:/var/lib/ldap - $AppsDir/ldap-server/config:/etc/ldap/slapd.d ports: - 3306:3306 - 636:636 - 389:389 restart: unless-stopped networks: - media

On another ticket (Issue #467) I mentioned that on the first run it built correctly and then overrode my uid and gid. Ignoring this I just made the bound folders on a hard drive in the volume section 777 access for now as I thought it was maybe a folder access issue.
However it still stalls at the "Init new ldap server..." stage:

`
openldap user and group adjustments

get current openldap uid/gid info inside container

openldap GID/UID

User uid: 911
User gid: 911

uid/gid changed: false

updating file uid/gid ownership
Database and config directory are empty...
Init new ldap server...
`

Most helpful comment

The problem for me was caused by additional double-quotes in environment variables. Maybe you could add a check in startup.sh whether an environment variable contains double quotes instead of running an infinite loop with dpkg-reconfigure.

This compose file did not work:

version: '2'

services:
  image: osixia/openldap:1.4.0
  environment:
    - LDAP_DOMAIN="my.domain.com"
    - LDAP_ORGANISATION="Example Organisation"

But this one works:

version: '2'

services:
  image: osixia/openldap:1.4.0
  environment:
    - LDAP_DOMAIN=my.domain.com
    - LDAP_ORGANISATION=Example Organisation

All 4 comments

Same problem here. I tried 1.4.0, 1.3.0 and 1.2.5 without success. If you run the container with --loglevel trace you can see that everything run fine until a call to dpkg-reconfigure -f noninteractive slapd. Running top inside of the container show two main processes dpkg-reconfigure and slapd.config which both constantly produce a quite high amount of CPU load. Normally such calls should not take more than 20 minutes on a system which is installed on an SSD.

Maybe there is a loop which retries the same activity again and again with a short timeout (high CPU usage) but fails every time.

The problem for me was caused by additional double-quotes in environment variables. Maybe you could add a check in startup.sh whether an environment variable contains double quotes instead of running an infinite loop with dpkg-reconfigure.

This compose file did not work:

version: '2'

services:
  image: osixia/openldap:1.4.0
  environment:
    - LDAP_DOMAIN="my.domain.com"
    - LDAP_ORGANISATION="Example Organisation"

But this one works:

version: '2'

services:
  image: osixia/openldap:1.4.0
  environment:
    - LDAP_DOMAIN=my.domain.com
    - LDAP_ORGANISATION=Example Organisation

Hi there, thanks for the input.
Yeah I saw the some of the others issues when using string markers.
Mine don't have string markers in them.
It does seem to have started, maybe just very very slow to initialise?

Thanks @daniel-lerch - got crazy about this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mzayikin picture mzayikin  路  3Comments

doctormacky picture doctormacky  路  6Comments

Shriyanshmit picture Shriyanshmit  路  5Comments

adambom picture adambom  路  6Comments

tobikris picture tobikris  路  4Comments