Skip to main content

Hello,

Am trying to setup rundeck :4.11(with customized docker image) with MySQL azure:8.0.42 as database.

Am struck with the liquibase below error:

Issue:

“Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set core/WorkflowWorkflowStepPrimaryKey.groovy::1653585641550-1::rundeckuser (generated):
     Reason: liquibase.exception.DatabaseException: Incorrect table definition; there can be only one auto column and it must be defined as a key [Failed SQL: (1075) ALTER TABLE poc_rundeck.workflow_workflow_step ADD id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY]
        at liquibase.changelog.ChangeSet.execute(ChangeSet.java:696)”. 

 

When I tried the same instance on flexible server database with MySQL:8.0.25, it is running without any error.

I have done all the prerequisites mentioned in the official documentation regarding “sql_generate_invisible_primary_key > Change its value to OFF”, sql mode also off. But still getting the same error. (Using MySQL as a database backend)

Do we need to do any further changes or do we have any specific jar files related mysql azure databases. Do we need to do any changes in Dockerfile or code.

 

Any assistance in this matter, is greatly appreciated.

 

Thanks in Advance,

Saritha

 

Hey ​@sarithavattikonda

This error is coming from MySQL’s rule that you can only have one AUTO_INCREMENT column per table, and it must be defined as a key (usually as the primary key). MySQL 8.0.42 is stricter about this than some earlier versions, and Azure’s managed MySQL may enforce it even more strictly.

Here’s what you can check:

  • Make sure the table doesn’t already have a primary key or another auto-increment column before the migration runs.
  • The migration should add the id column as AUTO_INCREMENT and PRIMARY KEY in a single statement.
  • If the table already has a primary key, you’ll need to drop it first before adding the new one.
  • If you’re using Liquibase, double-check your changeset to ensure it’s not trying to add an auto-increment column to a table that already has a primary key.

Hope this helps, enjoy your day!