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

MySQL database migration executed by Metabase fails. #8

Open
Boxingday115 opened this issue Feb 8, 2024 · 1 comment
Open

MySQL database migration executed by Metabase fails. #8

Boxingday115 opened this issue Feb 8, 2024 · 1 comment

Comments

@Boxingday115
Copy link

I cloned the repository, copied the .env file & configured it so that it aligns with my wishes (i.e using MySQL instead of Postgresql), and I set up the DB_NAME, USER, PASSWORD & ROOT_PASSWORD.

  • Adminer and Metabase configurations were left unchanged.
  • DB_TYPE=mysel (commented out postgres)

Using cmd I went into MySQL and added a Metabase user and granted it all privileges (to avoid any issues) and I also checked the version of MySQL running on docker (Metabase's documentation clarified that creating a metabase account was required and that MySQL version 8.0.33 or higher is recommended. My version of MySQL is 8.3.0.

I then ran the required commands in cmd (docker-compose build & docker-compose up) both without any issues and 3/3 containers are running within the composer.

The issue is that I cannot seem to access Metabase (through http://localhost:3000/). The site loads but the set-up wizard does not start, instead it just continuously loads forever.

Specifically, I am running into an issue with the database migration processes executed by Metabase:
Migration failed for changeset migrations/001_update_migrations.yaml::v48.00-033::noahmoss:
Reason: liquibase.exception.DatabaseException: (conn=5) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'agg_recipients as ( [...]

The error seems to suggest that the SQL syntax used in the Metabase migration script is not compatible with my SQL version but I am using MySQL 8.3.0 which is supported. This is perplexing because the logs indicate an operation on MySQL 5.7.44?

The logs also read:
2024-02-08 13:53:43 db-1 | 2024-02-08 12:53:43+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started.

2024-02-08 13:53:44 db-1 | 2024-02-08 12:53:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2024-02-08 13:54:06 metabase-1 | Warning: environ value jdk-11.0.22+7 for key :java-version has been overwritten with 11.0.22

2024-02-08 13:53:44 db-1 | 2024-02-08 12:53:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.44-1.el7 started.

2024-02-08 13:53:44 adminer-1 | [Thu Feb 8 12:53:44 2024] PHP 7.4.33 Development Server (http://[::]:8080) started

2024-02-08 13:53:44 db-1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'

2024-02-08 13:54:09 metabase-1 | 2024-02-08 09:54:09,842 INFO metabase.util :: Maximum memory available to JVM: 958.0 MB

2024-02-08 13:53:45 db-1 | 2024-02-08T12:53:45.618837Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

I have no idea why this is occurring. I am sure that I have not provided enough information to properly understand the error so please if any more information is required let me know what! I am very new to this so I don't know what other information may be of value.

I asked reddit for some advice and someone mentioned that the error indicates that a function called agg_recipients is trying to be called, which only exists in Postgres and not MySQL. Very strange that this function is trying to run since I've indicated that the database type is mysql and not postgres.

@josx
Copy link
Member

josx commented Feb 8, 2024

It seems that mysql 5.7 doesnt work with latest metabase version.

So We need to change docker-compose.yml to match a fix metabase version that support mysql 5.7, or change mysql version to match metabse latest version.

Check here:
https://discourse.metabase.com/t/upgrade-metabase-enterprise-to-v1-48-0/57712

Please if you can make it work please do a PR.

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