Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

How to do an upgrade from 0.8.0 to 0.10.1 - Database issue - Migration checksum mismatch for migration version 1 #668

@FlavioImbertDomingos

Description

@FlavioImbertDomingos

Hi Square Team,

We have a big deployment of Keywhiz (over 23 servers) running 0.8.0. I am trying to test the upgrade and it is not easy because the Java 11 change and the DAtabase changes as well.

How you do this upgrade? Do you have any tip or steps that I can do to make it possible?
Is my only option to drop the existing database, create a new db with the migrate and some how restore the data from the old database to the new one?

Here is what is happening when I try to start or migrate:

$ java -cp /usr/safenet/lunaclient/jsp/lib/LunaProvider.jar:./keywhiz-server-0.10.1-shaded.jar -Djava.library.path=/usr/safenet/lunaclient/jsp/lib/ keywhiz.KeywhizService server ./keywhiz-config.yml

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.fasterxml.jackson.module.afterburner.util.MyClassLoader (file:/opt/keywhiz-server-0.10.1-shaded.jar) to method java.lang.ClassLoader.findLoadedClass(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.fasterxml.jackson.module.afterburner.util.MyClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
org.flywaydb.core.api.FlywayException: Validate failed: Migration checksum mismatch for migration version 1
-> Applied to database : -1043629835
-> Resolved locally : -118804294
at org.flywaydb.core.Flyway.doValidate(Flyway.java:1482)
at org.flywaydb.core.Flyway.access$100(Flyway.java:85)
at org.flywaydb.core.Flyway$2.execute(Flyway.java:1455)
at org.flywaydb.core.Flyway$2.execute(Flyway.java:1448)
at org.flywaydb.core.Flyway.execute(Flyway.java:1711)
at org.flywaydb.core.Flyway.validate(Flyway.java:1448)
at keywhiz.KeywhizService.validateDatabase(KeywhizService.java:171)
at keywhiz.KeywhizService.run(KeywhizService.java:159)
at keywhiz.KeywhizService.run(KeywhizService.java:71)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
at io.dropwizard.cli.Cli.run(Cli.java:78)
at io.dropwizard.Application.run(Application.java:93)
at keywhiz.KeywhizService.main(KeywhizService.java:78

This is what I see in the schema_version of my 0.8 deployment...

[keywhiz_stg]> select * from schema_version;
+--------------+----------------+---------+----------------------------------------+------+--------------------------------------------------+-------------+--------------+---------------------+----------------+---------+
| version_rank | installed_rank | version | description | type | script | checksum | installed_by | installed_on | execution_time | success |
+--------------+----------------+---------+----------------------------------------+------+--------------------------------------------------+-------------+--------------+---------------------+----------------+---------+
| 1 | 1 | 1 | create tables | SQL | V1__create_tables.sql | -1043629835 | root | 2017-05-10 16:09:13 | 170 | 1 |
| 2 | 2 | 1.1 | alter secret content to add expiry | SQL | V1.1__alter_secret_content_to_add_expiry.sql | -657209746 | root | 2017-05-10 16:09:13 | 40 | 1 |
| 3 | 3 | 1.2 | alter secret content to remove version | SQL | V1.2__alter_secret_content_to_remove_version.sql | 1602621448 | root | 2017-05-10 16:09:13 | 37 | 1 |
| 4 | 4 | 1.3 | alter secrets to add current | SQL | V1.3__alter_secrets_to_add_current.sql | -533763817 | root | 2017-05-10 16:09:13 | 18 | 1 |
| 5 | 5 | 1.4 | add indexes | SQL | V1.4__add_indexes.sql | 1723007867 | root | 2017-05-10 16:09:13 | 32 | 1 |
| 6 | 6 | 1.5 | alter groups to add metadata | SQL | V1.5__alter_groups_to_add_metadata.sql | -327466309 | root | 2017-05-10 16:09:13 | 20 | 1 |
| 7 | 7 | 1.6 | add accessgrants index | SQL | V1.6__add_accessgrants_index.sql | 195441156 | root | 2017-05-10 16:09:13 | 13 | 1 |
| 8 | 8 | 1.7 | alter clients to add last seen | SQL | V1.7__alter_clients_to_add_last_seen.sql | 327844707 | root | 2017-05-10 16:09:14 | 261 | 1 |
| 9 | 9 | 4 | alter secret content to add hmac | SQL | V4__alter_secret_content_to_add_hmac.sql | 1486396107 | root | 2017-05-10 16:09:14 | 26 | 1 |
| 10 | 10 | 5 | add index current to secrets | SQL | V5__add_index_current_to_secrets.sql | 1338499923 | root | 2017-05-10 16:09:14 | 13 | 1 |
| 11 | 11 | 6 | drop unique constraint on secret name | SQL | V6__drop_unique_constraint_on_secret_name.sql | -1693049885 | gpskwstg | 2017-08-03 18:31:38 | 218 | 1 |

Any idea how I can perform this upgrade from 0.8.0 to 0.10.1?

Thank you so much,

Flavio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions