Issues updating to 0.37.6 (from 0.34.1)

Hi @flamber,

we’re having trouble upgrading to 0.37.6 coming from 0.34.1 … below is the log output.

I had to wait until the google sheet export is fixed (200 response vs 202 response), therefore skipped a few updates.

Do you have any hint on how we can get it running ?

Thank you & Best Regards
Fabian

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2021-01-19 10:07:02,384 INFO metabase.util :: Maximum memory available to JVM: 492.0 MB
2021-01-19 10:07:17,192 INFO util.encryption :: Saved credentials encryption is ENABLED for this Metabase instance. 🔐 
 For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2021-01-19 10:07:25,448 INFO metabase.core :: 
Metabase v0.37.6 (344e5e0 release-x.37.x) 

Copyright © 2021 Metabase, Inc. 

Metabase Enterprise Edition extensions are NOT PRESENT.
2021-01-19 10:07:25,461 WARN metabase.core :: WARNING: You have enabled namespace tracing, which could log sensitive information like db passwords.
2021-01-19 10:07:25,461 INFO metabase.core :: Starting Metabase in STANDALONE mode
2021-01-19 10:07:25,512 INFO metabase.server :: Launching Embedded Jetty Webserver with config: 
 {:port 3010}

2021-01-19 10:07:25,565 INFO metabase.core :: Starting Metabase version v0.37.6 (344e5e0 release-x.37.x) ...
2021-01-19 10:07:25,639 INFO metabase.core :: System info:
 {"file.encoding" "UTF-8",
 "java.runtime.name" "OpenJDK Runtime Environment",
 "java.runtime.version" "11.0.9.1+1-Ubuntu-0ubuntu1.18.04",
 "java.vendor" "Ubuntu",
 "java.vendor.url" "https://ubuntu.com/",
 "java.version" "11.0.9.1",
 "java.vm.name" "OpenJDK 64-Bit Server VM",
 "java.vm.version" "11.0.9.1+1-Ubuntu-0ubuntu1.18.04",
 "os.name" "Linux",
 "os.version" "4.15.0-1065-aws",
 "user.language" "en",
 "user.timezone" "Etc/UTC"}

2021-01-19 10:07:25,641 INFO metabase.plugins :: Loading plugins in /home/ubuntu/metabase/plugins...
2021-01-19 10:07:26,865 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :hive-like...
2021-01-19 10:07:27,228 INFO driver.impl :: Registered abstract driver :sql  🚚
Load driver :sql took 155.1 ms
2021-01-19 10:07:27,257 INFO driver.impl :: Registered abstract driver :sql-jdbc (parents: [:sql]) 🚚
Load driver :sql-jdbc took 390.1 ms
2021-01-19 10:07:27,262 INFO driver.impl :: Registered abstract driver :hive-like (parents: [:sql-jdbc]) 🚚
2021-01-19 10:07:27,264 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :sparksql...
2021-01-19 10:07:27,265 INFO driver.impl :: Registered driver :sparksql (parents: [:hive-like]) 🚚
2021-01-19 10:07:27,278 INFO plugins.dependencies :: Plugin 'Metabase BigQuery Driver' depends on plugin 'Metabase Google Drivers Shared Dependencies'
2021-01-19 10:07:27,280 INFO plugins.dependencies :: Metabase BigQuery Driver dependency {:plugin Metabase Google Drivers Shared Dependencies} satisfied? false
2021-01-19 10:07:27,281 INFO plugins.dependencies :: Plugins with unsatisfied deps: ["Metabase BigQuery Driver"]
2021-01-19 10:07:27,290 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :google...
2021-01-19 10:07:27,294 INFO driver.impl :: Registered abstract driver :google  🚚
2021-01-19 10:07:27,296 INFO plugins.dependencies :: Metabase BigQuery Driver dependency {:plugin Metabase Google Drivers Shared Dependencies} satisfied? true
2021-01-19 10:07:27,298 DEBUG plugins.initialize :: Dependencies satisfied; these plugins will now be loaded: ["Metabase BigQuery Driver"]
2021-01-19 10:07:27,301 WARN plugins.lazy-loaded-driver :: Warning: plugin manifest for :bigquery does not include connection properties
2021-01-19 10:07:27,302 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :bigquery...
2021-01-19 10:07:27,303 INFO driver.impl :: Registered driver :bigquery (parents: [:sql :google]) 🚚
2021-01-19 10:07:27,320 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :redshift...
2021-01-19 10:07:27,335 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc]) 🚚
Load driver :postgres took 29.3 ms
2021-01-19 10:07:27,352 INFO driver.impl :: Registered driver :redshift (parents: [:postgres]) 🚚
2021-01-19 10:07:27,401 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :snowflake...
2021-01-19 10:07:27,402 INFO driver.impl :: Registered driver :snowflake (parents: [:sql-jdbc]) 🚚
2021-01-19 10:07:27,423 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :mongo...
2021-01-19 10:07:27,427 INFO driver.impl :: Registered driver :mongo  🚚
2021-01-19 10:07:27,432 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :sqlite...
2021-01-19 10:07:27,434 INFO driver.impl :: Registered driver :sqlite (parents: [:sql-jdbc]) 🚚
2021-01-19 10:07:27,445 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :druid...
2021-01-19 10:07:27,448 INFO driver.impl :: Registered driver :druid  🚚
2021-01-19 10:07:27,461 INFO plugins.dependencies :: Metabase cannot initialize plugin Metabase Oracle Driver due to required dependencies. Metabase requires the Oracle JDBC driver in order to connect to Oracle databases, but we can't ship it as part of Metabase due to licensing restrictions. See https://metabase.com/docs/latest/administration-guide/databases/oracle.html for more details.

