WrenSecurity / wrends

Community fork of OpenDJ, an LDAP server originally developed by ForgeRock.
http://wrensecurity.org
Other
36 stars 17 forks source link

Wren:DS in Docker fails to start with existing instance data #80

Closed RoBobik closed 1 year ago

RoBobik commented 1 year ago

Summary

Wren:DS in Docker (release 5.0.0) attempts to initialize every time, even when instance dir is already populated, which results in error on subsequent starts.

Steps To Reproduce ("Repro Steps")

  1. Run Wren:DS with empty volume for instance data: docker run --rm -v wrends-data:/opt/wrends/instance wrensecurity/wrends:5.0.0, wait for it to initialize.
  2. Stop Wren:DS (Ctrl+C)
  3. Run the same command again (re-using the now populated volume)

Alternatively, instead of using volumes, create a container, start it, stop it and start it again.

Expected Result (Behavior You Expected to See)

Wren:DS start with existing instance data which has been created during the first start.

Actual Result (Behavior You Saw)

After following repro steps above, Wren:DS fails to start with the following output:

$ docker run --rm -v wrends-data:/opt/wrends/instance wrensecurity/wrends:5.0.0
First start...
Server Already Configured
setup command-line can only be used with servers that have not yet been
configured. The current server:
- Contains data
- Has already been configured

Screenshots N/A

Environment

Additional Notes

The problem lies in unset variable INSTANCE_DIR here: https://github.com/WrenSecurity/wrends/blob/ecd3969eb786f246948a761157eb72d8279d7496/.docker/docker-entrypoint.sh#L3.

pavelhoral commented 1 year ago

By the way there is a simple workaround for this issue - set INSTANCE_DIR evnironment variable so that the entrypoint knows where the instance directory is.