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

Migrate Down on 49 doesn't work #41641

Closed
Tony-metabase opened this issue Apr 19, 2024 · 0 comments · Fixed by #41662
Closed

Migrate Down on 49 doesn't work #41641

Tony-metabase opened this issue Apr 19, 2024 · 0 comments · Fixed by #41662
Assignees
Labels
.Backend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Type:Bug Product defects
Milestone

Comments

@Tony-metabase
Copy link
Contributor

Describe the bug

Running migrate down on 49 will end up breaking the instance ... You are screwed if you don't have a backup

To Reproduce

Deploy 1.49.6 and run the java -jar metabase.jar migrate down command

Expected behavior

No response

Logs

When you run the migrate down you will see those logs:

2024-04-18 16:21:44,470 INFO metabase.util :: Maximum memory available to JVM: 4.0 GB
2024-04-18 16:21:47,401 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. 🔓
For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2024-04-18 16:21:49,863 ERROR public-settings.premium-features :: Error validating token : Assert failed: Metabase DB is not yet set up
((requiring-resolve (quote metabase.db/db-is-set-up?)))
2024-04-18 16:21:56,408 INFO driver.impl :: Registered abstract driver :sql 🚚
2024-04-18 16:21:56,430 INFO driver.impl :: Registered abstract driver :sql-jdbc (parents: [:sql]) 🚚
2024-04-18 16:21:56,439 INFO metabase.util :: Load driver :sql-jdbc took 131.9 ms
2024-04-18 16:21:56,440 INFO driver.impl :: Registered driver :h2 (parents: [:sql-jdbc]) 🚚
2024-04-18 16:21:56,733 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc]) 🚚
2024-04-18 16:21:56,785 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc]) 🚚
2024-04-18 16:22:01,534 INFO metabase.core ::
Metabase v1.49.7-SNAPSHOT (dc62587)
Copyright © 2024 Metabase, Inc.
Metabase Enterprise Edition extensions are PRESENT.
Usage of Metabase Enterprise Edition features are subject to the Metabase Commercial License. See https://www.metabase.com/license/commercial/ for details.
2024-04-18 16:22:02,750 INFO db.setup :: Setting up Liquibase...
2024-04-18 16:22:04,998 INFO db.setup :: Liquibase is ready.
2024-04-18 16:22:05,075 INFO db.liquibase :: Rolling back app database schema to version 48
2024-04-18 16:22:08,819 INFO db.custom-migrations :: No rollback for: DeleteScanFieldValuesTriggerForDBThatTurnItOff
2024-04-18 16:22:09,419 INFO db.custom-migrations :: No rollback for: DeleteTruncateAuditLogTask

Then when you try to load metabase on 1.48.11 you end up with metabase restart errors:

2024-04-18 20:48:34,942 INFO metabase.core :: Metabase Shutdown COMPLETE

2024-04-18 20:48:34,935 INFO metabase.server :: Shutting Down Embedded Jetty Webserver

2024-04-18 20:48:34,934 INFO metabase.core :: Metabase Shutting Down ...

2024-04-18 20:48:34,925 ERROR metabase.core :: Metabase Initialization FAILED

liquibase.exception.ValidationFailedException: Validation Failed:

203 changesets check sum

migrations/001_update_migrations.yaml::v00.00-000::qnkhuat was: 9:e346841fa1cd9d142e1237b37fdc8a20 but is now: 8:a59595109e74e7a2678a1b0dfd25f74a

migrations/001_update_migrations.yaml::v45.00-001::snoe was: 9:15c13a8aa3fdc72ef0c54f4cccfc39e1 but is now: 8:da99b71a4ac7eb662f6a95e69585935e

migrations/001_update_migrations.yaml::v45.00-002::snoe was: 9:d2c9f50f5a29947a07e4808957d63ab6 but is now: 8:6da7a6285edb138c404de0eeba209570

migrations/001_update_migrations.yaml::v45.00-003::snoe was: 9:dafaaf7c9f0efbf92670ea93c001f7a1 but is now: 8:512337d6d4af38016aa79585abbe03a1

migrations/001_update_migrations.yaml::v45.00-011::snoe was: 9:c539f152aa1c2287c5b602c7a395f9e8 but is now: 8:dcf1cda9f20dca4b6ff8101b13b98c4a

migrations/001_update_migrations.yaml::v45.00-012::snoe was: 9:b872219f47d12ec80db8f1731be4ce94 but is now: 8:aadf28229f585cff7c4b4c1918e558b2

migrations/001_update_migrations.yaml::v45.00-013::snoe was: 9:54c5d6a9659b7ae62e8c42f60f9620d2 but is now: 8:26dba276b14255d4346507a1a25d117b

migrations/001_update_migrations.yaml::v45.00-022::snoe was: 9:06e8a3ba8c4c5e5cf8e6aa3f35081cac but is now: 8:d46fa24e4d75a11b2e92aecbf39c6ee1

migrations/001_update_migrations.yaml::v45.00-023::snoe was: 9:082d296233ee6dbbf2871b9d93c3a6a4 but is now: 8:c6c1ff9ca3b62d4cda3a2d782dd86f2f

migrations/001_update_migrations.yaml::v45.00-025::metamben was: 9:2214b0d71acc8a8cf90781a2aca98664 but is now: 8:50a43cea3123ecdb602123825f5a7dbf

migrations/001_update_migrations.yaml::v45.00-026::snoe was: 9:9f2ce2d2d79d0dce365ddf3464d1f648 but is now: 8:ae77d4086998911877e3207fcf90c9c7

migrations/001_update_migrations.yaml::v45.00-027::snoe was: 9:73718f7b7c3fb4ef30f71dc6e6170528 but is now: 8:40c3c8391c1416a3bce09ca3c7237173

migrations/001_update_migrations.yaml::v45.00-028::camsaul was: 9:883315d70f3fc10b07858aa0e48ed9da but is now: 8:f8f68f80627aeb2ef7f28f2af2b5a31b

migrations/001_update_migrations.yaml::v45.00-029::camsaul was: 9:fe3b8aca811ef5b541f922a83c7ded8c but is now: 8:579957652133eab3ee023dd911162a1e

migrations/001_update_migrations.yaml::v45.00-030::camsaul was: 9:63da8f2f82baf396ad30f3fd451c501d but is now: 8:41eda097feb034c4d01b2dbda74753c8

migrations/001_update_migrations.yaml::v45.00-031::camsaul was: 9:3628c1c692bec0f7258ea983b18340b5 but is now: 8:6416e373e335dc1c12c7571af674dede

migrations/001_update_migrations.yaml::v45.00-032::camsaul was: 9:7a6f0320210b82c5eafe836ea98f477d but is now: 8:d97444fe24a2dca618a2804741335f6d

migrations/001_update_migrations.yaml::v45.00-033::camsaul was: 9:b93dab321e4a1fcaeb74d12b52867fd4 but is now: 8:34df79fc79e086ab05bb2fd79bb4e322

migrations/001_update_migrations.yaml::v45.00-034::camsaul was: 9:39c965f9dc521d2a1e196f645d11de9e but is now: 8:ba0505a87ef876026759cdcb4e704f41

migrations/001_update_migrations.yaml::v45.00-035::camsaul was: 9:207984e21c44681a6135592cab3d0f3f but is now: 8:dcee49781d80d9c4be5ad9dd51975a07

migrations/001_update_migrations.yaml::v45.00-036::snoe was: 9:8632f7a046e1094399c517b05f0feea3 but is now: 8:cd4009254bd2c56aaf281082038c1f0b

migrations/001_update_migrations.yaml::v45.00-037::snoe was: 9:6600702fb0cc9dcd8628fca8df9c0b39 but is now: 8:56f548cc84a53cc6d18302761ee71554

migrations/001_update_migrations.yaml::v45.00-038::camsaul was: 9:5ae52c12861e5eec6a2a9a8c5a442826 but is now: 8:c38ddc295206e807c7254581ed9566c3

migrations/001_update_migrations.yaml::v45.00-039::camsaul was: 9:7b331f47a0260218275c58fa21fdcc60 but is now: 8:2c539d76d3aead7f7366b15333132b30

migrations/001_update_migrations.yaml::v45.00-040::camsaul was: 9:6d6fb2c7cd62868b9878a951c8596cec but is now: 8:00ac7c24cfd3e7ea3a21f21f4e45dbcf

migrations/001_update_migrations.yaml::v45.00-041::camsaul was: 9:84d479472b81809b8067f72b28934954 but is now: 8:82dc368fa3e0163a06929da6e9556fe2

at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:354)

at liquibase.Liquibase.lambda$listUnrunChangeSets$16(Liquibase.java:1287)

at liquibase.Scope.lambda$child$0(Scope.java:194)

at liquibase.Scope.child(Scope.java:203)

at liquibase.Scope.child(Scope.java:193)

at liquibase.Scope.child(Scope.java:172)

at liquibase.Liquibase.runInScope(Liquibase.java:1618)

at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:1279)

at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:1270)

at metabase.db.liquibase$unrun_migrations$fn__48014.invoke(liquibase.clj:180)

at metabase.db.liquibase$do_with_liquibase$f_STAR___47999.invoke(liquibase.clj:134)

at metabase.db.liquibase$do_with_liquibase.invokeStatic(liquibase.clj:137)

at metabase.db.liquibase$do_with_liquibase.invoke(liquibase.clj:125)

at metabase.db.liquibase$unrun_migrations.invokeStatic(liquibase.clj:179)

at metabase.db.liquibase$unrun_migrations.invoke(liquibase.clj:170)

at metabase.db.liquibase$migrate_up_if_needed_BANG_.invokeStatic(liquibase.clj:225)

at metabase.db.liquibase$migrate_up_if_needed_BANG_.invoke(liquibase.clj:221)

at metabase.db.setup$migrate_BANG_$fn__50231.invoke(setup.clj:80)

at metabase.db.liquibase$do_with_liquibase$f_STAR___47999.invoke(liquibase.clj:134)

at metabase.db.liquibase$do_with_liquibase.invokeStatic(liquibase.clj:137)

at metabase.db.liquibase$do_with_liquibase.invoke(liquibase.clj:125)

at metabase.db.setup$migrate_BANG_.invokeStatic(setup.clj:75)

at metabase.db.setup$migrate_BANG_.doInvoke(setup.clj:56)

at clojure.lang.RestFn.invoke(RestFn.java:445)

at metabase.db.setup$run_schema_migrations_BANG_.invokeStatic(setup.clj:148)

at metabase.db.setup$run_schema_migrations_BANG_.invoke(setup.clj:142)

at metabase.db.setup$setup_db_BANG_$fn__50261$fn__50262.invoke(setup.clj:166)

at metabase.util.jvm$do_with_us_locale.invokeStatic(jvm.clj:239)

at metabase.util.jvm$do_with_us_locale.invoke(jvm.clj:225)

at metabase.db.setup$setup_db_BANG_$fn__50261.invoke(setup.clj:161)

at metabase.db.setup$setup_db_BANG_.invokeStatic(setup.clj:160)

at metabase.db.setup$setup_db_BANG_.invoke(setup.clj:154)

at metabase.db$setup_db_BANG_$fn__50275.invoke(db.clj:69)

at metabase.db$setup_db_BANG_.invokeStatic(db.clj:64)

at metabase.db$setup_db_BANG_.invoke(db.clj:55)

at metabase.core$init_BANG__STAR_.invokeStatic(core.clj:113)

at metabase.core$init_BANG__STAR_.invoke(core.clj:98)

at metabase.core$init_BANG_.invokeStatic(core.clj:156)

at metabase.core$init_BANG_.invoke(core.clj:151)

at metabase.core$start_normally.invokeStatic(core.clj:168)

at metabase.core$start_normally.invoke(core.clj:162)

at metabase.core$entrypoint.invokeStatic(core.clj:201)

at metabase.core$entrypoint.doInvoke(core.clj:195)

at clojure.lang.RestFn.invoke(RestFn.java:397)

at clojure.lang.AFn.applyToHelper(AFn.java:152)

at clojure.lang.RestFn.applyTo(RestFn.java:132)

at clojure.lang.Var.applyTo(Var.java:705)

at clojure.core$apply.invokeStatic(core.clj:667)

at clojure.core$apply.invoke(core.clj:662)

at metabase.bootstrap$_main.invokeStatic(bootstrap.clj:31)

at metabase.bootstrap$_main.doInvoke(bootstrap.clj:28)

at clojure.lang.RestFn.invoke(RestFn.java:397)

at clojure.lang.AFn.applyToHelper(AFn.java:152)

at clojure.lang.RestFn.applyTo(RestFn.java:132)

at metabase.bootstrap.main(Unknown Source)

2024-04-18 20:48:34,549 INFO db.setup :: Liquibase is ready.

2024-04-18 20:48:34,549 INFO db.liquibase :: Checking if Database has unrun migrations...

2024-04-18 20:48:34,304 INFO db.setup :: Running Database Migrations...

2024-04-18 20:48:34,304 INFO db.setup :: Setting up Liquibase...

2024-04-18 20:48:33,796 INFO db.setup :: [36mChecking if a database downgrade is required...[0m

2024-04-18 20:48:33,795 INFO db.setup :: Successfully verified PostgreSQL 14.3 application database connection. ✅

2024-04-18 20:48:33,304 INFO db.setup :: [36mVerifying postgres Database Connection ...[0m

2024-04-18 20:48:33,302 INFO metabase.core :: Setting up and migrating Metabase DB. Please sit tight, this may take a minute...

2024-04-18 20:48:33,292 DEBUG plugins.lazy-loaded-driver :: [35mRegistering lazy loading driver :mongo...[0m

2024-04-18 20:48:33,292 INFO driver.impl :: [34mRegistered driver :mongo[0m 🚚

2024-04-18 20:48:33,284 INFO driver.impl :: [34mRegistered driver :redshift[0m (parents: [:postgres]) 🚚

2024-04-18 20:48:33,283 DEBUG plugins.lazy-loaded-driver :: [35mRegistering lazy loading driver :redshift...[0m

2024-04-18 20:48:33,278 INFO driver.impl :: [34mRegistered driver :vertica[0m (parents: [:sql-jdbc]) 🚚

Information about your Metabase installation

1,49.6

Severity

If by mistake you upgrade and decide to run a migrate down without taking a backup you are screwed

Additional context

No response

@Tony-metabase Tony-metabase added Type:Bug Product defects Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Backend .Escalation and removed .Escalation labels Apr 19, 2024
@escherize escherize assigned escherize and unassigned escherize Apr 19, 2024
@paoliniluis paoliniluis added the .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. label Apr 22, 2024
@darksciencebase darksciencebase modified the milestones: 0.49.7, 0.48.12 Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants