That is right. Thank you very much Time. Tao
On Tuesday, September 26, 2017 at 4:47:51 PM UTC-5, Tim Donohue wrote: > > Hello Tao Zhao, > > Now it looks like you have a custom database rule that is blocking the > DSpace database migration. Here's the important error: > > Message : ERROR: cannot drop table item column submitter_id_legacy_id > because other objects depend on it > Detail: rule protect_approval_upd on table workflowitem depends on table > item column submitter_id_legacy_id > Hint: Use DROP ... CASCADE to drop the dependent objects too. > > According to that message you have a rule named "protect_approval_upd" > applied on your database. This seems to be something custom that was added > to your database, as it is not something that DSpace comes with out of the > box. You'll need to remove that rule for the database migration to > proceed. If you feel the need, you can always add it back in later on > (using the new DSpace database table structure. > > - Tim > > On Tue, Sep 26, 2017 at 3:50 PM Tao Zhao <[email protected] > <javascript:>> wrote: > >> Thank you very much Tim. >> >> After I did the configuration, the original error was gone. But now a new >> error shows up: >> >> /[dspace]/bin/dspace database migrate >> >> Database URL: jdbc:postgresql://localhost:5432/dspace3 >> Migrating database to latest version... (Check dspace logs for details) >> Migration exception: >> >> java.sql.SQLException: Flyway migration error occurred >> at >> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:666) >> at >> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:574) >> at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:222) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at >> org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) >> at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) >> Caused by: org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException: >> Migration V6.0_2015.03.07__DS-2701_Hibernate_migration.sql failed >> ----------------------------------------------------------------- >> SQL State : 2BP01 >> Error Code : 0 >> Message : ERROR: cannot drop table item column submitter_id_legacy_id >> because other objects depend on it >> Detail: rule protect_approval_upd on table workflowitem depends on >> table item column submitter_id_legacy_id >> Hint: Use DROP ... CASCADE to drop the dependent objects too. >> Location : >> org/dspace/storage/rdbms/sqlmigration/postgres/V6.0_2015.03.07__DS-2701_Hibernate_migration.sql >> >> (/srv/oulib/dspace/config/file:/srv/oulib/dspace/lib/dspace-api-6.1.jar!/org/dspace/storage/rdbms/sqlmigration/postgres/V6.0_2015.03.07__DS-2701_Hibernate_migration.sql) >> Line : 248 >> Statement : ALTER TABLE item DROP COLUMN submitter_id_legacy_id >> >> at >> org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:117) >> at >> org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:71) >> at >> org.flywaydb.core.internal.command.DbMigrate.doMigrate(DbMigrate.java:352) >> at >> org.flywaydb.core.internal.command.DbMigrate.access$1100(DbMigrate.java:47) >> at >> org.flywaydb.core.internal.command.DbMigrate$4.doInTransaction(DbMigrate.java:308) >> at >> org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) >> at >> org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:305) >> at >> org.flywaydb.core.internal.command.DbMigrate.access$1000(DbMigrate.java:47) >> at >> org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:230) >> at >> org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:173) >> at >> org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) >> at >> org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:173) >> at org.flywaydb.core.Flyway$1.execute(Flyway.java:959) >> >> at org.flywaydb.core.Flyway$1.execute(Flyway.java:917) >> at org.flywaydb.core.Flyway.execute(Flyway.java:1373) >> at org.flywaydb.core.Flyway.migrate(Flyway.java:917) >> at >> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:655) >> ... 8 more >> Caused by: org.postgresql.util.PSQLException: ERROR: cannot drop table >> item column submitter_id_legacy_id because other objects depend on it >> Detail: rule protect_approval_upd on table workflowitem depends on >> table item column submitter_id_legacy_id >> Hint: Use DROP ... CASCADE to drop the dependent objects too. >> at >> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458) >> at >> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158) >> at >> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291) >> at >> org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432) >> at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358) >> at >> org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:305) >> at >> org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:291) >> at >> org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:269) >> at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:265) >> at >> org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291) >> at >> org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291) >> at >> org.flywaydb.core.internal.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:238) >> at >> org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:114) >> ... 24 more >> >> >> On Tuesday, September 26, 2017 at 2:39:47 PM UTC-5, Tim Donohue wrote: >> >>> Hello Tao Zhao, >>> >>> The important error seems to be this one: >>> >>> Caused by: org.flywaydb.core.api.FlywayException: Validate failed: >>> Detected applied migration not resolved locally: 5.0.2014.11.04 >>> >>> That error is noting that you previously (likely when you were running >>> DSpace 5) ran a migration that was named "5.0.2014.11.04", but that >>> same migration cannot be found any longer. >>> >>> The reason for this is that specific "5.0.2014.11.04" migration is an >>> optional one, which is only run when XMLWorkflows are enabled in DSpace: >>> >>> https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/storage/rdbms/xmlworkflow/V5_0_2014_11_04__Enable_XMLWorkflow_Migration.java >>> >>> If you *re-enable* XMLWorkflows in your DSpace 6.1 site, this error >>> should go away. See Step #8 Part "d" in the Upgrade instructions at: >>> https://wiki.duraspace.org/display/DSDOC6x/Upgrading+DSpace#UpgradingDSpace-UpgradeSteps >>> >>> Good luck, >>> >>> Tim >>> >>> On Tue, Sep 26, 2017 at 12:25 PM Tao Zhao <[email protected]> wrote: >>> >> I saw exactly the same error and could not fix it by running database >>>> repair. >>>> >>>> On Friday, September 22, 2017 at 3:53:13 PM UTC-5, Tao Zhao wrote: >>>>> >>>>> java.sql.SQLException: Flyway migration error occurred >>>>> at >>>>> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:666) >>>>> at >>>>> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:574) >>>>> at >>>>> org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:550) >>>>> at org.dspace.core.Context.<clinit>(Context.java:103) >>>>> at >>>>> org.dspace.app.util.AbstractDSpaceWebapp.register(AbstractDSpaceWebapp.java:74) >>>>> at >>>>> org.dspace.app.util.DSpaceWebappListener.contextInitialized(DSpaceWebappListener.java:31) >>>>> at >>>>> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118) >>>>> at >>>>> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634) >>>>> at >>>>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) >>>>> "../log/dspace.log.2017-09-22" 2409L, 329890C >>>>> >>>>> This is becuase some tables are missing some columns, e.g. >>>>> >>>>> 2017-09-22 15:17:44,028 FATAL org.dspace.core.Context @ Cannot obtain >>>>> the bean which provides a database connection. Check previous entries in >>>>> the dspace.log to find why the db failed to initialize. The schema >>>>> validator returned: Missing column: uuid in public.bitstream >>>>> >>>>> The similar error also happened to table doi, which is missing column >>>>> dspace_object. >>>>> >>>>> >>>>> Have you ever seen this error during upgrading and how did you fix it? >>>>> >>>>> Thanks. >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "DSpace Technical Support" group. >>>> >>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>> >>> >>>> Visit this group at https://groups.google.com/group/dspace-tech. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >>> >>> Tim Donohue >>> Technical Lead for DSpace & DSpaceDirect >>> DuraSpace.org | DSpace.org | DSpaceDirect.org >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "DSpace Technical Support" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/dspace-tech. >> For more options, visit https://groups.google.com/d/optout. >> > -- > > Tim Donohue > Technical Lead for DSpace & DSpaceDirect > DuraSpace.org | DSpace.org | DSpaceDirect.org > > -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
