Metabase Upgrade: DB Migration Permissions Error

Going from 0.49.6 to v0.50.20 on open source Metabase (via helm chart), I am hitting an error when the database is migrating:

2024-08-14 16:13:11,215 INFO db.liquibase :: Migration lock acquired.
2024-08-14 16:13:11,587 INFO db.liquibase :: Running 66 migrations ...
2024-08-14 16:13:11,949 ERROR liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v50.2024-01-10T03:27:30::noahmoss encountered an exception.
liquibase.exception.DatabaseException: ERROR: permission denied: "RI_ConstraintTrigger_c_848225" is a system trigger [Failed SQL: (0) ALTER TABLE data_permissions DISABLE TRIGGER ALL]
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:470)
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:77)
	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:179)
	at liquibase.executor.AbstractExecutor.execute(AbstractExecutor.java:141)
	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1285)
	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:755)
	at liquibase.changelog.visitor.UpdateVisitor.executeAcceptedChange(UpdateVisitor.java:119)
	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:68)
	at liquibase.changelog.ChangeLogIterator$2.lambda$run$0(ChangeLogIterator.java:133)
	at liquibase.Scope.lambda$child$0(Scope.java:186)
	at liquibase.Scope.child(Scope.java:195)
	at liquibase.Scope.child(Scope.java:185)
	at liquibase.Scope.child(Scope.java:164)
	at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:122)
	at liquibase.Scope.lambda$child$0(Scope.java:186)
	at liquibase.Scope.child(Scope.java:195)
	at liquibase.Scope.child(Scope.java:185)
	at liquibase.Scope.child(Scope.java:164)
	at liquibase.Scope.child(Scope.java:252)
	at liquibase.Scope.child(Scope.java:256)
	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:89)
	at liquibase.command.core.AbstractUpdateCommandStep.lambda$run$0(AbstractUpdateCommandStep.java:110)
	at liquibase.Scope.lambda$child$0(Scope.java:186)
	at liquibase.Scope.child(Scope.java:195)
	at liquibase.Scope.child(Scope.java:185)
	at liquibase.Scope.child(Scope.java:164)
	at liquibase.command.core.AbstractUpdateCommandStep.run(AbstractUpdateCommandStep.java:108)
	at liquibase.command.core.UpdateCommandStep.run(UpdateCommandStep.java:105)
	at liquibase.command.CommandScope.execute(CommandScope.java:217)
	at liquibase.Liquibase.lambda$update$0(Liquibase.java:245)
	at liquibase.Scope.lambda$child$0(Scope.java:186)
	at liquibase.Scope.child(Scope.java:195)
	at liquibase.Scope.child(Scope.java:185)
	at liquibase.Scope.child(Scope.java:164)
	at liquibase.Liquibase.runInScope(Liquibase.java:1419)
	at liquibase.Liquibase.update(Liquibase.java:234)
	at liquibase.Liquibase.update(Liquibase.java:212)
	at liquibase.Liquibase.update(Liquibase.java:194)
	at metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__44483.invoke(liquibase.clj:360)
	at metabase.db.liquibase$run_in_scope_locked$reify__44479.run(liquibase.clj:325)
	at liquibase.Scope.lambda$child$0(Scope.java:186)
	at liquibase.Scope.child(Scope.java:195)
	at liquibase.Scope.child(Scope.java:185)
	at liquibase.Scope.child(Scope.java:164)
	at metabase.db.liquibase$run_in_scope_locked.invokeStatic(liquibase.clj:318)
	at metabase.db.liquibase$run_in_scope_locked.invoke(liquibase.clj:301)
	at metabase.db.liquibase$migrate_up_if_needed_BANG_.invokeStatic(liquibase.clj:349)
	at metabase.db.liquibase$migrate_up_if_needed_BANG_.invoke(liquibase.clj:342)
	at metabase.db.setup$migrate_BANG_$fn__53428.invoke(setup.clj:84)
	at metabase.db.liquibase$do_with_liquibase$f_STAR___44420.invoke(liquibase.clj:140)
	at metabase.db.liquibase$do_with_liquibase.invokeStatic(liquibase.clj:143)
	at metabase.db.liquibase$do_with_liquibase.invoke(liquibase.clj:131)
	at metabase.db.setup$migrate_BANG_.invokeStatic(setup.clj:73)
	at metabase.db.setup$migrate_BANG_.doInvoke(setup.clj:55)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at metabase.db.setup$run_schema_migrations_BANG_.invokeStatic(setup.clj:149)
	at metabase.db.setup$run_schema_migrations_BANG_.invoke(setup.clj:144)
	at metabase.db.setup$setup_db_BANG_$fn__53456$fn__53457.invoke(setup.clj:167)
	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__53456.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:153)
	at metabase.db$setup_db_BANG_$fn__53481.invoke(db.clj:86)
	at metabase.db$setup_db_BANG_.invokeStatic(db.clj:81)
	at metabase.db$setup_db_BANG_.doInvoke(db.clj:68)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at metabase.core$init_BANG__STAR_.invokeStatic(core.clj:117)
	at metabase.core$init_BANG__STAR_.invoke(core.clj:98)
	at metabase.core$init_BANG_.invokeStatic(core.clj:170)
	at metabase.core$init_BANG_.invoke(core.clj:165)
	at metabase.core$start_normally.invokeStatic(core.clj:182)
	at metabase.core$start_normally.invoke(core.clj:176)
	at metabase.core$entrypoint.invokeStatic(core.clj:215)
	at metabase.core$entrypoint.doInvoke(core.clj:209)
	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)
Caused by: org.postgresql.util.PSQLException: ERROR: permission denied: "RI_ConstraintTrigger_c_848225" is a system trigger

Any guidance would be appreciated

we just hit this one on our cloud, please upgrade to 50.19 or give the database user the permission to add or remove triggers

Thanks for the response. I’m curious if you know why we are encountering this on this version, if it’s a permissions issue.