Heroku Metabase-Deploy Upgrade -> ERROR: permission denied for relation databasechangelog


#1

I’m upgrading to latest version with heroku deployed app using the binary from https://github.com/metabase/metabase-deploy per the instructions, but am receiving ERROR: permission denied for relation databasechangelog. Tailed logs are below

2018-04-13T19:34:59.959056+00:00 heroku[web.1]: Starting process with command `HEROKU=true ./bin/start`
2018-04-13T19:35:01.482994+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2018-04-13T19:35:01.486299+00:00 app[web.1]: Using these JAVA_OPTS: -Xmx300m -Xss512k -Dfile.encoding=UTF-8  -Xmx248m -XX:-UseGCOverheadLimit -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+IgnoreUnrecognizedVMOptions -Djava.awt.headless=true -Dfile.encoding=UTF-8 --add-opens=java.base/java.net=ALL-UNNAMED --add-modules=java.xml.bind
2018-04-13T19:35:01.539500+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -Dfile.encoding=UTF-8
2018-04-13T19:35:07.709376+00:00 app[web.1]: 04-13 19:35:07 INFO metabase.util :: Loading Metabase...
2018-04-13T19:35:15.571783+00:00 app[web.1]: 04-13 19:35:15 INFO util.encryption :: DB details encryption is DISABLED for this Metabase instance. 🔓 
2018-04-13T19:35:15.571795+00:00 app[web.1]: See http://www.metabase.com/docs/latest/operations-guide/start.html#encrypting-your-database-connection-details-at-rest for more information.
2018-04-13T19:35:23.403505+00:00 app[web.1]: 04-13 19:35:23 INFO metabase.core :: Starting Metabase in STANDALONE mode
2018-04-13T19:35:23.479490+00:00 app[web.1]: 04-13 19:35:23 INFO metabase.core :: Launching Embedded Jetty Webserver with config:
2018-04-13T19:35:23.479494+00:00 app[web.1]:  {:port 22224}
2018-04-13T19:35:23.479496+00:00 app[web.1]: 
2018-04-13T19:35:23.547747+00:00 app[web.1]: 04-13 19:35:23 INFO metabase.core :: Starting Metabase version v0.28.6 (83e3c0d release-0.28.6) ...
2018-04-13T19:35:23.548089+00:00 app[web.1]: 04-13 19:35:23 INFO metabase.core :: System timezone is 'Etc/UTC' ...
2018-04-13T19:35:24.159004+00:00 heroku[web.1]: State changed from starting to up
2018-04-13T19:35:27.859258+00:00 app[web.1]: 04-13 19:35:27 INFO metabase.core :: Setting up and migrating Metabase DB. Please sit tight, this may take a minute...
2018-04-13T19:35:27.861664+00:00 app[web.1]: 04-13 19:35:27 INFO metabase.db :: Verifying postgres Database Connection ...
2018-04-13T19:35:28.044132+00:00 app[web.1]: 04-13 19:35:28 INFO metabase.db :: Verify Database Connection ...  ✅
2018-04-13T19:35:28.044416+00:00 app[web.1]: 04-13 19:35:28 INFO metabase.db :: Running Database Migrations...
2018-04-13T19:35:28.079543+00:00 app[web.1]: 04-13 19:35:28 INFO metabase.db :: Setting up Liquibase...
2018-04-13T19:35:28.201705+00:00 app[web.1]: 04-13 19:35:28 INFO metabase.db :: Liquibase is ready.
2018-04-13T19:35:28.201963+00:00 app[web.1]: 04-13 19:35:28 INFO metabase.db :: Checking if Database has unrun migrations...
2018-04-13T19:35:44.048862+00:00 app[web.1]: 04-13 19:35:44 INFO metabase.db :: Database has unrun migrations. Waiting for migration lock to be cleared...
2018-04-13T19:35:44.052917+00:00 app[web.1]: 04-13 19:35:44 INFO metabase.db :: Migration lock is cleared. Running migrations...
2018-04-13T19:35:57.677299+00:00 app[web.1]: org.postgresql.util.PSQLException: ERROR: permission denied for relation databasechangelog
2018-04-13T19:35:57.677543+00:00 app[web.1]: 	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)
2018-04-13T19:35:57.677591+00:00 app[web.1]: 	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)
2018-04-13T19:35:57.677695+00:00 app[web.1]: 	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
2018-04-13T19:35:57.677725+00:00 app[web.1]: 	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
2018-04-13T19:35:57.677754+00:00 app[web.1]: 	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
2018-04-13T19:35:57.677790+00:00 app[web.1]: 	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
2018-04-13T19:35:57.677822+00:00 app[web.1]: 	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:136)
2018-04-13T19:35:57.677852+00:00 app[web.1]: 	at clojure.java.jdbc$db_do_execute_prepared_statement$fn__1839.invoke(jdbc.clj:952)
2018-04-13T19:35:57.677883+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:784)
2018-04-13T19:35:57.678002+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
2018-04-13T19:35:57.678030+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:724)
2018-04-13T19:35:57.678069+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
2018-04-13T19:35:57.678097+00:00 app[web.1]: 	at clojure.java.jdbc$db_do_execute_prepared_statement.invokeStatic(jdbc.clj:951)
2018-04-13T19:35:57.678134+00:00 app[web.1]: 	at clojure.java.jdbc$db_do_execute_prepared_statement.invoke(jdbc.clj:945)
2018-04-13T19:35:57.678163+00:00 app[web.1]: 	at clojure.java.jdbc$db_do_prepared.invokeStatic(jdbc.clj:983)
2018-04-13T19:35:57.678192+00:00 app[web.1]: 	at clojure.java.jdbc$db_do_prepared.invoke(jdbc.clj:963)
2018-04-13T19:35:57.678223+00:00 app[web.1]: 	at clojure.java.jdbc$execute_BANG_$execute_helper__1910.invoke(jdbc.clj:1364)
2018-04-13T19:35:57.678253+00:00 app[web.1]: 	at clojure.java.jdbc$execute_BANG_.invokeStatic(jdbc.clj:1366)
2018-04-13T19:35:57.678331+00:00 app[web.1]: 	at clojure.java.jdbc$execute_BANG_.invoke(jdbc.clj:1337)
2018-04-13T19:35:57.678368+00:00 app[web.1]: 	at clojure.java.jdbc$execute_BANG_.invokeStatic(jdbc.clj:1356)
2018-04-13T19:35:57.678402+00:00 app[web.1]: 	at clojure.java.jdbc$execute_BANG_.invoke(jdbc.clj:1337)
2018-04-13T19:35:57.678443+00:00 app[web.1]: 	at metabase.db$migrate_up_if_needed_BANG_.invokeStatic(db.clj:169)
2018-04-13T19:35:57.678473+00:00 app[web.1]: 	at metabase.db$migrate_up_if_needed_BANG_.invoke(db.clj:155)
2018-04-13T19:35:57.678506+00:00 app[web.1]: 	at metabase.db$migrate_BANG_$fn__4414.invoke(db.clj:258)
2018-04-13T19:35:57.678537+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:741)
2018-04-13T19:35:57.678576+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
2018-04-13T19:35:57.678604+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:776)
2018-04-13T19:35:57.678628+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
2018-04-13T19:35:57.678662+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:724)
2018-04-13T19:35:57.678692+00:00 app[web.1]: 	at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:711)
2018-04-13T19:35:57.678734+00:00 app[web.1]: 	at metabase.db$migrate_BANG_.invokeStatic(db.clj:246)
2018-04-13T19:35:57.678763+00:00 app[web.1]: 	at metabase.db$migrate_BANG_.invoke(db.clj:227)
2018-04-13T19:35:57.678794+00:00 app[web.1]: 	at metabase.db$run_schema_migrations_BANG_.invokeStatic(db.clj:381)
2018-04-13T19:35:57.678826+00:00 app[web.1]: 	at metabase.db$run_schema_migrations_BANG_.invoke(db.clj:376)
2018-04-13T19:35:57.678859+00:00 app[web.1]: 	at metabase.db$setup_db_BANG_.invokeStatic(db.clj:399)
2018-04-13T19:35:57.678889+00:00 app[web.1]: 	at metabase.db$setup_db_BANG_.doInvoke(db.clj:392)
2018-04-13T19:35:57.678924+00:00 app[web.1]: 	at clojure.lang.RestFn.invoke(RestFn.java:421)
2018-04-13T19:35:57.679001+00:00 app[web.1]: 	at metabase.core$init_BANG_.invokeStatic(core.clj:154)
2018-04-13T19:35:57.679031+00:00 app[web.1]: 	at metabase.core$init_BANG_.invoke(core.clj:133)
2018-04-13T19:35:57.679059+00:00 app[web.1]: 	at metabase.core$start_normally.invokeStatic(core.clj:258)
2018-04-13T19:35:57.679088+00:00 app[web.1]: 	at metabase.core$start_normally.invoke(core.clj:251)
2018-04-13T19:35:57.679118+00:00 app[web.1]: 	at metabase.core$_main.invokeStatic(core.clj:279)
2018-04-13T19:35:57.679293+00:00 app[web.1]: 	at metabase.core$_main.doInvoke(core.clj:274)
2018-04-13T19:35:57.679314+00:00 app[web.1]: 	at clojure.lang.RestFn.invoke(RestFn.java:397)
2018-04-13T19:35:57.679349+00:00 app[web.1]: 	at clojure.lang.AFn.applyToHelper(AFn.java:152)
2018-04-13T19:35:57.679378+00:00 app[web.1]: 	at clojure.lang.RestFn.applyTo(RestFn.java:132)
2018-04-13T19:35:57.679413+00:00 app[web.1]: 	at metabase.core.main(Unknown Source)
2018-04-13T19:35:57.679817+00:00 app[web.1]: 04-13 19:35:57 ERROR metabase.core :: Metabase Initialization FAILED:  ERROR: permission denied for relation databasechangelog
2018-04-13T19:35:57.683116+00:00 app[web.1]: 04-13 19:35:57 INFO metabase.core :: Metabase Shutting Down ...
2018-04-13T19:35:57.683752+00:00 app[web.1]: 04-13 19:35:57 INFO metabase.core :: Metabase Shutdown COMPLETE
2018-04-13T19:35:58.184227+00:00 heroku[web.1]: State changed from up to crashed
2018-04-13T19:35:58.075189+00:00 heroku[web.1]: Process exited with status 1

It’s the same issue as Migration to new server and docker instance but it’s deployed using Heroku, so I can’t add databasechangelog as a role. Migrating questions and dashboards manually isn’t really an option. Thoughts?


#2

I have zero idea really, but I wonder if you can just alter the dump file aka ‘metabase_backup.bak’ and search for the previous owner and replace with new owner username. I opened my backup file and saw that I can see the old username - so I wonder if replacing works. Again zero idea if this works. good luck!