Missing mysql database after Devilbox update

Hi,

I decided to update the devilbox and followed the istruction in the documentation here
After the update all mysql databases were missing! I was using mariadb 10.3

I know that after the version 0.15 mysql database are stored in the docker image, luckily I did a manual mysqldump-secure no too time ago, but now I need to understand what is happened.
Is the command docker-compose rm -f basically remove all images and so also my mysql databases?

Did you used docker volumes or not. See docker-compose.yml

Yes I was already using volumes before the update
{HOST_PATH_MYSQL_DATADIR}/{MYSQL_SERVER}:/var/lib/mysql:rw${MOUNT_OPTIONS}

Procedure that change from local dir to docker volumes is resumed at https://github.com/cytopia/devilbox/blob/master/UPDATING.md#update-from-v0xy-to-v1xy

Update:
Lost the database again, I’ve not touched the image…this happened just by regularly rebooting the laptop and restarting the docker image

Looking at the log I get only a warning about the HOST_PATH_MYSQL_DATADIR not set but I think is completely unrelated with the issue.
In the .env I didn’t switched mysql image, is always MYSQL_SERVER=mariadb-10.3

Update:

Worked for another couple of days on my project and turned up also the pgsql image since I had to use a postgres database

At reboot both my mysql and postgres database had been wiped!
At first I thought was something with my installation or my configuration but having also the postgres deleted make me think otherwise.

Can someone speculate why this is happening?
I’m running Devilbox v1.7.0 Is there some sort of bug related volumes permanence?

@Deca Are you Jeff Atwood, owner of https://blog.codinghorror.com/ ?

Nope, but I follow him from time to time and have just a similar looking avatar :slight_smile:

Pinging it again

I’ve still this issue, it’s happening also on postgresql. All databases wiped again.
This happen also every time I turn off the pc.
I really would like to use devilbox as dev environment but obviously due to this critical problem I’m just running it for testing a couple of project.

Every suggestions is appreciated, thanks

I still use the docker environment but the problem remain, I gave a look to docker mysql logs, there is no much but apparently it can’t find any data every time docker is restarted

`https://mariadb.org/get-involved/`

`[INFO] Initializing ...`

`2020-07-01 20:46:22 0 [Note] mysqld (mysqld 10.3.4-MariaDB) starting as process 151 ...`

`[INFO] Setting up root user permissions.`

`[INFO] Shutting down MySQL.`

`[INFO] MySQL successfully installed.`

`[INFO] Starting mysqld Ver 10.3.4-MariaDB for Linux on x86_64 (MariaDB Server)`

`2020-07-01 20:46:25 0 [Note] mysqld (mysqld 10.3.4-MariaDB) starting as process 1 ...`

`[INFO] Setting docker timezone to: UTC`

`[INFO] Docker date set to: Wed Jul 1 20:59:19 UTC 2020`

`[WARN] $MYSQL_GENERAL_LOG is empty. Keeping default: [mysqld] general-log=FALSE`

`[INFO] Setting MySQL: [client] socket=/tmp/mysql/mysqld.sock`

`[INFO] Setting MySQL: [mysql] socket=/tmp/mysql/mysqld.sock`

`[INFO] Setting MySQL: [mysqld] socket=/tmp/mysql/mysqld.sock`

`[INFO] Found existing data directory. MySQL already setup.`

`2020-07-01 20:59:20 0 [Note] mysqld (mysqld 10.3.4-MariaDB) starting as process 1 ...`

`[INFO] Docker date set to: Wed Jul 1 21:02:15 UTC 2020`

**`[INFO] No existing MySQL data directory found. Setting up MySQL for the first time.`**

`Installing MariaDB/MySQL system tables in '/var/lib/mysql/' ...`

`OK`

`2020-07-01 21:02:18 0 [Note] mysqld (mysqld 10.3.4-MariaDB) starting as process 151 ...`

`2020-07-01 21:02:21 0 [Note] mysqld (mysqld 10.3.4-MariaDB) starting as process 1 ...`

@Deca does this happen if you:

  1. Start Devilbox
  2. Add some databases/tables
  3. Stop Devilbox
  4. Reboot your machine
  5. Start Devilbox

Is the data still available after these steps?

No is not available… that’s exacly the behaviour I’m talking about, after the steps you mentioned all databases are missing.
For good measure I’ve tried a couple of times again

@deca I am assuming you’re on the latest git tag of the devilbox.

Did you try a docker-compose rm -f (Note: will loose state of all stopped containers) to ensure you have fresh ones?

Also throw in a docker-compose pull to ensure to have latest images

Sorry for late reply, I had first to finish a couple of projects and didn’t want to risk to break the environment.
I tried as you suggested, running a docker-compose rm -f and then updating to the last image but no luck…still same behaviour.
I did a couple of test: basically I create or and imported a couple of mysql dbs, then close gracefully devilbox services, quit docker and did a reboot.
This delete completely any database I added previously