jbfavre / docker-vertica

Docker images collection for Vertica database
GNU General Public License v3.0
40 stars 36 forks source link

Trying to run the docker image over the same shared folder gives directory already exists error. #13

Closed anonymouskitler closed 5 years ago

anonymouskitler commented 5 years ago

Steps:

  1. Run docker run -p 5433:5433 -d -v ~/vertica:/home/dbadmin/docker jbfavre/vertica:9.2.0-7_ubuntu-16.04. Everything good. Stop the container. Exit
  2. Run again the same command docker run -p 5433:5433 -d -v ~/vertica:/home/dbadmin/docker jbfavre/vertica:9.2.0-7_ubuntu-16.04. The container exits with error_message=Catalog parent directory already exists:. This is because the directory was already created and rerunning is trying to create the same directory again.

Full log:

Starting up
Fixing filesystem permissions
Creating database
Info: no password specified, using none
Database with 1 or 2 nodes cannot be k-safe and it may lose data if it crashes
Distributing changes to cluster.
Error: The following nodes(s) could not be prepared: 
Failed to prepare a host for database participation.
See /opt/vertica/log/adminTools.log for details. Host hints follow.
127.0.0.1 directory already exists: [Details - <ATResult> status=2 host=127.0.0.1 error_type=<class 'vertica.engine.api.errors.ATDBPrepareError'> error_message=Catalog parent directory already exists: (/home/dbadmin/docker/catalog/docker)] 

I think we can do something like this to check if the database already exists

jbfavre commented 5 years ago

Hello @chandureddivari Thanks for your report. I've tried your procedure and can not reproduce the issue.

Could you give more insight on how you stop the container at step 1 ?

anonymouskitler commented 5 years ago

@jbfavre Thanks for the prompt reply. Attaching the set of steps to recreate the issue: image

jbfavre commented 5 years ago

@chandureddivari thanks for the details. Could you please test, from an empty data directory, and add --timeout 20 or 30 option to docker stop ? My guess is that default timeout is too short for Vertica to properly shutdown. I'll try to improve that in the future, but using the option could be a suitable workaround for now.

Please let me know

anonymouskitler commented 5 years ago

@jbfavre thanks for the help. Yes it worked, but with -t 60 though! Also it'd be nice if you can pass db password as env variable. Thanks again for the awesome image :)

pgschr commented 3 years ago

@jbfavre I'm testing the Vertica docker container in Azure, and to stop the container I have two options, on the GUI or with a command. In either case I cannot specify a timeout for properly shutdown. How can this scenario be handled?

Thanks

jbfavre commented 3 years ago

@pgschr Thanks for your report. Unfortunatly, I've no idea of any possible workaround since I don't use Azure.