Have metabase 0.19.1 running fine, on H2.
Tried to migrate to a newly created psql database, and get fk violation errors on table raw_column. Running command:
java -jar metabase.jar load-from-h2
Below is the full output.
Thanks,
output:
arcims@beja115:/opt/metabase$ java -jar metabase.jar load-from-h2
08-08 16:26:24 INFO metabase.db :: Verifying postgres Database Connection ...
08-08 16:26:24 DEBUG metabase.driver :: Registered driver :postgres
08-08 16:26:24 INFO metabase.db :: Verify Database Connection ...
08-08 16:26:58 INFO metabase.db :: Database Migrations Current ...
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier '/mchange-commons.properties' could not be found. Skipping.", exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier '/mchange-log.properties' could not be found. Skipping.", exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier '/c3p0.properties' could not be found. Skipping.", exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier '/mchange-commons.properties' could not be found. Skipping.", exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier '/mchange-log.properties' could not be found. Skipping.", exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier '/c3p0.properties' could not be found. Skipping.", exception -> null]
com.mchange.v2.cfg.DelayedLogItem [ level -> FINE, text -> "The configuration file for resource identifier 'hocon:/reference,/application,/c3p0,/' could not be found. Skipping.", exception -> null]
08-08 16:26:59 INFO db.migrations :: Running all necessary data migrations, this may take a minute.
08-08 16:26:59 INFO db.migrations :: Running data migration 'set-card-database-and-table-ids'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'set-mongodb-databases-ssl-false'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'set-default-schemas'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'set-admin-email'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'remove-database-sync-activity-entries'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'remove-duplicate-fk-entries'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'update-dashboards-to-new-grid'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'migrate-field-visibility-type'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'fix-dashboard-cards-without-positions'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'migrate-fk-metadata'...
08-08 16:26:59 INFO db.migrations :: Running data migration 'create-raw-tables'...
08-08 16:26:59 INFO db.migrations :: Finished running data migrations.
Transfering 2 instances of Database....[OK]
Transfering 2198 instances of RawTable...........[OK]
Transfering 22514 instances of RawColumn...............................................................................[OK]
Transfering 173 instances of RawColumn....BatchUpdateException:
Message: Batch entry 8 INSERT INTO raw_column ( "column_type", "raw_table_id", "name", "fk_target_column_id", "updated_at", "details", "active", "id", "is_pk", "created_at" ) VALUES ( NULL, 2098, 'id', 25808, '2016-08-08 14:50:43.709000 +01:00:00', '{"base-type":"BigIntegerField"}', '1', 22456, '1', '2016-05-19 18:03:20.021000 +01:00:00' ) was aborted. Call getNextException to see the cause.
SQLState: 23503
Error Code: 0
PSQLException:
Message: ERROR: insert or update on table "raw_column" violates foreign key constraint "fk_rawcolumn_fktarget_ref_rawcolumn"
Detail: Key (fk_target_column_id)=(25808) is not present in table "raw_column".
SQLState: 23503
Error Code: 0
java.sql.BatchUpdateException: Batch entry 8 INSERT INTO raw_column ( "column_type", "raw_table_id", "name", "fk_target_column_id", "updated_at", "details", "active", "id", "is_pk", "created_at" ) VALUES ( NULL, 2098, 'id', 25808, '2016-08-08 14:50:43.709000 +01:00:00', '{"base-type":"BigIntegerField"}', '1', 22456, '1', '2016-05-19 18:03:20.021000 +01:00:00' ) was aborted. Call getNextException to see the cause.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2743)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1928)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:405)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2892)
at clojure.java.jdbc$execute_batch.invokeStatic(jdbc.clj:426)
at clojure.java.jdbc$execute_batch.invoke(jdbc.clj:419)
at clojure.java.jdbc$db_do_execute_prepared_statement$fn__2785.invoke(jdbc.clj:792)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:637)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:585)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:598)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:585)
at clojure.java.jdbc$db_do_execute_prepared_statement.invokeStatic(jdbc.clj:791)
at clojure.java.jdbc$db_do_execute_prepared_statement.invoke(jdbc.clj:778)
at clojure.java.jdbc$db_do_prepared.invokeStatic(jdbc.clj:814)
at clojure.java.jdbc$db_do_prepared.invoke(jdbc.clj:795)
at clojure.java.jdbc$insert_cols_BANG_.invokeStatic(jdbc.clj:1069)
at clojure.java.jdbc$insert_cols_BANG_.invoke(jdbc.clj:1061)
at clojure.java.jdbc$insert_multi_BANG_.invokeStatic(jdbc.clj:1110)
at clojure.java.jdbc$insert_multi_BANG_.invoke(jdbc.clj:1093)
at metabase.cmd.load_from_h2$insert_entity_BANG_$fn__25145.invoke(load_from_h2.clj:104)
at metabase.cmd.load_from_h2$insert_entity_BANG_.invokeStatic(load_from_h2.clj:103)
at metabase.cmd.load_from_h2$insert_entity_BANG_.invoke(load_from_h2.clj:85)
at metabase.cmd.load_from_h2$insert_self_referencing_entity_BANG_.invokeStatic(load_from_h2.clj:124)
at metabase.cmd.load_from_h2$insert_self_referencing_entity_BANG_.invoke(load_from_h2.clj:112)
at metabase.cmd.load_from_h2$load_from_h2_BANG_$fn__25228$fn__25229.invoke(load_from_h2.clj:156)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:613)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:585)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:629)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:585)
at clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:598)
at clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:585)
at metabase.cmd.load_from_h2$load_from_h2_BANG_$fn__25228.invoke(load_from_h2.clj:148)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invokeStatic(load_from_h2.clj:147)
at metabase.cmd.load_from_h2$load_from_h2_BANG_.invoke(load_from_h2.clj:136)
at clojure.lang.Var.invoke(Var.java:379)
at metabase.core$fn__30418.invokeStatic(core.clj:240)
at metabase.core$fn__30418.doInvoke(core.clj:238)
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.core$apply.invokeStatic(core.clj:646)
at clojure.core$apply.invoke(core.clj:641)
at metabase.core$run_cmd$fn__30421.invoke(core.clj:247)
at metabase.core$run_cmd.invokeStatic(core.clj:247)
at metabase.core$run_cmd.doInvoke(core.clj:242)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$apply.invoke(core.clj:641)
at metabase.core$_main.invokeStatic(core.clj:259)
at metabase.core$_main.doInvoke(core.clj:255)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at metabase.core.main(Unknown Source)
Command failed with exception: Batch entry 8 INSERT INTO raw_column ( "column_type", "raw_table_id", "name", "fk_target_column_id", "updated_at", "details", "active", "id", "is_pk", "created_at" ) VALUES ( NULL, 2098, 'id', 25808, '2016-08-08 14:50:43.709000 +01:00:00', '{"base-type":"BigIntegerField"}', '1', 22456, '1', '2016-05-19 18:03:20.021000 +01:00:00' ) was aborted. Call getNextException to see the cause.