2021-01-19 10:07:27,466 INFO plugins.dependencies :: Metabase Oracle Driver dependency {:class oracle.jdbc.OracleDriver} satisfied? false
2021-01-19 10:07:27,466 INFO plugins.dependencies :: Plugins with unsatisfied deps: ["Metabase Oracle Driver"]
2021-01-19 10:07:27,471 INFO plugins.dependencies :: Metabase cannot initialize plugin Metabase Vertica Driver due to required dependencies. Metabase requires the Vertica JDBC driver in order to connect to Vertica databases, but we can't ship it as part of Metabase due to licensing restrictions. See https://metabase.com/docs/latest/administration-guide/databases/vertica.html for more details.

2021-01-19 10:07:27,472 INFO plugins.dependencies :: Metabase Vertica Driver dependency {:class com.vertica.jdbc.Driver} satisfied? false
2021-01-19 10:07:27,473 INFO plugins.dependencies :: Plugins with unsatisfied deps: ["Metabase Vertica Driver" "Metabase Oracle Driver"]
2021-01-19 10:07:27,477 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :presto...
2021-01-19 10:07:27,479 INFO driver.impl :: Registered driver :presto (parents: [:sql]) 🚚
2021-01-19 10:07:27,485 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :sqlserver...
2021-01-19 10:07:27,486 INFO driver.impl :: Registered driver :sqlserver (parents: [:sql-jdbc]) 🚚
2021-01-19 10:07:27,494 INFO plugins.dependencies :: Plugin 'Metabase Google Analytics Driver' depends on plugin 'Metabase Google Drivers Shared Dependencies'
2021-01-19 10:07:27,495 INFO plugins.dependencies :: Metabase Google Analytics Driver dependency {:plugin Metabase Google Drivers Shared Dependencies} satisfied? true
2021-01-19 10:07:27,496 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :googleanalytics...
2021-01-19 10:07:27,497 INFO driver.impl :: Registered driver :googleanalytics (parents: [:google]) 🚚
2021-01-19 10:07:27,516 INFO driver.impl :: Registered driver :h2 (parents: [:sql-jdbc]) 🚚
2021-01-19 10:07:27,538 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc]) 🚚
2021-01-19 10:07:27,557 INFO metabase.core :: Setting up and migrating Metabase DB. Please sit tight, this may take a minute...
2021-01-19 10:07:27,561 INFO metabase.db :: Verifying mysql Database Connection ...
2021-01-19 10:07:27,565 INFO driver.impl :: Initializing driver :sql...
2021-01-19 10:07:27,566 INFO driver.impl :: Initializing driver :sql-jdbc...
2021-01-19 10:07:27,567 INFO driver.impl :: Initializing driver :mysql...
2021-01-19 10:07:27,700 INFO metabase.db :: Successfully verified MySQL 5.7.26-log application database connection. ✅
2021-01-19 10:07:27,701 INFO metabase.db :: Running Database Migrations...
2021-01-19 10:07:27,712 INFO metabase.db :: Setting up Liquibase...
2021-01-19 10:07:27,742 INFO metabase.db :: Liquibase is ready.
2021-01-19 10:07:27,743 INFO db.liquibase :: Checking if Database has unrun migrations...
2021-01-19 10:07:31,017 WARN changelog.DatabaseChangeLog :: modifyDataType will lose primary key/autoincrement/not null settings for mysql.  Use <sql> and re-specify all configuration if this is the case
2021-01-19 10:07:31,050 INFO db.liquibase :: Database has unrun migrations. Waiting for migration lock to be cleared...
2021-01-19 10:07:31,086 WARN changelog.DatabaseChangeLog :: modifyDataType will lose primary key/autoincrement/not null settings for mysql.  Use <sql> and re-specify all configuration if this is the case
2021-01-19 10:07:31,096 INFO db.liquibase :: Migration lock is cleared. Running migrations...
2021-01-19 10:07:31,130 WARN changelog.DatabaseChangeLog :: modifyDataType will lose primary key/autoincrement/not null settings for mysql.  Use <sql> and re-specify all configuration if this is the case
2021-01-19 10:07:31,270 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::200::camsaul failed.  Error: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
2021-01-19 10:07:31,284 WARN metabase.util :: auto-retry metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__20961@5f7a81bb: Migration failed for change set migrations/000_migrations.yaml::200::camsaul:
     Reason: liquibase.exception.DatabaseException: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
2021-01-19 10:07:31,352 WARN changelog.DatabaseChangeLog :: modifyDataType will lose primary key/autoincrement/not null settings for mysql.  Use <sql> and re-specify all configuration if this is the case
2021-01-19 10:07:31,460 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::200::camsaul failed.  Error: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
2021-01-19 10:07:31,471 WARN metabase.util :: auto-retry metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__20961@5f7a81bb: Migration failed for change set migrations/000_migrations.yaml::200::camsaul:
     Reason: liquibase.exception.DatabaseException: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
2021-01-19 10:07:31,512 WARN changelog.DatabaseChangeLog :: modifyDataType will lose primary key/autoincrement/not null settings for mysql.  Use <sql> and re-specify all configuration if this is the case
2021-01-19 10:07:31,622 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::200::camsaul failed.  Error: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
2021-01-19 10:07:31,631 WARN metabase.util :: auto-retry metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__20961@5f7a81bb: Migration failed for change set migrations/000_migrations.yaml::200::camsaul:
     Reason: liquibase.exception.DatabaseException: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
2021-01-19 10:07:31,680 WARN changelog.DatabaseChangeLog :: modifyDataType will lose primary key/autoincrement/not null settings for mysql.  Use <sql> and re-specify all configuration if this is the case
2021-01-19 10:07:31,791 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::200::camsaul failed.  Error: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
2021-01-19 10:07:31,810 ERROR metabase.core :: Metabase Initialization FAILED
liquibase.exception.MigrationFailedException: Migration failed for change set migrations/000_migrations.yaml::200::camsaul:
     Reason: liquibase.exception.DatabaseException: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637) ~[metabase.jar:?]
	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[metabase.jar:?]
	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83) ~[metabase.jar:?]
	at liquibase.Liquibase.update(Liquibase.java:202) ~[metabase.jar:?]
	at liquibase.Liquibase.update(Liquibase.java:179) ~[metabase.jar:?]
	at liquibase.Liquibase.update(Liquibase.java:175) ~[metabase.jar:?]
	at metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__20961.invoke(liquibase.clj:125) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invokeStatic(util.clj:437) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invoke(util.clj:429) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invokeStatic(util.clj:444) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invoke(util.clj:429) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invokeStatic(util.clj:444) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invoke(util.clj:429) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invokeStatic(util.clj:444) ~[metabase.jar:?]
	at metabase.util$do_with_auto_retries.invoke(util.clj:429) ~[metabase.jar:?]
	at metabase.db.liquibase$migrate_up_if_needed_BANG_.invokeStatic(liquibase.clj:125) ~[metabase.jar:?]
	at metabase.db.liquibase$migrate_up_if_needed_BANG_.invoke(liquibase.clj:113) ~[metabase.jar:?]
	at metabase.db$migrate_BANG_$fn__21745$fn__21746.invoke(db.clj:208) ~[metabase.jar:?]
	at metabase.db.liquibase$do_with_liquibase.invokeStatic(liquibase.clj:37) ~[metabase.jar:?]
	at metabase.db.liquibase$do_with_liquibase.invoke(liquibase.clj:29) ~[metabase.jar:?]
	at metabase.db$migrate_BANG_$fn__21745.invoke(db.clj:203) ~[metabase.jar:?]
	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:807) ~[metabase.jar:?]
	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:776) ~[metabase.jar:?]
	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:852) ~[metabase.jar:?]
	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:776) ~[metabase.jar:?]
	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:789) ~[metabase.jar:?]
	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:776) ~[metabase.jar:?]
	at metabase.db$migrate_BANG_.invokeStatic(db.clj:194) ~[metabase.jar:?]
	at metabase.db$migrate_BANG_.invoke(db.clj:173) ~[metabase.jar:?]
	at metabase.db$run_schema_migrations_BANG_.invokeStatic(db.clj:336) ~[metabase.jar:?]
	at metabase.db$run_schema_migrations_BANG_.invoke(db.clj:330) ~[metabase.jar:?]
	at metabase.db$setup_db_BANG__STAR_$fn__21828.invoke(db.clj:353) ~[metabase.jar:?]
	at metabase.util$do_with_us_locale.invokeStatic(util.clj:670) ~[metabase.jar:?]
	at metabase.util$do_with_us_locale.invoke(util.clj:656) ~[metabase.jar:?]
	at metabase.db$setup_db_BANG__STAR_.invokeStatic(db.clj:351) ~[metabase.jar:?]
	at metabase.db$setup_db_BANG__STAR_.invoke(db.clj:346) ~[metabase.jar:?]
	at metabase.db$setup_db_from_env_BANG_.invokeStatic(db.clj:365) ~[metabase.jar:?]
	at metabase.db$setup_db_from_env_BANG_.invoke(db.clj:358) ~[metabase.jar:?]
	at metabase.db$setup_db_BANG_$fn__21833.invoke(db.clj:375) ~[metabase.jar:?]
	at metabase.db$setup_db_BANG_.invokeStatic(db.clj:373) ~[metabase.jar:?]
	at metabase.db$setup_db_BANG_.invoke(db.clj:368) ~[metabase.jar:?]
	at metabase.core$init_BANG_.invokeStatic(core.clj:96) ~[metabase.jar:?]
	at metabase.core$init_BANG_.invoke(core.clj:75) ~[metabase.jar:?]
	at metabase.core$start_normally.invokeStatic(core.clj:140) [metabase.jar:?]
	at metabase.core$start_normally.invoke(core.clj:134) [metabase.jar:?]
	at metabase.core$_main.invokeStatic(core.clj:173) [metabase.jar:?]
	at metabase.core$_main.doInvoke(core.clj:167) [metabase.jar:?]
	at clojure.lang.RestFn.invoke(RestFn.java:397) [metabase.jar:?]
	at clojure.lang.AFn.applyToHelper(AFn.java:152) [metabase.jar:?]
	at clojure.lang.RestFn.applyTo(RestFn.java:132) [metabase.jar:?]
	at metabase.core.main(Unknown Source) [metabase.jar:?]
Caused by: liquibase.exception.DatabaseException: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE) [Failed SQL: ALTER TABLE metabase.metabase_fieldvalues ADD CONSTRAINT fk_fieldvalues_ref_field_id FOREIGN KEY (field_id) REFERENCES metabase.metabase_field (id) ON DELETE CASCADE]
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211) ~[metabase.jar:?]
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600) ~[metabase.jar:?]
	... 50 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: (conn=11918693) Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE)
	at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:70) ~[metabase.jar:?]
	at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:153) ~[metabase.jar:?]
	at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:274) ~[metabase.jar:?]
	at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:363) ~[metabase.jar:?]
	at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:501) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211) ~[metabase.jar:?]
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600) ~[metabase.jar:?]
	... 50 more
Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE)
	at org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException.of(MariaDbSqlException.java:34) ~[metabase.jar:?]
	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:194) ~[metabase.jar:?]
	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:262) ~[metabase.jar:?]
	at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:357) ~[metabase.jar:?]
	at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:501) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211) ~[metabase.jar:?]
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600) ~[metabase.jar:?]
	... 50 more
Caused by: java.sql.SQLException: Cannot add or update a child row: a foreign key constraint fails (`metabase`.`#sql-6279_b5dd65`, CONSTRAINT `fk_fieldvalues_ref_field_id` FOREIGN KEY (`field_id`) REFERENCES `metabase_field` (`id`) ON DELETE CASCADE)
	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1688) ~[metabase.jar:?]
	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1550) ~[metabase.jar:?]
	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1513) ~[metabase.jar:?]
	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:256) ~[metabase.jar:?]
	at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:357) ~[metabase.jar:?]
	at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:501) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:352) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57) ~[metabase.jar:?]
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1229) ~[metabase.jar:?]
	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1211) ~[metabase.jar:?]
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600) ~[metabase.jar:?]
	... 50 more
2021-01-19 10:07:31,835 INFO metabase.core :: Metabase Shutting Down ...
2021-01-19 10:07:31,836 INFO metabase.server :: Shutting Down Embedded Jetty Webserver
2021-01-19 10:07:31,850 INFO metabase.core :: Metabase Shutdown COMPLETE

Hi @SetSails
Please don’t direct new questions to me - this is a community forum, where anyone should be able to help.

It looks like you have a corruption in your application database. MySQL is really bad at providing good error messages, so you might have to run with MB_DB_AUTOMIGRATE=false, so you get the SQL and manually input into MySQL, which hopefully will provide better information about what is failing.

Seems like you have rows in metabase_fieldvalues referencing rows in metabase_field, which doesn’t exists. Manually clearing out the old fieldvalues should fix it.
For reference: https://github.com/metabase/metabase/blob/master/resources/migrations/000_migrations.yaml#L6966-L6977

1 Like

Thanks for the hint with the unmachted records! Removing 4 records from back in 2016 fixed the issue.

I’m now running into a block on this statement:

--  Changeset migrations/000_migrations.yaml::268::rlotun
--  Added 0.37.0
CREATE INDEX idx_lower_email ON metabase.core_user(lower(email))

response:
Error Code: 1064. 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 'email))' at line 1

Looks like this update is trying to use a functionality that was only added in MySQL 8. We’re still running on 5.7 and can’t upgrade because the same physical instance runs apps that are not yet fully compatible with 8.

Is it safe to just skip this ? Looks like a non-essential constraint to me.

Furthermore (proceeding with the updates to check for further issues):

--  Changeset migrations/000_migrations.yaml::270::rlotun
--  Added 0.37.0
CREATE EXTENSION IF NOT EXISTS citext;

and

--  Changeset migrations/000_migrations.yaml::272::rlotun
--  Added 0.37.0
ALTER TABLE metabase.core_user MODIFY email VARCHAR_IGNORECASE(254);

also seem to require MySQL 8.

Is it safe to just skip all the updates propagated in 0.37.0 by rlotun ?

Thank you & Best Regards
Fabian

@SetSails There’s nothing “non-essential” about migrations. If not applied, then your database is in what we call “corrupted state”, which can then lead to other problems in the future.
We are working on trying to fix a lot of those problems, so upgrades are more smooth in the future.

Make sure that all metabase.core_user.email are lowercase manually, then you can probably skip those migrations. Your database is probably using collation utf8mb4_unicode_ci, which is case-insensitive already, so that should prevent users with the same email in different cases.