Closed OrfenCLMS closed 4 years ago
Thanks for reporting this! It's also useful to do docker volumes prune
from time to time
Or the more extreme version: docker prune system --volumes
to also cleanup old versions of images.
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.
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.