Open EthicsGradient opened 3 years ago
Hi,
your LDIF seems to be invalid. There is a missing newline between your dn: cn=mainuser,ou=People,dc=test,dc=org,dc=uk
and the dn: cn=usergeneric,ou=People,dc=test,dc=org,dc=uk
entries.
Also I think there has to be a space between the mail:mainuser@gmail.com
attribute and value of your cn=mainuser
.
If that doesn't solve it also try the --log-level debug
option, see here.
Same here.
I've bootup a clean openldap with this container and added some Organization Units, Posix Group and Users using phpldapadmin.
Saved two dumps of this database. One with a "slapcat dump" and other with a "ldapsearch dump".
Both failed to be added in a new trying of use a clean container that should restore one of these dumps.
After that I tried remove my top object class and apparently I have success to import it but a new fail where custom dir is busy, and in a new trying anhoter mesage that the file tls-enable.ldif is not readable.
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Add image bootstrap ldif...
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Add custom bootstrap ldif...
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Add TLS config...
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Disable replication config...
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Stop OpenLDAP...
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Configure ldap client TLS configuration...
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Remove config files...
openldap_1 | rm: cannot remove '/container/service/slapd/assets/config/bootstrap/ldif/custom': Device or resource busy
openldap_1 | *** ERROR | 2021-06-12 19:08:14 | /container/run/startup/slapd failed with status 1
openldap_1 |
openldap_1 | *** INFO | 2021-06-12 19:08:14 | Killing all processes...
openldap_openldap_1 exited with code 1
In another trying just running "docker-compose up" again, the message changed to tls-enable.ldif not readable:
openldap_1 | *** INFO | 2021-06-12 19:08:46 | Start OpenLDAP...
openldap_1 | *** INFO | 2021-06-12 19:08:46 | Waiting for OpenLDAP to start...
openldap_1 | *** INFO | 2021-06-12 19:08:46 | Add TLS config...
openldap_1 | sed: can't read /container/service/slapd/assets/config/tls/tls-enable.ldif: No such file or directory
openldap_1 | *** ERROR | 2021-06-12 19:08:46 | /container/run/startup/slapd failed with status 2
openldap_1 |
openldap_1 | *** INFO | 2021-06-12 19:08:46 | Killing all processes...
openldap_openldap_1 exited with code 1
Had various errors trying to use directory or file volumes for the bootstrap ldif, including the "device or resource busy" for copy or rename. Got past this issue by mounting the bootstrap directory to "/tmp/ldif" and using LDAP_SEED_INTERNAL_LDIF_PATH. For example:
version '2'
services:
openldap:
...
environment:
LDAP_SEED_INTERNAL_LDIF_PATH: "/tmp/ldif"
...
volumes:
- ./data/ldif:/tmp/ldif
Edit: On subsequent runs, this still occasionally fails with a:
Copy from internal path /tmp/ldif to /container/run/service/slapd/assets/config/bootstrap/ldif/custom cp: cannot create directory '/container/run/service/slapd/assets/config/bootstrap/ldif/custom': No such file or directory
@jrk-irt Did you try the --copy-service
command?
Seed ldap database with ldif:
Since startup script modifies
ldif
files, you must add--copy-service
argument to entrypoint if you don't want to overwrite them.
Fix docker mounted file problems:
You may have some problems with mounted files on some systems. The startup script try to make some file adjustment and fix files owner and permissions, this can result in multiple errors.
This would also apply to a read-only mounts. So try to use e.g.:
version: '2'
services:
openldap:
image: osixia/openldap
command: --copy-service
volumes:
- ./data/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom:ro
@jrk-irt Did you try the
--copy-service
command?
Yes, I'm also running with that option and it does help. However, subsequent startups fail.
However, it does work if a docker-compose down
is issued before bringing it back up, so I looked in the container after initial startup. The /container/run/service/slapd/assets/config directory no longer exists. The next time the system starts using the same container, and attempts to copy the bootstrap file to /container/run/service/slapd/assets/config/bootstrap/ldif/custom, it fails.
I'm still facing the same issue there is any fix for this?
Hi, Trying to create a container fails with this error; The ldif file works if you copy it to root and then run ldapadd manually after logging in.
The build file is
The ldif file is;