typhon-project / typhondl

http://www.typhon-project.org
Eclipse Public License 2.0
1 stars 0 forks source link

[BUG] Relational databases do not always create credentials for root user #44

Closed OrfenCLMS closed 4 years ago

OrfenCLMS commented 4 years ago

Describe the bug

Sometimes when the docker-compose containers are created, user/password credentials(based on the MYSQL_ROOT_PASSWORD env variable) are not created for relational databases. This results in the TyphonQL server not being able to initialize those databases when performing the /resetdatabases operation in the API. This probably occurs because the containers are reusing old volumes, in which case no entrypoint actions (which are the ones that create the credentials) are performed.

Expected behavior

The root user in any relational database should always be created based on the environmental variable in docker-compose.

Solution

The solution to this problem is running

docker-compose down -v

which will remove containers AND anonymous volumes that are created. After that, doing

docker-compose up --build

will rebuild the containers/volumes from scratch, and the credentials should be created normally.

MarieSaphira commented 4 years ago

Thanks for reporting this! It's also useful to do docker volumes prune from time to time

DavyLandman commented 4 years ago

Or the more extreme version: docker prune system --volumes to also cleanup old versions of images.

OrfenCLMS commented 4 years ago

Just be careful of containers that are not running but containing data that you don't want to lose, as pruning volumes will absolutely make you lose that data.