Skip to content

db docker logs - error #1768

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

Open
4 tasks
scorpiock opened this issue Jan 24, 2023 · 1 comment
Open
4 tasks

db docker logs - error #1768

scorpiock opened this issue Jan 24, 2023 · 1 comment

Comments

@scorpiock
Copy link

Hello, I upgraded to the latest version, and db docker logs have full of errors like the one below. It is erroring continuously.

2023-01-24 13:47:09 26303 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).
2023-01-24 13:47:09 26303 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').
2023-01-24 13:47:09 26303 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).
2023-01-24 13:47:09 26303 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').
2023-01-24 13:47:09 26303 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255).

System Information

  • ee cli info

+-------------------+----------------------------------------------------------------------------------+ | OS | Linux 5.4.0-1093-gcp #102~18.04.1-Ubuntu SMP Sat Oct 29 06:35:49 UTC 2022 x86_64 | | Shell | /bin/bash | | PHP binary | /usr/bin/php7.2 | | PHP version | 7.2.24-0ubuntu0.18.04.15 | | php.ini used | /etc/php/7.2/cli/php.ini | | EE root dir | phar://ee.phar | | EE vendor dir | phar://ee.phar/vendor | | EE phar path | /var/log | | EE packages dir | | | EE global config | /opt/easyengine/config/config.yml | | EE project config | | | EE version | 4.6.5 | +-------------------+----------------------------------------------------------------------------------+

  • lsb_release -a
    No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.2 LTS Release: 18.04 Codename: bionic
  • docker version
    `Client:
    Version: 18.09.3
    API version: 1.39
    Go version: go1.10.8
    Git commit: 774a1f4
    Built: Thu Feb 28 06:53:11 2019
    OS/Arch: linux/amd64
    Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.3
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 774a1f4
Built: Thu Feb 28 05:59:55 2019
OS/Arch: linux/amd64
Experimental: false
`

  • docker-compose version
    docker-py version: 3.6.0 CPython version: 3.6.7 OpenSSL version: OpenSSL 1.1.0f 25 May 2017
@yashhhYB
Copy link

Verify the MySQL/MariaDB Version
Check the version of your database container to confirm the update caused the mismatch:

bash
Copy
Edit
docker exec -it mysql --version
Replace with the name of your database container (e.g., services_global-db_1).

  1. Run mysql_upgrade to Fix System Tables
    The mysql_upgrade command updates the system tables to match the new version. Run the following inside the database container:

bash
Copy
Edit
docker exec -it mysql_upgrade -u root -p
Enter the root password when prompted.
This command ensures that system tables like mysql.column_stats are updated to the correct schema for the current version.
3. Restart the Database Service
Restart the database service to apply the changes and confirm the issue is resolved:

bash
Copy
Edit
docker restart
Check the logs for errors again:

bash
Copy
Edit
docker logs
4. Check and Repair System Tables (Optional)
If the issue persists after running mysql_upgrade, you may need to repair the affected tables. Execute the following commands:

bash
Copy
Edit
docker exec -it mysql -u root -p
In the MySQL shell:

sql
Copy
Edit
USE mysql;
REPAIR TABLE column_stats;
EXIT;
5. Ensure the Database Container Uses the Correct Version
Make sure your database container runs a compatible version of MySQL or MariaDB. Mismatched versions can cause schema issues.

Check the docker-compose.yml file for the database version:

yaml
Copy
Edit
services:
db:
image: mysql:5.7 # Ensure this matches your desired version
Update and restart if needed:

bash
Copy
Edit
docker-compose down
docker-compose up -d
6. Backup and Downgrade if Necessary
If you cannot resolve the issue, consider reverting to the previous database version. Ensure you have a backup before downgrading.

To back up:

bash
Copy
Edit
docker exec mysqldump -u root -p --all-databases > backup.sql
Revert the version in your docker-compose.yml and recreate the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants