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

Unable to upgrade from v0.20.4 to v0.21.1 #7255

Open
danlsgiga opened this issue Feb 7, 2025 · 0 comments
Open

Unable to upgrade from v0.20.4 to v0.21.1 #7255

danlsgiga opened this issue Feb 7, 2025 · 0 comments
Assignees
Labels
area/backend Needs backend code changes bug Something isn't working kind/backport-needed Issue that needs to be backported to a previous version

Comments

@danlsgiga
Copy link

danlsgiga commented Feb 7, 2025

Describe the issue

I have Kestra v0.20.4 running fine on my environment. Once I try to upgrade to v0.21.1, my deployment fails during startup with the following errors:

Exception in thread "main" io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [javax.sql.DataSource] could not be loaded: Validate failed: Migrations have failed validation
Migration checksum mismatch for migration version 1.25
-> Applied to database : 249069171
-> Resolved locally    : 1913347947
Either revert the changes to the migration, or run repair to update the schema history.
Need more flexibility with validation rules? Learn more: https://rd.gt/3AbJUZE
	at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:2000)
	at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:314)
	at io.micronaut.context.DefaultBeanContext.configureAndStartContext(DefaultBeanContext.java:3318)
	at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:345)
	at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:216)
	at io.micronaut.configuration.picocli.MicronautFactory.<init>(MicronautFactory.java:59)
	at io.kestra.cli.App.execute(App.java:67)
	at io.kestra.cli.App.main(App.java:50)
Caused by: org.flywaydb.core.api.exception.FlywayValidateException: Validate failed: Migrations have failed validation
Migration checksum mismatch for migration version 1.25
-> Applied to database : 249069171
-> Resolved locally    : 1913347947
Either revert the changes to the migration, or run repair to update the schema history.
Need more flexibility with validation rules? Learn more: https://rd.gt/3AbJUZE
	at org.flywaydb.core.Flyway.lambda$migrate$1(Flyway.java:190)
	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:213)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:177)
	at io.micronaut.flyway.AbstractFlywayMigration.runFlyway(AbstractFlywayMigration.java:110)
	at io.micronaut.flyway.AbstractFlywayMigration.forceRun(AbstractFlywayMigration.java:93)
	at io.micronaut.flyway.AbstractFlywayMigration.run(AbstractFlywayMigration.java:66)
	at io.micronaut.flyway.DataSourceMigrationRunner.lambda$runMigration$1(DataSourceMigrationRunner.java:68)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at io.micronaut.flyway.DataSourceMigrationRunner.runMigration(DataSourceMigrationRunner.java:66)
	at io.micronaut.flyway.DataSourceMigrationRunner.lambda$onCreated$0(DataSourceMigrationRunner.java:60)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at io.micronaut.flyway.DataSourceMigrationRunner.onCreated(DataSourceMigrationRunner.java:60)
	at io.micronaut.flyway.DataSourceMigrationRunner.onCreated(DataSourceMigrationRunner.java:39)
	at io.micronaut.context.DefaultBeanContext.triggerBeanCreatedEventListener(DefaultBeanContext.java:2387)
	at io.micronaut.context.DefaultBeanContext.postBeanCreated(DefaultBeanContext.java:2364)
	at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2308)
	at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2316)
	at io.micronaut.context.DefaultBeanContext.createRegistration(DefaultBeanContext.java:3127)
	at io.micronaut.context.SingletonScope.getOrCreate(SingletonScope.java:80)
	at io.micronaut.context.DefaultBeanContext.findOrCreateSingletonBeanRegistration(DefaultBeanContext.java:3029)
	at io.micronaut.context.DefaultBeanContext.initializeEagerBean(DefaultBeanContext.java:2693)
	at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1994)
	... 7 more

Reverting the version to v0.20.4 works fine so I don't think this corrupted the DB but there seems to be a broken migration process there.

I've also tried to upgrade first to v0.21.0 but getting the same issue.

Environment

  • Kestra Version: v0.21.1 running on docker

Configuration

datasources:
  h2:
    url: jdbc:h2:/app/storage/h2.db;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
    username: kestra
    password: <REDACTED>
    driverClassName: org.h2.Driver
kestra:
  tutorialFlows:
    enabled: false
  server:
    basic-auth:
      enabled: false
      # it must be a valid email address
      username: [email protected]
      password: kestra
  storage:
    type: local
    local:
      base-path: /app/storage
  repository:
    type: h2
  queue:
    type: h2
  tasks:
    tmp-dir:
      path: /tmp/kestra-wd/tmp
  url: https://kestra.<REDACTED>
  environment:
    name: homelab
  encryption:
    secretKey: <REDACTED>
@danlsgiga danlsgiga added area/backend Needs backend code changes area/frontend Needs frontend code changes bug Something isn't working labels Feb 7, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Issues Feb 7, 2025
@anna-geller anna-geller added kind/backport-needed Issue that needs to be backported to a previous version and removed area/frontend Needs frontend code changes labels Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend Needs backend code changes bug Something isn't working kind/backport-needed Issue that needs to be backported to a previous version
Projects
Status: Backlog
Development

No branches or pull requests

3 participants