Skip to content

slapd fails to start - daemon: listen(ldap://ldap, 5) failed errno=98 (Address already in use)Β #198

Open
@macgregor

Description

@macgregor

Been working on this all afternoon, Im hoping I have something obviously misconfigured. I got it to work once and then on a restart I get this error when slapd tries to start and I havent been able to make it go away except by manual intervention.

version: '2.0'
services:
    ldap:
        image: osixia/openldap:1.2.0
        container_name: openldap
        restart: always
        command: --loglevel trace --copy-service
        volumes:
          - ./ldap/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom
          - ./ldap/slapd/database:/var/lib/ldap
          - ./ldap/slapd/config:/etc/ldap/slapd.d
        environment:
          LDAP_ADMIN_PASSWORD: "admin"
          LDAP_ORGANISATION: "Redhat Inc."
          LDAP_DOMAIN: "redhat.com"
          LDAP_TLS: "false"
          LDAP_TLS_ENFORCE: "false"
          LDAP_TLS_VERIFY_CLIENT: "never"
          LDAP_REMOVE_CONFIG_AFTER_SETUP: "false"
          LDAP_BACKEND: "hdb"
        hostname: ldap.redhat.com
        ports:
          -  "127.0.0.1:389:389"
          -  "127.0.0.1:636:636"

openldap_slapd_failed_to_start_1_debug.txt
openldap_slapd_failed_to_start_2_trace.txt
openldap_slapd_failed_to_start_3_trace_manual_start.txt
openldap_slapd_failed_to_start_4_docker_info.txt

Things I've tried:

  • rm -rf ./ldap/slapd/database ./ldap/slapd/config, no effect
  • try osixia/openldap:1.1.11, no effect
  • change LDAP_BACKEND to "hdb", no effect
  • remove "127.0.0.1" from port ranges, no effect
  • clean up a bunch of docker images and containers, no effect
  • attach to the running docker container and manually run the slapd command after it fails:
>docker exec -it 3308e177dd1b bash
slapd -h 'ldap://ldap  ldap://localhost ldapi:///' -u openldap -g openldap -d 256
5aa1a38e daemon: bind(9) failed errno=99 (Cannot assign requested address)
5aa1a38f slapd starting
5aa1a38f daemon: listen(ldap://ldap, 5) failed errno=98 (Address already in use)
5aa1a38f slapd stopped.

so it fails in the interactive shell but over in the running docker-compose shell I see openldap_slapd_failed_to_start_3_trace_manual_start.txt (look after all the sleeps while I was connecint bash and executing the slapd command). So it appears to work, though i haven't spent much time verifying functionality. Its complaining about my ldif syntax for some reason.

What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions