Change Set migrations/000_migrations.yaml::89::camsaul failed

I'm doing for upgrade metabase from 0.39.0 to 0.41.0.

but I had test on my computer, I get error:

2022-01-10 18:52:03,651 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::89::camsaul failed. Error: (conn=12) Table 'qrtz_job_details' already exists [Failed SQL: CREATE TABLE metabase.QRTZ_JOB_DETAILS (SCHED_NAME VARCHAR(120) NOT NULL, JOB_NAME VARCHAR(200) NOT NULL, JOB_GROUP VARCHAR(200) NOT NULL, DESCRIPTION VARCHAR(250) NULL, JOB_CLASS_NAME VARCHAR(250) NOT NULL, IS_DURABLE BIT(1) NOT NULL, IS_NONCONCURRENT BIT(1) NOT NULL, IS_UPDATE_DATA BIT(1) NOT NULL, REQUESTS_RECOVERY BIT(1) NOT NULL, JOB_DATA BLOB NULL) COMMENT='Used for Quartz scheduler.' ENGINE InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci]
2022-01-10 18:52:03,670 ERROR metabase.core :: Metabase Initialization FAILED
liquibase.exception.MigrationFailedException: Migration failed for change set migrations/000_migrations.yaml::89::camsaul:
Reason: liquibase.exception.DatabaseException: (conn=12) Table 'qrtz_job_details' already exists [Failed SQL: CREATE TABLE metabase.QRTZ_JOB_DETAILS (SCHED_NAME VARCHAR(120) NOT NULL, JOB_NAME VARCHAR(200) NOT NULL, JOB_GROUP VARCHAR(200) NOT NULL, DESCRIPTION VARCHAR(250) NULL, JOB_CLASS_NAME VARCHAR(250) NOT NULL, IS_DURABLE BIT(1) NOT NULL, IS_NONCONCURRENT BIT(1) NOT NULL, IS_UPDATE_DATA BIT(1) NOT NULL, REQUESTS_RECOVERY BIT(1) NOT NULL, JOB_DATA BLOB NULL) COMMENT='Used for Quartz scheduler.' ENGINE InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53)

Pls help me.

Hi @Jakin
You should upgrade to latest release, 0.41.5: https://github.com/metabase/metabase/releases/latest

It seems like you either have a corruption in your application database or testing against an incomplete application database.

It's trying to create a table, which already exists, but that shouldn't happen unless your application database table databasechangelog is in a bad state.

Include the output of SELECT * FROM `DATABASECHANGELOG`

Hi
It is not help me for your answer.

When I upgrade, I restart system, it show error : liquibase.exception.DatabaseException: (conn=151) Table 'core_organization' already exists [Failed SQL: CREATE TABLE metabase.core_organization (id INT AUTO_INCREMENT NOT NULL, slug VARCHAR(254) NOT NULL, name VARCHAR(254) NOT NULL, description TEXT NULL, logo_url VARCHAR(254) NULL, inherits BIT(1) NOT NULL, CONSTRAINT PK_CORE_ORGANIZATION PRIMARY KEY (id), UNIQUE (slug)) ENGINE InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci]

I think it tell me this table is exists.

also I found mysql db has the same name table.The only difference between them is that the case of the table is different. look at pic.image

@Jakin Well, there's your problem. There should not be duplicate tables with different casing. I don't know how you got that into your system, but likely when you copied to your computer as a test.

Hi, I had changed table name to upper case and then I restart success on local. I think it is an error from h2 to mysql.

And then after I upgrade to 0.42.0. The following error log occurred during program execution,
2022-01-11 18:15:13,731 ERROR core.ErrorLogger :: An error occurred while scanning for the next triggers to fire.
org.quartz.JobPersistenceException: Couldn't acquire next trigger: invalid stream header: EFBFBDEF [See nested exception: java.io.StreamCorruptedException: invalid stream header: EFBFBDEF]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2827)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2755)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3798)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2751)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264)
Caused by: java.io.StreamCorruptedException: invalid stream header: EFBFBDEF
at java.base/java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:963)
at java.base/java.io.ObjectInputStream.(ObjectInputStream.java:397)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.getObjectFromBlob(StdJDBCDelegate.java:3154)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectJobDetail(StdJDBCDelegate.java:881)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2794)
... 4 more

@Jakin
Which version of MySQL are you using?
And how did you migrate from H2 to MySQL?
You are doing something manually, which is causing all these problem, but I'm not sure what it is.

For historical reasons, some developers have migrated H2 to MySQL.The previous procedures were executed normally.

When I upgraded this version, I found incompatibility. I tried to change the table name to uppercase, and my program started successfully.

Now. I use Mysql version is 8.0.

@Jakin

The latest version of MySQL is 8.0.27.

There's no Metabase 0.42.0 - yet.

Okay, something must have gone wrong somewhere. I'm guessing the data has not been copied correctly or migration between H2 and MySQL was done manually.

Oh no.Mysql version is 8.0.

My application can start normally, but the following error logs will always appear in the log:
2022-01-11 18:29:47,905 ERROR core.ErrorLogger :: An error occurred while scanning for the next triggers to fire.
org.quartz.JobPersistenceException: Couldn't acquire next trigger: invalid stream header: EFBFBDEF [See nested exception: java.io.StreamCorruptedException: invalid stream header: EFBFBDEF]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2827)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2755)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3798)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2751)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264)
Caused by: java.io.StreamCorruptedException: invalid stream header: EFBFBDEF
at java.base/java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:963)
at java.base/java.io.ObjectInputStream.(ObjectInputStream.java:397)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.getObjectFromBlob(StdJDBCDelegate.java:3154)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectJobDetail(StdJDBCDelegate.java:881)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2794)

I may be more worried about the impact. I wish I could know what caused this mistake

@Jakin This is because the table qrtz_job_details or qrtz_triggers has become corrupted, but since it's impossible to know which DDL state your application database is, then I would recommend that you setup a new instance and compare the DDL between the two databases.
Use a tool like DBeaver.io

If you have a corrupted application database, then you're setting yourself up for a world of problems.