Unable to populate Postgres database for a fresh installation

This is the error we are getting

  • ERROR 2019-07-07 17:07:14,370 Migration of schema “public” to version 2.31.1 - Migrations for release v31 failed! Changes successfully rolled back. (Slf4jLog.java [localhost-startStop-1])

  • WARN 2019-07-07 17:07:14,372 Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.programrule.ProgramRuleVariableStore’: Unsatisfied dependency expressed through field ‘currentUserService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.user.CurrentUserService’: Unsatisfied dependency expressed through field ‘currentUserStore’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.hisp.dhis.user.CurrentUserStore’: Unsatisfied dependency expressed through field ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘flyway’ defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-support-db-migration-2.32.2-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:

Migration V2_31_1__Migrations_for_release_v31.sql failed

SQL State : 42601
Error Code : 0
Message : ERROR: syntax error at or near “not”
Position: 53
Location : org/hisp/dhis/db/migration/2.31/V2_31_1__Migrations_for_release_v31.sql (/home/dhis/file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-support-db-migration-2.32.2-SNAPSHOT.jar!/org/hisp/dhis/db/migration/2.31/V2_31_1__Migrations_for_release_v31.sql)
Line : 22
Statement : – FIELD MASK

The below link is what we have used for the installation process

1 Like

Hi @Minhaas,

Could you tell me what version of Postgres, Postgis and DHIS2 you are installing?

1 Like

postgres 9.5, postgis 2.2, DHIS 2.3.1

1 Like

The version of your software seem fine. I will refer you to one of my colleagues who has been working on this part of the code, @Ameen.

1 Like

@Minhaas The minimum supported postgres version is 9.6 starting from 2.31. Please upgrade postgres server and it should work fine.

1 Like