java.sql.SQLException: Flyway migration error occurred

Sakai JIRA | Terry Brady | 6 months ago
  1. 0

    I refreshed my DSpace 6 database with the contents of a DSpace 5 database in order to test the DSpace 6 upgrade process. 1. The migration launched by ant fails 2. I confirmed the error by running "dspace database info" 3. "dspace database migrate" fails 4. I ran "dpsace database repair" 5. I ran "dspace database migrate" successfully This behavior could be very distressing to institutions running the upgrade process. *1.Migration launched by ANT* [java] 2016-06-08 10:58:34,451 INFO org.dspace.storage.rdbms.DatabaseUtils @ Loading Flyway DB migrations from: filesystem:/opt/dspace/etc/postgres, classpath:org.dspace.storage.rdbms.sqlmigration.postgres, classpath:org.dspace.storage.rdbms.migration [java] [java] Database URL: jdbc:postgresql://localhost:5432/dspace [java] Migrating database to latest version... (Check dspace logs for details) [java] 2016-06-08 10:58:34,486 INFO org.flywaydb.core.internal.util.VersionPrinter @ Flyway 3.2.1 by Boxfuse [java] 2016-06-08 10:58:34,514 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory @ Database: jdbc:postgresql://localhost:5432/dspace (PostgreSQL 9.4) [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ Pending DSpace database schema migrations: [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 4.9.2015.10.26 DS-2818 registry update SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.03.06 DS 2701 Dso Uuid Migration JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.03.07 DS-2701 Hibernate migration SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.08.31 DS 2701 Hibernate Workflow Migration JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.01.03 DS-3024 SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.01.26 DS 2188 Remove DBMS Browse Tables JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.02.25 DS-3004-slow-searching-as-admin SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.01 DS-1955 Increase embargo reason SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.04 DS-3086-OAI-Performance-fix SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.14 DS-3125-fix-bundle-bitstream-delete-rights SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.05.10 DS-3168-fix-requestitem item id column SQL PENDING [java] 2016-06-08 10:58:34,725 INFO org.flywaydb.core.internal.command.DbValidate @ Validated 27 migrations (execution time 00:00.045s) [java] Migration exception: [java] java.sql.SQLException: Flyway migration error occurred [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:570) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:478) [java] at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:260) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java] at java.lang.reflect.Method.invoke(Method.java:606) [java] at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) [java] at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) [java] Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 1.1 [java] -> Applied to database : 864087011 [java] -> Resolved locally : 1058944165 [java] at org.flywaydb.core.Flyway.doValidate(Flyway.java:1108) [java] at org.flywaydb.core.Flyway.access$300(Flyway.java:62) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1012) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) [java] at org.flywaydb.core.Flyway.execute(Flyway.java:1418) [java] at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:559) [java] ... 8 more [java] 2016-06-08 10:58:34,727 INFO org.springframework.context.support.ClassPathXmlApplicationContext @ Closing org.springframework.context.support.ClassPathXmlApplicationContext@3822307d: startup date [Wed Jun 08 10:58:30 EDT 2016]; root of context hierarchy [java] 2016-06-08 10:58:34,734 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory @ Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12fd41e0: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.dspace.servicemanager.spring.DSpaceBeanPostProcessor#0,org.dspace.example.Example,org.dspace.app.sherpa.submit.SHERPASubmitConfigurationService,importService,PubmedImportService,PubmedMetadataFieldMapping,lookupID,org.dspace.app.requestitem.RequestItemAuthorExtractor,org.dspace.app.sherpa.SHERPAService,org.dspace.app.sherpa.submit.SHERPASubmitService,org.dspace.discovery.SearchService,org.dspace.identifier.service.IdentifierService,org.dspace.identifier.VersionedHandleIdentifierProvider,org.dspace.core.DBConnection,org.dspace.storage.rdbms.DatabaseRegistryUpdater#0,org.dspace.storage.rdbms.GroupServiceInitializer#0,org.dspace.storage.rdbms.PostgreSQLCryptoChecker#0,org.dspace.storage.rdbms.SiteServiceInitializer#0,org.dspace.core.LoggerServiceImpl#0,propertyPlaceholderConfigurer,dspaceConfigurationFactoryBean,org.dspace.services.CachingService,org.dspace.caching.ehcache.CacheManager,org.dspace.services.SessionService,org.dspace.services.EventService,org.dspace.services.email.EmailServiceImpl,dSpaceServicesFactory,org.dspace.app.itemmarking.ItemMarkingExtractor.type,org.dspace.app.itemmarking.ItemMarkingExtractor.availability,typeMap,collectionMap,rdfFactory,org.dspace.rdf.conversion.SimpleDSORelationsConverterPlugin,org.dspace.rdf.conversion.MetadataConverterPlugin,org.dspace.rdf.conversion.StaticDSOConverterPlugin,org.dspace.rdf.conversion.RDFConverter,org.dspace.rdf.storage.LocalURIGenerator,org.dspace.rdf.storage.HandleURIGenerator,org.dspace.rdf.storage.DOIURIGenerator,org.dspace.rdf.storage.DOIHandleURIGenerator,org.dspace.rdf.storage.RDFStorage,org.dspace.app.requestitem.dao.impl.RequestItemDAOImpl#0,org.dspace.app.util.dao.impl.WebAppDAOImpl#0,org.dspace.authorize.dao.impl.ResourcePolicyDAOImpl#0,org.dspace.checker.dao.impl.ChecksumHistoryDAOImpl#0,org.dspace.checker.dao.impl.ChecksumResultDAOImpl#0,org.dspace.checker.dao.impl.MostRecentChecksumDAOImpl#0,org.dspace.content.dao.impl.CollectionDAOImpl#0,org.dspace.content.dao.impl.BitstreamDAOImpl#0,org.dspace.content.dao.impl.BitstreamFormatDAOImpl#0,org.dspace.content.dao.impl.BundleDAOImpl#0,org.dspace.content.dao.impl.CommunityDAOImpl#0,org.dspace.content.dao.impl.ItemDAOImpl#0,org.dspace.content.dao.impl.MetadataFieldDAOImpl#0,org.dspace.content.dao.impl.MetadataSchemaDAOImpl#0,org.dspace.content.dao.impl.MetadataValueDAOImpl#0,org.dspace.content.dao.impl.SiteDAOImpl#0,org.dspace.content.dao.impl.WorkspaceItemDAOImpl#0,org.dspace.eperson.dao.impl.EPersonDAOImpl#0,org.dspace.eperson.dao.impl.Group2GroupCacheDAOImpl#0,org.dspace.eperson.dao.impl.GroupDAOImpl#0,org.dspace.eperson.dao.impl.RegistrationDataDAOImpl#0,org.dspace.eperson.dao.impl.SubscriptionDAOImpl#0,org.dspace.handle.dao.impl.HandleDAOImpl#0,org.dspace.harvest.dao.impl.HarvestedItemDAOImpl#0,org.dspace.harvest.dao.impl.HarvestedCollectionDAOImpl#0,org.dspace.identifier.dao.impl.DOIDAOImpl#0,org.dspace.versioning.dao.impl.VersionDAOImpl#0,org.dspace.versioning.dao.impl.VersionHistoryDAOImpl#0,org.dspace.workflowbasic.dao.impl.BasicWorkflowItemDAOImpl#0,org.dspace.workflowbasic.dao.impl.TaskListItemDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.ClaimedTaskDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.CollectionRoleDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.InProgressUserDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.PoolTaskDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.WorkflowItemRoleDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.XmlWorkflowItemDAOImpl#0,org.dspace.storage.bitstore.BitstreamStorageService,localStore,s3Store,sessionFactory,dataSource,dspaceDataSource,org.dspace.util.MultiFormatDateParser,claimactionAPI,reviewactionAPI,editactionAPI,finaleditactionAPI,singleuserreviewactionAPI,selectrevieweractionAPI,scorereviewactionAPI,evaluationactionAPI,autoassignactionAPI,noUserSelectionActionAPI,assignoriginalsubmitteractionAPI,reviewaction,editaction,finaleditaction,selectrevieweraction,singleuserreviewaction,scorereviewaction,evaluationaction,claimaction,autoassignAction,noUserSelectionAction,originalSubmitterAssignAction,org.dspace.authority.AuthoritySearchService,dspace.DSpaceAuthorityIndexer,AuthorityTypes,OrcidSource,pubmedMetadataFieldMap,pubmedLanguageContrib,dateContrib,pubmedContrib,titleContrib,abstractContrib,authorContrib,combinedauthorList,lastNameContrib,firstNameContrib,keywordContrib,yearContrib,monthContrib,dayContrib,languageContrib,dc.title,dc.description.abstract,dc.contributor.author,dc.date.issued,dc.language.iso,dc.subject,dc.identifier.other,prefixToNamespaceMapping,maxRetry,pubmedService,requestItemServiceFactory,itemExportServiceFactory,itemImportServiceFactory,mediaFilterServiceFactory,sfxServiceFactory,appUtilServiceFactory,authenticateServiceFactory,authorityServiceFactory,contentAuthorityServiceFactory,authorizeServiceFactory,checkerServiceFactory,contentServiceFactory,coreServiceFactory,curateServiceFactory,disseminateServiceFactory,embargoServiceFactory,ePersonServiceFactory,eventServiceFactory,handleServiceFactory,harvestServiceFactory,identifierServiceFactory,licenseServiceFactory,statisticsServiceFactory,storageServiceFactory,versionServiceFactory,workflowServiceFactory,org.dspace.versioning.service.VersioningService,solrServiceResourceIndexPlugin,SolrServiceSpellIndexingPlugin,solrServiceMetadataBrowseIndexingPlugin,hasContentInOriginalBundle,org.dspace.discovery.configuration.DiscoveryConfigurationService,defaultConfiguration,homepageConfiguration,homepageTagCloudFacetConfiguration,defaultTagCloudFacetConfiguration,tagCloudConfiguration,browseTagCloudConfiguration,searchFilterTitle,searchFilterAuthor,searchFilterSubject,searchFilterIssued,searchFilterContentInOriginalBundle,sortTitle,sortDateIssued,org.dspace.app.requestitem.RequestItemServiceImpl#0,org.dspace.app.itemexport.ItemExportServiceImpl#0,org.dspace.app.itemimport.ItemImportServiceImpl#0,org.dspace.app.mediafilter.MediaFilterServiceImpl#0,org.dspace.app.sfx.SFXFileReaderServiceImpl#0,org.dspace.app.util.MetadataExposureServiceImpl#0,org.dspace.app.util.OpenSearchServiceImpl#0,org.dspace.app.util.WebAppServiceImpl#0,org.dspace.authenticate.AuthenticationServiceImpl#0,org.dspace.authorize.AuthorizeServiceImpl#0,org.dspace.authorize.ResourcePolicyServiceImpl#0,org.dspace.authority.AuthorityValueServiceImpl#0,org.dspace.authority.AuthorityServiceImpl#0,org.dspace.checker.ChecksumHistoryServiceImpl#0,org.dspace.checker.ChecksumResultServiceImpl#0,org.dspace.checker.MostRecentChecksumServiceImpl#0,org.dspace.checker.SimpleReporterServiceImpl#0,org.dspace.content.CollectionServiceImpl#0,org.dspace.content.BitstreamFormatServiceImpl#0,org.dspace.content.BitstreamServiceImpl#0,org.dspace.content.BundleServiceImpl#0,org.dspace.content.CommunityServiceImpl#0,org.dspace.content.InstallItemServiceImpl#0,org.dspace.content.ItemServiceImpl#0,org.dspace.content.MetadataFieldServiceImpl#0,org.dspace.content.MetadataSchemaServiceImpl#0,org.dspace.content.MetadataValueServiceImpl#0,org.dspace.content.SiteServiceImpl#0,org.dspace.content.SupervisedItemServiceImpl#0,org.dspace.content.WorkspaceItemServiceImpl#0,org.dspace.content.authority.ChoiceAuthorityServiceImpl#0,org.dspace.content.authority.MetadataAuthorityServiceImpl#0,org.dspace.core.LegacyPluginServiceImpl#0,org.dspace.core.LicenseServiceImpl#0,org.dspace.core.NewsServiceImpl#0,org.dspace.curate.WorkflowCuratorServiceImpl#0,org.dspace.disseminate.CitationDocumentServiceImpl#0,org.dspace.embargo.EmbargoServiceImpl#0,org.dspace.eperson.AccountServiceImpl#0,org.dspace.eperson.EPersonServiceImpl#0,org.dspace.eperson.GroupServiceImpl#0,org.dspace.eperson.RegistrationDataServiceImpl#0,org.dspace.eperson.SubscribeServiceImpl#0,org.dspace.eperson.SupervisorServiceImpl#0,org.dspace.event.EventServiceImpl#0,org.dspace.handle.HandleServiceImpl#0,org.dspace.harvest.HarvestedCollectionServiceImpl#0,org.dspace.harvest.HarvestedItemServiceImpl#0,org.dspace.harvest.HarvestSchedulingServiceImpl#0,org.dspace.identifier.DOIServiceImpl#0,org.dspace.license.CreativeCommonsServiceImpl#0,elasticSearchLoggerService,solrLoggerService,org.dspace.versioning.VersionHistoryServiceImpl#0,org.dspace.workflowbasic.TaskListItemServiceImpl#0,org.dspace.workflowbasic.BasicWorkflowItemServiceImpl#0,org.dspace.workflowbasic.BasicWorkflowServiceImpl#0,org.dspace.app.itemimport.BTEBatchImportService,batchImportTransformationEngine,batchImportLinearWorkflow,org.dspace.submit.lookup.SubmissionLookupService,phase1TransformationEngine,multipleDataLoader,org.dspace.submit.lookup.SubmissionLookupOutputGenerator,phase1LinearWorkflow,mapConverter_arxivSubject,mapConverter_pubstatusPubmed,removeLastDot,phase2TransformationEngine,submissionItemDataLoader,phase2linearWorkflow,fieldMergeModifier,valueConcatenationModifier,languageCodeModifier,org.dspace.submit.lookup.DSpaceWorkspaceItemOutputGenerator,bibTeXDataLoader,csvDataLoader,tsvDataLoader,risDataLoader,endnoteDataLoader,oaipmhDataLoader,pubmedOnlineDataLoader,pubmedFileDataLoader,pubmedInputMap,arXivOnlineDataLoader,arXivFileDataLoader,arxivInputMap,crossRefOnlineDataLoader,crossRefFileDataLoader,crossrefInputMap,ciniiOnlineDataLoader,ciniiFileDataLoader,ciniiInputMap,outputMap,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy [java] 2016-06-08 10:58:34,755 INFO org.dspace.services.caching.CachingServiceImpl @ destroy() [java] 2016-06-08 10:58:34,756 INFO org.springframework.cache.ehcache.EhCacheManagerFactoryBean @ Shutting down EhCache CacheManager [java] 2016-06-08 10:58:34,756 INFO org.dspace.services.sessions.SessionRequestServiceImpl @ shutdown [java] 2016-06-08 10:58:34,757 WARN org.dspace.services.sessions.SessionRequestServiceImpl @ Request interceptor (org.dspace.services.events.SystemEventService$EventRequestInterceptor@5e31b483) failed to execute on end (request-192-1465397914139): null [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.spring.SpringServiceManager @ Spring Service Manager Shutdown... [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.DSpaceServiceManager @ Shutdown DSpace core service manager [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.DSpaceKernelImpl @ DSpace kernel shutdown completed and unregistered MBean: org.dspace:name=4d54a5c6-70bc-4aab-8929-f6632b4c0458,type=DSpaceKernel BUILD FAILED /var/data/dspace_local_build/dspace6x-aux-prs/DSpace/dspace/target/dspace-installer/build.xml:802: Java returned: 1 ------------------------------------ *2. Confirm migration failure* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database info Database Type: postgres Database URL: jdbc:postgresql://localhost:5432/dspace Database Schema: public Database Software: PostgreSQL version 9.4.8 Database Driver: PostgreSQL Native Driver version PostgreSQL 9.4 JDBC4.1 (build 1206) PostgreSQL 'pgcrypto' extension installed/up-to-date? true (version=1.1) +----------------+--------------------------------------------------+---------------------+---------+ | Version | Description | Installed on | State | +----------------+--------------------------------------------------+---------------------+---------+ | 1 | << Flyway Init >> | 2016-04-21 10:16:52 | Baselin | | 1.1 | Initial DSpace 1.1 database schema | 2016-04-21 10:16:52 | Success | | 1.2 | Upgrade to DSpace 1.2 schema | 2016-04-21 10:16:53 | Success | | 1.3 | Upgrade to DSpace 1.3 schema | 2016-04-21 10:16:53 | Success | | 1.3.9 | Drop constraint for DSpace 1 4 schema | 2016-04-21 10:16:53 | Success | | 1.4 | Upgrade to DSpace 1.4 schema | 2016-04-21 10:16:53 | Success | | 1.5 | Upgrade to DSpace 1.5 schema | 2016-04-21 10:16:54 | Success | | 1.5.9 | Drop constraint for DSpace 1 6 schema | 2016-04-21 10:16:54 | Success | | 1.6 | Upgrade to DSpace 1.6 schema | 2016-04-21 10:16:54 | Success | | 1.7 | Upgrade to DSpace 1.7 schema | 2016-04-21 10:16:54 | Success | | 1.8 | Upgrade to DSpace 1.8 schema | 2016-04-21 10:16:54 | Success | | 3.0 | Upgrade to DSpace 3.x schema | 2016-04-21 10:16:54 | Success | | 4.0 | Upgrade to DSpace 4.x schema | 2016-04-21 10:16:54 | Success | | 4.9.2015.10.26 | DS-2818 registry update | | Ignored | | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 2016-04-21 10:16:54 | Success | | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint | 2016-04-21 10:16:54 | Success | | 5.0.2014.09.26 | DS-1582 Metadata For All Objects | 2016-04-21 10:16:54 | Success | | 6.0.2015.03.06 | DS 2701 Dso Uuid Migration | | Pending | | 6.0.2015.03.07 | DS-2701 Hibernate migration | | Pending | | 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration | | Pending | | 6.0.2016.01.03 | DS-3024 | | Pending | | 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables | | Pending | | 6.0.2016.02.25 | DS-3004-slow-searching-as-admin | | Pending | | 6.0.2016.04.01 | DS-1955 Increase embargo reason | | Pending | | 6.0.2016.04.04 | DS-3086-OAI-Performance-fix | | Pending | | 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights | | Pending | | 6.0.2016.05.10 | DS-3168-fix-requestitem item id column | | Pending | +----------------+--------------------------------------------------+---------------------+---------+ *3. database migrate fails* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database migrate Database URL: jdbc:postgresql://localhost:5432/dspace 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:570) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:478) at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 1.1 -> Applied to database : 864087011 -> Resolved locally : 1058944165 at org.flywaydb.core.Flyway.doValidate(Flyway.java:1108) at org.flywaydb.core.Flyway.access$300(Flyway.java:62) at org.flywaydb.core.Flyway$1.execute(Flyway.java:1012) at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) at org.flywaydb.core.Flyway.execute(Flyway.java:1418) at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:559) ... 8 more *4. Run database repair* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database repair Database URL: jdbc:postgresql://localhost:5432/dspace Attempting to repair any previously failed migrations (or mismatched checksums) via FlywayDB... (Check dspace logs for details) Done. ----------------------------------------------------------- *5. Run database migrate - successful* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database migrate Database URL: jdbc:postgresql://localhost:5432/dspace Migrating database to latest version... (Check dspace logs for details) Done. [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database info Database Type: postgres Database URL: jdbc:postgresql://localhost:5432/dspace Database Schema: public Database Software: PostgreSQL version 9.4.8 Database Driver: PostgreSQL Native Driver version PostgreSQL 9.4 JDBC4.1 (build 1206) PostgreSQL 'pgcrypto' extension installed/up-to-date? true (version=1.1) +----------------+--------------------------------------------------+---------------------+---------+ | Version | Description | Installed on | State | +----------------+--------------------------------------------------+---------------------+---------+ | 1 | << Flyway Init >> | 2016-04-21 10:16:52 | Baselin | | 1.1 | Initial DSpace 1.1 database schema | 2016-04-21 10:16:52 | Success | | 1.2 | Upgrade to DSpace 1.2 schema | 2016-04-21 10:16:53 | Success | | 1.3 | Upgrade to DSpace 1.3 schema | 2016-04-21 10:16:53 | Success | | 1.3.9 | Drop constraint for DSpace 1 4 schema | 2016-04-21 10:16:53 | Success | | 1.4 | Upgrade to DSpace 1.4 schema | 2016-04-21 10:16:53 | Success | | 1.5 | Upgrade to DSpace 1.5 schema | 2016-04-21 10:16:54 | Success | | 1.5.9 | Drop constraint for DSpace 1 6 schema | 2016-04-21 10:16:54 | Success | | 1.6 | Upgrade to DSpace 1.6 schema | 2016-04-21 10:16:54 | Success | | 1.7 | Upgrade to DSpace 1.7 schema | 2016-04-21 10:16:54 | Success | | 1.8 | Upgrade to DSpace 1.8 schema | 2016-04-21 10:16:54 | Success | | 3.0 | Upgrade to DSpace 3.x schema | 2016-04-21 10:16:54 | Success | | 4.0 | Upgrade to DSpace 4.x schema | 2016-04-21 10:16:54 | Success | | 4.9.2015.10.26 | DS-2818 registry update | 2016-06-08 11:02:39 | OutOrdr | | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 2016-04-21 10:16:54 | OutOrdr | | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint | 2016-04-21 10:16:54 | OutOrdr | | 5.0.2014.09.26 | DS-1582 Metadata For All Objects | 2016-04-21 10:16:54 | OutOrdr | | 6.0.2015.03.06 | DS 2701 Dso Uuid Migration | 2016-06-08 11:02:39 | Success | | 6.0.2015.03.07 | DS-2701 Hibernate migration | 2016-06-08 11:02:39 | Success | | 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration | 2016-06-08 11:02:46 | Success | | 6.0.2016.01.03 | DS-3024 | 2016-06-08 11:02:46 | Success | | 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables | 2016-06-08 11:02:46 | Success | | 6.0.2016.02.25 | DS-3004-slow-searching-as-admin | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.01 | DS-1955 Increase embargo reason | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.04 | DS-3086-OAI-Performance-fix | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights | 2016-06-08 11:02:46 | Success | | 6.0.2016.05.10 | DS-3168-fix-requestitem item id column | 2016-06-08 11:02:46 | Success | +----------------+--------------------------------------------------+---------------------+---------+

    Sakai JIRA | 6 months ago | Terry Brady
    java.sql.SQLException: Flyway migration error occurred
  2. 0

    I refreshed my DSpace 6 database with the contents of a DSpace 5 database in order to test the DSpace 6 upgrade process. 1. The migration launched by ant fails 2. I confirmed the error by running "dspace database info" 3. "dspace database migrate" fails 4. I ran "dpsace database repair" 5. I ran "dspace database migrate" successfully This behavior could be very distressing to institutions running the upgrade process. *1.Migration launched by ANT* [java] 2016-06-08 10:58:34,451 INFO org.dspace.storage.rdbms.DatabaseUtils @ Loading Flyway DB migrations from: filesystem:/opt/dspace/etc/postgres, classpath:org.dspace.storage.rdbms.sqlmigration.postgres, classpath:org.dspace.storage.rdbms.migration [java] [java] Database URL: jdbc:postgresql://localhost:5432/dspace [java] Migrating database to latest version... (Check dspace logs for details) [java] 2016-06-08 10:58:34,486 INFO org.flywaydb.core.internal.util.VersionPrinter @ Flyway 3.2.1 by Boxfuse [java] 2016-06-08 10:58:34,514 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory @ Database: jdbc:postgresql://localhost:5432/dspace (PostgreSQL 9.4) [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ Pending DSpace database schema migrations: [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 4.9.2015.10.26 DS-2818 registry update SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.03.06 DS 2701 Dso Uuid Migration JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.03.07 DS-2701 Hibernate migration SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2015.08.31 DS 2701 Hibernate Workflow Migration JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.01.03 DS-3024 SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.01.26 DS 2188 Remove DBMS Browse Tables JDBC PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.02.25 DS-3004-slow-searching-as-admin SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.01 DS-1955 Increase embargo reason SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.04 DS-3086-OAI-Performance-fix SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.04.14 DS-3125-fix-bundle-bitstream-delete-rights SQL PENDING [java] 2016-06-08 10:58:34,676 INFO org.dspace.storage.rdbms.DatabaseUtils @ 6.0.2016.05.10 DS-3168-fix-requestitem item id column SQL PENDING [java] 2016-06-08 10:58:34,725 INFO org.flywaydb.core.internal.command.DbValidate @ Validated 27 migrations (execution time 00:00.045s) [java] Migration exception: [java] java.sql.SQLException: Flyway migration error occurred [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:570) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:478) [java] at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:260) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java] at java.lang.reflect.Method.invoke(Method.java:606) [java] at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) [java] at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) [java] Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 1.1 [java] -> Applied to database : 864087011 [java] -> Resolved locally : 1058944165 [java] at org.flywaydb.core.Flyway.doValidate(Flyway.java:1108) [java] at org.flywaydb.core.Flyway.access$300(Flyway.java:62) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1012) [java] at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) [java] at org.flywaydb.core.Flyway.execute(Flyway.java:1418) [java] at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) [java] at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:559) [java] ... 8 more [java] 2016-06-08 10:58:34,727 INFO org.springframework.context.support.ClassPathXmlApplicationContext @ Closing org.springframework.context.support.ClassPathXmlApplicationContext@3822307d: startup date [Wed Jun 08 10:58:30 EDT 2016]; root of context hierarchy [java] 2016-06-08 10:58:34,734 INFO org.springframework.beans.factory.support.DefaultListableBeanFactory @ Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12fd41e0: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.dspace.servicemanager.spring.DSpaceBeanPostProcessor#0,org.dspace.example.Example,org.dspace.app.sherpa.submit.SHERPASubmitConfigurationService,importService,PubmedImportService,PubmedMetadataFieldMapping,lookupID,org.dspace.app.requestitem.RequestItemAuthorExtractor,org.dspace.app.sherpa.SHERPAService,org.dspace.app.sherpa.submit.SHERPASubmitService,org.dspace.discovery.SearchService,org.dspace.identifier.service.IdentifierService,org.dspace.identifier.VersionedHandleIdentifierProvider,org.dspace.core.DBConnection,org.dspace.storage.rdbms.DatabaseRegistryUpdater#0,org.dspace.storage.rdbms.GroupServiceInitializer#0,org.dspace.storage.rdbms.PostgreSQLCryptoChecker#0,org.dspace.storage.rdbms.SiteServiceInitializer#0,org.dspace.core.LoggerServiceImpl#0,propertyPlaceholderConfigurer,dspaceConfigurationFactoryBean,org.dspace.services.CachingService,org.dspace.caching.ehcache.CacheManager,org.dspace.services.SessionService,org.dspace.services.EventService,org.dspace.services.email.EmailServiceImpl,dSpaceServicesFactory,org.dspace.app.itemmarking.ItemMarkingExtractor.type,org.dspace.app.itemmarking.ItemMarkingExtractor.availability,typeMap,collectionMap,rdfFactory,org.dspace.rdf.conversion.SimpleDSORelationsConverterPlugin,org.dspace.rdf.conversion.MetadataConverterPlugin,org.dspace.rdf.conversion.StaticDSOConverterPlugin,org.dspace.rdf.conversion.RDFConverter,org.dspace.rdf.storage.LocalURIGenerator,org.dspace.rdf.storage.HandleURIGenerator,org.dspace.rdf.storage.DOIURIGenerator,org.dspace.rdf.storage.DOIHandleURIGenerator,org.dspace.rdf.storage.RDFStorage,org.dspace.app.requestitem.dao.impl.RequestItemDAOImpl#0,org.dspace.app.util.dao.impl.WebAppDAOImpl#0,org.dspace.authorize.dao.impl.ResourcePolicyDAOImpl#0,org.dspace.checker.dao.impl.ChecksumHistoryDAOImpl#0,org.dspace.checker.dao.impl.ChecksumResultDAOImpl#0,org.dspace.checker.dao.impl.MostRecentChecksumDAOImpl#0,org.dspace.content.dao.impl.CollectionDAOImpl#0,org.dspace.content.dao.impl.BitstreamDAOImpl#0,org.dspace.content.dao.impl.BitstreamFormatDAOImpl#0,org.dspace.content.dao.impl.BundleDAOImpl#0,org.dspace.content.dao.impl.CommunityDAOImpl#0,org.dspace.content.dao.impl.ItemDAOImpl#0,org.dspace.content.dao.impl.MetadataFieldDAOImpl#0,org.dspace.content.dao.impl.MetadataSchemaDAOImpl#0,org.dspace.content.dao.impl.MetadataValueDAOImpl#0,org.dspace.content.dao.impl.SiteDAOImpl#0,org.dspace.content.dao.impl.WorkspaceItemDAOImpl#0,org.dspace.eperson.dao.impl.EPersonDAOImpl#0,org.dspace.eperson.dao.impl.Group2GroupCacheDAOImpl#0,org.dspace.eperson.dao.impl.GroupDAOImpl#0,org.dspace.eperson.dao.impl.RegistrationDataDAOImpl#0,org.dspace.eperson.dao.impl.SubscriptionDAOImpl#0,org.dspace.handle.dao.impl.HandleDAOImpl#0,org.dspace.harvest.dao.impl.HarvestedItemDAOImpl#0,org.dspace.harvest.dao.impl.HarvestedCollectionDAOImpl#0,org.dspace.identifier.dao.impl.DOIDAOImpl#0,org.dspace.versioning.dao.impl.VersionDAOImpl#0,org.dspace.versioning.dao.impl.VersionHistoryDAOImpl#0,org.dspace.workflowbasic.dao.impl.BasicWorkflowItemDAOImpl#0,org.dspace.workflowbasic.dao.impl.TaskListItemDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.ClaimedTaskDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.CollectionRoleDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.InProgressUserDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.PoolTaskDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.WorkflowItemRoleDAOImpl#0,org.dspace.xmlworkflow.storedcomponents.dao.impl.XmlWorkflowItemDAOImpl#0,org.dspace.storage.bitstore.BitstreamStorageService,localStore,s3Store,sessionFactory,dataSource,dspaceDataSource,org.dspace.util.MultiFormatDateParser,claimactionAPI,reviewactionAPI,editactionAPI,finaleditactionAPI,singleuserreviewactionAPI,selectrevieweractionAPI,scorereviewactionAPI,evaluationactionAPI,autoassignactionAPI,noUserSelectionActionAPI,assignoriginalsubmitteractionAPI,reviewaction,editaction,finaleditaction,selectrevieweraction,singleuserreviewaction,scorereviewaction,evaluationaction,claimaction,autoassignAction,noUserSelectionAction,originalSubmitterAssignAction,org.dspace.authority.AuthoritySearchService,dspace.DSpaceAuthorityIndexer,AuthorityTypes,OrcidSource,pubmedMetadataFieldMap,pubmedLanguageContrib,dateContrib,pubmedContrib,titleContrib,abstractContrib,authorContrib,combinedauthorList,lastNameContrib,firstNameContrib,keywordContrib,yearContrib,monthContrib,dayContrib,languageContrib,dc.title,dc.description.abstract,dc.contributor.author,dc.date.issued,dc.language.iso,dc.subject,dc.identifier.other,prefixToNamespaceMapping,maxRetry,pubmedService,requestItemServiceFactory,itemExportServiceFactory,itemImportServiceFactory,mediaFilterServiceFactory,sfxServiceFactory,appUtilServiceFactory,authenticateServiceFactory,authorityServiceFactory,contentAuthorityServiceFactory,authorizeServiceFactory,checkerServiceFactory,contentServiceFactory,coreServiceFactory,curateServiceFactory,disseminateServiceFactory,embargoServiceFactory,ePersonServiceFactory,eventServiceFactory,handleServiceFactory,harvestServiceFactory,identifierServiceFactory,licenseServiceFactory,statisticsServiceFactory,storageServiceFactory,versionServiceFactory,workflowServiceFactory,org.dspace.versioning.service.VersioningService,solrServiceResourceIndexPlugin,SolrServiceSpellIndexingPlugin,solrServiceMetadataBrowseIndexingPlugin,hasContentInOriginalBundle,org.dspace.discovery.configuration.DiscoveryConfigurationService,defaultConfiguration,homepageConfiguration,homepageTagCloudFacetConfiguration,defaultTagCloudFacetConfiguration,tagCloudConfiguration,browseTagCloudConfiguration,searchFilterTitle,searchFilterAuthor,searchFilterSubject,searchFilterIssued,searchFilterContentInOriginalBundle,sortTitle,sortDateIssued,org.dspace.app.requestitem.RequestItemServiceImpl#0,org.dspace.app.itemexport.ItemExportServiceImpl#0,org.dspace.app.itemimport.ItemImportServiceImpl#0,org.dspace.app.mediafilter.MediaFilterServiceImpl#0,org.dspace.app.sfx.SFXFileReaderServiceImpl#0,org.dspace.app.util.MetadataExposureServiceImpl#0,org.dspace.app.util.OpenSearchServiceImpl#0,org.dspace.app.util.WebAppServiceImpl#0,org.dspace.authenticate.AuthenticationServiceImpl#0,org.dspace.authorize.AuthorizeServiceImpl#0,org.dspace.authorize.ResourcePolicyServiceImpl#0,org.dspace.authority.AuthorityValueServiceImpl#0,org.dspace.authority.AuthorityServiceImpl#0,org.dspace.checker.ChecksumHistoryServiceImpl#0,org.dspace.checker.ChecksumResultServiceImpl#0,org.dspace.checker.MostRecentChecksumServiceImpl#0,org.dspace.checker.SimpleReporterServiceImpl#0,org.dspace.content.CollectionServiceImpl#0,org.dspace.content.BitstreamFormatServiceImpl#0,org.dspace.content.BitstreamServiceImpl#0,org.dspace.content.BundleServiceImpl#0,org.dspace.content.CommunityServiceImpl#0,org.dspace.content.InstallItemServiceImpl#0,org.dspace.content.ItemServiceImpl#0,org.dspace.content.MetadataFieldServiceImpl#0,org.dspace.content.MetadataSchemaServiceImpl#0,org.dspace.content.MetadataValueServiceImpl#0,org.dspace.content.SiteServiceImpl#0,org.dspace.content.SupervisedItemServiceImpl#0,org.dspace.content.WorkspaceItemServiceImpl#0,org.dspace.content.authority.ChoiceAuthorityServiceImpl#0,org.dspace.content.authority.MetadataAuthorityServiceImpl#0,org.dspace.core.LegacyPluginServiceImpl#0,org.dspace.core.LicenseServiceImpl#0,org.dspace.core.NewsServiceImpl#0,org.dspace.curate.WorkflowCuratorServiceImpl#0,org.dspace.disseminate.CitationDocumentServiceImpl#0,org.dspace.embargo.EmbargoServiceImpl#0,org.dspace.eperson.AccountServiceImpl#0,org.dspace.eperson.EPersonServiceImpl#0,org.dspace.eperson.GroupServiceImpl#0,org.dspace.eperson.RegistrationDataServiceImpl#0,org.dspace.eperson.SubscribeServiceImpl#0,org.dspace.eperson.SupervisorServiceImpl#0,org.dspace.event.EventServiceImpl#0,org.dspace.handle.HandleServiceImpl#0,org.dspace.harvest.HarvestedCollectionServiceImpl#0,org.dspace.harvest.HarvestedItemServiceImpl#0,org.dspace.harvest.HarvestSchedulingServiceImpl#0,org.dspace.identifier.DOIServiceImpl#0,org.dspace.license.CreativeCommonsServiceImpl#0,elasticSearchLoggerService,solrLoggerService,org.dspace.versioning.VersionHistoryServiceImpl#0,org.dspace.workflowbasic.TaskListItemServiceImpl#0,org.dspace.workflowbasic.BasicWorkflowItemServiceImpl#0,org.dspace.workflowbasic.BasicWorkflowServiceImpl#0,org.dspace.app.itemimport.BTEBatchImportService,batchImportTransformationEngine,batchImportLinearWorkflow,org.dspace.submit.lookup.SubmissionLookupService,phase1TransformationEngine,multipleDataLoader,org.dspace.submit.lookup.SubmissionLookupOutputGenerator,phase1LinearWorkflow,mapConverter_arxivSubject,mapConverter_pubstatusPubmed,removeLastDot,phase2TransformationEngine,submissionItemDataLoader,phase2linearWorkflow,fieldMergeModifier,valueConcatenationModifier,languageCodeModifier,org.dspace.submit.lookup.DSpaceWorkspaceItemOutputGenerator,bibTeXDataLoader,csvDataLoader,tsvDataLoader,risDataLoader,endnoteDataLoader,oaipmhDataLoader,pubmedOnlineDataLoader,pubmedFileDataLoader,pubmedInputMap,arXivOnlineDataLoader,arXivFileDataLoader,arxivInputMap,crossRefOnlineDataLoader,crossRefFileDataLoader,crossrefInputMap,ciniiOnlineDataLoader,ciniiFileDataLoader,ciniiInputMap,outputMap,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy [java] 2016-06-08 10:58:34,755 INFO org.dspace.services.caching.CachingServiceImpl @ destroy() [java] 2016-06-08 10:58:34,756 INFO org.springframework.cache.ehcache.EhCacheManagerFactoryBean @ Shutting down EhCache CacheManager [java] 2016-06-08 10:58:34,756 INFO org.dspace.services.sessions.SessionRequestServiceImpl @ shutdown [java] 2016-06-08 10:58:34,757 WARN org.dspace.services.sessions.SessionRequestServiceImpl @ Request interceptor (org.dspace.services.events.SystemEventService$EventRequestInterceptor@5e31b483) failed to execute on end (request-192-1465397914139): null [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.spring.SpringServiceManager @ Spring Service Manager Shutdown... [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.DSpaceServiceManager @ Shutdown DSpace core service manager [java] 2016-06-08 10:58:34,778 INFO org.dspace.servicemanager.DSpaceKernelImpl @ DSpace kernel shutdown completed and unregistered MBean: org.dspace:name=4d54a5c6-70bc-4aab-8929-f6632b4c0458,type=DSpaceKernel BUILD FAILED /var/data/dspace_local_build/dspace6x-aux-prs/DSpace/dspace/target/dspace-installer/build.xml:802: Java returned: 1 ------------------------------------ *2. Confirm migration failure* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database info Database Type: postgres Database URL: jdbc:postgresql://localhost:5432/dspace Database Schema: public Database Software: PostgreSQL version 9.4.8 Database Driver: PostgreSQL Native Driver version PostgreSQL 9.4 JDBC4.1 (build 1206) PostgreSQL 'pgcrypto' extension installed/up-to-date? true (version=1.1) +----------------+--------------------------------------------------+---------------------+---------+ | Version | Description | Installed on | State | +----------------+--------------------------------------------------+---------------------+---------+ | 1 | << Flyway Init >> | 2016-04-21 10:16:52 | Baselin | | 1.1 | Initial DSpace 1.1 database schema | 2016-04-21 10:16:52 | Success | | 1.2 | Upgrade to DSpace 1.2 schema | 2016-04-21 10:16:53 | Success | | 1.3 | Upgrade to DSpace 1.3 schema | 2016-04-21 10:16:53 | Success | | 1.3.9 | Drop constraint for DSpace 1 4 schema | 2016-04-21 10:16:53 | Success | | 1.4 | Upgrade to DSpace 1.4 schema | 2016-04-21 10:16:53 | Success | | 1.5 | Upgrade to DSpace 1.5 schema | 2016-04-21 10:16:54 | Success | | 1.5.9 | Drop constraint for DSpace 1 6 schema | 2016-04-21 10:16:54 | Success | | 1.6 | Upgrade to DSpace 1.6 schema | 2016-04-21 10:16:54 | Success | | 1.7 | Upgrade to DSpace 1.7 schema | 2016-04-21 10:16:54 | Success | | 1.8 | Upgrade to DSpace 1.8 schema | 2016-04-21 10:16:54 | Success | | 3.0 | Upgrade to DSpace 3.x schema | 2016-04-21 10:16:54 | Success | | 4.0 | Upgrade to DSpace 4.x schema | 2016-04-21 10:16:54 | Success | | 4.9.2015.10.26 | DS-2818 registry update | | Ignored | | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 2016-04-21 10:16:54 | Success | | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint | 2016-04-21 10:16:54 | Success | | 5.0.2014.09.26 | DS-1582 Metadata For All Objects | 2016-04-21 10:16:54 | Success | | 6.0.2015.03.06 | DS 2701 Dso Uuid Migration | | Pending | | 6.0.2015.03.07 | DS-2701 Hibernate migration | | Pending | | 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration | | Pending | | 6.0.2016.01.03 | DS-3024 | | Pending | | 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables | | Pending | | 6.0.2016.02.25 | DS-3004-slow-searching-as-admin | | Pending | | 6.0.2016.04.01 | DS-1955 Increase embargo reason | | Pending | | 6.0.2016.04.04 | DS-3086-OAI-Performance-fix | | Pending | | 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights | | Pending | | 6.0.2016.05.10 | DS-3168-fix-requestitem item id column | | Pending | +----------------+--------------------------------------------------+---------------------+---------+ *3. database migrate fails* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database migrate Database URL: jdbc:postgresql://localhost:5432/dspace 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:570) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:478) at org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 1.1 -> Applied to database : 864087011 -> Resolved locally : 1058944165 at org.flywaydb.core.Flyway.doValidate(Flyway.java:1108) at org.flywaydb.core.Flyway.access$300(Flyway.java:62) at org.flywaydb.core.Flyway$1.execute(Flyway.java:1012) at org.flywaydb.core.Flyway$1.execute(Flyway.java:1006) at org.flywaydb.core.Flyway.execute(Flyway.java:1418) at org.flywaydb.core.Flyway.migrate(Flyway.java:1006) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:559) ... 8 more *4. Run database repair* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database repair Database URL: jdbc:postgresql://localhost:5432/dspace Attempting to repair any previously failed migrations (or mismatched checksums) via FlywayDB... (Check dspace logs for details) Done. ----------------------------------------------------------- *5. Run database migrate - successful* [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database migrate Database URL: jdbc:postgresql://localhost:5432/dspace Migrating database to latest version... (Check dspace logs for details) Done. [dspace@dspace-aux-1 dspace6x-aux-prs]$ /opt/dspace/bin/dspace database info Database Type: postgres Database URL: jdbc:postgresql://localhost:5432/dspace Database Schema: public Database Software: PostgreSQL version 9.4.8 Database Driver: PostgreSQL Native Driver version PostgreSQL 9.4 JDBC4.1 (build 1206) PostgreSQL 'pgcrypto' extension installed/up-to-date? true (version=1.1) +----------------+--------------------------------------------------+---------------------+---------+ | Version | Description | Installed on | State | +----------------+--------------------------------------------------+---------------------+---------+ | 1 | << Flyway Init >> | 2016-04-21 10:16:52 | Baselin | | 1.1 | Initial DSpace 1.1 database schema | 2016-04-21 10:16:52 | Success | | 1.2 | Upgrade to DSpace 1.2 schema | 2016-04-21 10:16:53 | Success | | 1.3 | Upgrade to DSpace 1.3 schema | 2016-04-21 10:16:53 | Success | | 1.3.9 | Drop constraint for DSpace 1 4 schema | 2016-04-21 10:16:53 | Success | | 1.4 | Upgrade to DSpace 1.4 schema | 2016-04-21 10:16:53 | Success | | 1.5 | Upgrade to DSpace 1.5 schema | 2016-04-21 10:16:54 | Success | | 1.5.9 | Drop constraint for DSpace 1 6 schema | 2016-04-21 10:16:54 | Success | | 1.6 | Upgrade to DSpace 1.6 schema | 2016-04-21 10:16:54 | Success | | 1.7 | Upgrade to DSpace 1.7 schema | 2016-04-21 10:16:54 | Success | | 1.8 | Upgrade to DSpace 1.8 schema | 2016-04-21 10:16:54 | Success | | 3.0 | Upgrade to DSpace 3.x schema | 2016-04-21 10:16:54 | Success | | 4.0 | Upgrade to DSpace 4.x schema | 2016-04-21 10:16:54 | Success | | 4.9.2015.10.26 | DS-2818 registry update | 2016-06-08 11:02:39 | OutOrdr | | 5.0.2014.08.08 | DS-1945 Helpdesk Request a Copy | 2016-04-21 10:16:54 | OutOrdr | | 5.0.2014.09.25 | DS 1582 Metadata For All Objects drop constraint | 2016-04-21 10:16:54 | OutOrdr | | 5.0.2014.09.26 | DS-1582 Metadata For All Objects | 2016-04-21 10:16:54 | OutOrdr | | 6.0.2015.03.06 | DS 2701 Dso Uuid Migration | 2016-06-08 11:02:39 | Success | | 6.0.2015.03.07 | DS-2701 Hibernate migration | 2016-06-08 11:02:39 | Success | | 6.0.2015.08.31 | DS 2701 Hibernate Workflow Migration | 2016-06-08 11:02:46 | Success | | 6.0.2016.01.03 | DS-3024 | 2016-06-08 11:02:46 | Success | | 6.0.2016.01.26 | DS 2188 Remove DBMS Browse Tables | 2016-06-08 11:02:46 | Success | | 6.0.2016.02.25 | DS-3004-slow-searching-as-admin | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.01 | DS-1955 Increase embargo reason | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.04 | DS-3086-OAI-Performance-fix | 2016-06-08 11:02:46 | Success | | 6.0.2016.04.14 | DS-3125-fix-bundle-bitstream-delete-rights | 2016-06-08 11:02:46 | Success | | 6.0.2016.05.10 | DS-3168-fix-requestitem item id column | 2016-06-08 11:02:46 | Success | +----------------+--------------------------------------------------+---------------------+---------+

    Sakai JIRA | 6 months ago | Terry Brady
    java.sql.SQLException: Flyway migration error occurred
  3. 0

    Flyway migration error

    Google Groups | 2 months ago | Bill T
    java.sql.SQLException: Flyway migration error occurred
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 204#221189502

    GitHub | 7 months ago | WimVerhaert
    org.flywaydb.core.api.FlywayException: Validate failed. Migration Description mismatch for migration 1.01.05 -> Applied to database : SNAPSHOT -> Resolved locally : 0 0 3 alpha1
  6. 0

    Detected resolved migration not applied to database

    GitHub | 2 years ago | neblina-software
    org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.flywaydb.core.api.FlywayException

    Validate failed. Migration Checksum mismatch for migration 1.1 -> Applied to database : 864087011 -> Resolved locally : 1058944165

    at org.flywaydb.core.Flyway.doValidate()
  2. ${project.artifactId}
    Flyway.migrate
    1. org.flywaydb.core.Flyway.doValidate(Flyway.java:1108)
    2. org.flywaydb.core.Flyway.access$300(Flyway.java:62)
    3. org.flywaydb.core.Flyway$1.execute(Flyway.java:1012)
    4. org.flywaydb.core.Flyway$1.execute(Flyway.java:1006)
    5. org.flywaydb.core.Flyway.execute(Flyway.java:1418)
    6. org.flywaydb.core.Flyway.migrate(Flyway.java:1006)
    6 frames
  3. DSpace Kernel :: API and Implementation
    DatabaseUtils.main
    1. org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:559)
    2. org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:478)
    3. org.dspace.storage.rdbms.DatabaseUtils.main(DatabaseUtils.java:260)
    3 frames
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  5. DSpace Kernel :: API and Implementation
    ScriptLauncher.main
    1. org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
    2. org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
    2 frames