Detected resolved migration not applied to database: 2.36.10 - Upgrade failed

Hi All,

I was trying to upgrade DHIS2 application from version 2.35.10 to 2.37.2 as by following below mentioned order.

  1. Upgraded from version 2.35.10 to version 2.35.11

This upgrade was successful.

  1. Upgraded from version 2.35.11 to version 2.36.7

This upgrade was successful.

  1. Upgraded from version 2.36.7 to version 2.37.2

This upgrade was not successful. Got error as stated below

Detected resolved migration not applied to database: 2.36.10. To ignore this migration, set ignoreIgnoredMigrations to true. To allow executing this migration, set outOfOrder to true.
(AbstractApplicationContext.java [localhost-startStop-1])

  • ERROR 2022-01-19T22:24:51,680 Context initialization failed (ContextLoader.java [localhost-startStop-1])
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘webMvcConfig’: Unsatisfied dependency expressed through field ‘userSettingService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.user.UserSettingService’ defined in URL [jar:file:/opt/upgrade/webapps/ROOT/WEB-INF/lib/dhis-service-core-2.37.2.jar!/org/hisp/dhis/user/DefaultUserSettingService.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.user.UserSettingStore’ defined in URL [jar:file:/opt/upgrade/webapps/ROOT/WEB-INF/lib/dhis-service-core-2.37.2.jar!/org/hisp/dhis/user/hibernate/HibernateUserSettingStore.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘flyway’ defined in class path resource [org/hisp/dhis/db/migration/config/FlywayConfig.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Validate failed:
    Detected resolved migration not applied to database: 2.36.10. To ignore this migration, set ignoreIgnoredMigrations to true. To allow executing this migration, set outOfOrder to true.```

Can any help on this?

Thank you

Regards,
DHIS2 Community Member

@coolsinghbro upgrading from v2.30 and above doesn’t require a version-to-version upgrade. Please try to start from your original database 2.35.10 and upgrade immediately to 2.37.2. If you still face an issue please let me know.

Another reminder please, make sure you follow the instructions in the docs: Upgrading - DHIS2 Documentation

Thanks!

@Gassim thanks for the quick help.
It worked but somehow we faced error as stated below in the logs.

Message    : ERROR: column psuga.programid does not exist
  Hint: Perhaps you meant to reference the column "ps.programid".
  Position: 197
 (AbstractApplicationContext.java [localhost-startStop-1])
 * ERROR 2022-01-20T14:36:56,191 
Context initialization failed (ContextLoader.java [localhost-startStop-1])
 org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'webMvcConfig': 
Unsatisfied dependency expressed through field

After altering table by below command, then we are able to upgrade.

ALTER TABLE programstageusergroupaccesses RENAME COLUMN programstageid to programid;

1 Like

Thank you @coolsinghbro! This seems to be the same issue as in this topic with a resolved Jira issue: Error Upgrading from 2.35.8 to 2.37.0

After reviewing the Jira issue, I might move this topic there too! Thank you! (: