Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrading MySQL server caused ibdata corrupt #821

Closed
darr1s opened this issue Jun 28, 2021 · 2 comments
Closed

Downgrading MySQL server caused ibdata corrupt #821

darr1s opened this issue Jun 28, 2021 · 2 comments
Labels

Comments

@darr1s
Copy link

darr1s commented Jun 28, 2021

ISSUE TYPE

  • Bug Report

OS / ENVIRONMENT

  1. Host operating system and version: Linux Zephyrus 5.12.13-arch1-2 Create MySQL 5.7 docker #1 SMP PREEMPT Fri, 25 Jun 2021 22:56:51 +0000 x86_64 GNU/Linux
  2. (Windows only) Native Docker or Docker Toolbox: n/a
  3. Docker version: Docker version 20.10.7, build f0df35096d
  4. Docker Compose version: docker-compose version 1.29.2, build unknown
  5. (Linux) Is SELinux enabled?: n/a
  6. What git commit hash are you on?: f6bbdc7

SUMMARY

Downgrading MySQL version seems to corrupt its data / init data?

Probably related:
#382

I also tried to remove mysql-data-vol of 10.2 and 10.5 and let compose re-create it. Does not help.

STEPS TO REPRODUCE

  1. git clone devilbox
  2. git checkout master
  3. Use default 10.5 mysql, create a db or some data
  4. Change to version 10.2 mysql (or other) and restart docker-compose

EXPECTED BEHAVIOUR

It should work as expected, as per document, it should use a new volume with isolated environments.

ACTUAL BEHAVIOUR

image

OTHER INFORMATION

Start command

$ docker-compose up

Outputs

$ ./check-config.sh

# ==============================================================================
# Checking git
# ==============================================================================
[ERR]   git is unclean
?? cfg/php-startup-7.2/DownloadsHeader.js

# ==============================================================================
# Checking .env file
# ==============================================================================
[SUCC]  .env file exists
[SUCC]  .env file is readable
[SUCC]  All variables are present in .env file
[SUCC]  No variables is duplicated in .env file

# ==============================================================================
# Checking .env file values
# ==============================================================================
[SUCC]  All .env file variables have correct values

# ==============================================================================
# Checking required Devilbox core directories exist
# ==============================================================================
[SUCC]  All PHP cfg/ sub directories are present
[SUCC]  All PHP log/ sub directories are present
[SUCC]  All PHP mod/ sub directories are present
[SUCC]  All HTTPD cfg/ sub directories are present
[SUCC]  All HTTPD log/ sub directories are present

# ==============================================================================
# Checking devilbox core directory permissions
# ==============================================================================
[SUCC]  All devilbox directories have correct permissions
[SUCC]  All devilbox directories have correct uid
[SUCC]  All devilbox directories have correct gid

# ==============================================================================
# Checking devilbox core file permissions
# ==============================================================================
[ERR]   File 'autostart/update-composer.sh' should have 0755, 0775 or 0777 permissions. Has: 0644 permissions
[SUCC]  All devilbox files have correct uid
[SUCC]  All devilbox files have correct gid

# ==============================================================================
# Checking projects permissions
# ==============================================================================
[SUCC]  All project dirs have correct permissions
[SUCC]  All project dirs have correct uid
[SUCC]  All project dirs have correct gid

# ==============================================================================
# Checking projects settings
# ==============================================================================
[SUCC]  All projects have valid DNS records
[SUCC]  All projects have valid HTTPD_DOCROOT_DIR

# ==============================================================================
# Checking customizations
# ==============================================================================
[NOTE]  [docker]     Custom docker-compose.override.yml present
[NOTE]  [httpd]      Custom config present in cfg/apache-2.4/
[NOTE]  [php.ini]    Custom config present in cfg/php-ini-7.4/
[NOTE]  [startup]    Custom script present in autostart/

# ==============================================================================
# SUMMARY
# ==============================================================================
[ERR]   Found 2 error(s)
[ERR]   Devilbox might not work properly
[ERR]   Fix the issues before submitting a bug report
[NOTE]  4 custom configurations applied. If you encounter issues, reset them first.
[INFO]  Ensure to run 'docker-compose stop; docker-compose rm -f' on .env changes or custom configs
3.21s user 1.79s system 111% cpu 4.498s total
$ docker-compose logs

https://termbin.com/0xa3

@darr1s darr1s added the bug label Jun 28, 2021
@cytopia
Copy link
Owner

cytopia commented Jun 28, 2021

You need to use docker-compose rm before switching stateful images (e.g.: MySQL).
Otherwise If you don't, then the same volume of the previously loaded MySQL image is attached.

If you use docker-compose rm before starting a different stateful image, then it gets its own volume and hence doesn not screw with data from another version.

This is how docker-compose seemingly works.

@darr1s
Copy link
Author

darr1s commented Jun 28, 2021

@cytopia Can confirm this is working. Thanks a lot.

I suggest to add this into https://devilbox.readthedocs.io/en/latest/getting-started/change-container-versions.html to clarify and prevent same issue again in GitHub.

@darr1s darr1s closed this as completed Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants