Error while setting up DHIS2 2.32.0 on Ubuntu Server

Hello,
I Am trying to setup DHIS2 2.32.0 on my ubuntu instance but am getting errors. My machine has 4GB RAM.
The Postgres DB instance is populated with tables but I still see an ERROR: out of shared memory. I have tried to increase max_locks_per_transaction in the.
How could I solve this error?

SQL State  : 53200
Error Code : 0
Message    : ERROR: out of shared memory
  Hint: You might need to increase max_locks_per_transaction.
Location   : org/hisp/dhis/db/migration/2.32/V2_32_10__Use_bigint_for_id_columns.sql (/home/dhis/tomcat-dhis/file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-support-db-migration-2.32.0.jar!/org/hisp/dhis/db/migration/2.32/V2_32_10__Use_bigint_for_id_columns.sql)
Line       : 725
Statement  : alter table smscommands alter column smscommandid type bigint
 (AbstractApplicationContext.java [localhost-startStop-1])
* ERROR 2019-05-21 09:13:02,742 Context initialization failed (ContextLoader.java [localhost-startStop-1])
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.hisp.dhis.security.acl.AclService' defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-service-acl-2.32.0.jar!/META-INF/dhis/beans.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.hisp.dhis.schema.SchemaService' defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-service-schema-2.32.0.jar!/META-INF/dhis/beans.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.hisp.dhis.schema.PropertyIntrospectorService': 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.0.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: 
Migration V2_32_10__Use_bigint_for_id_columns.sql failed
--------------------------------------------------------
SQL State  : 53200
Error Code : 0
Message    : ERROR: out of shared memory
  Hint: You might need to increase max_locks_per_transaction.
Location   : org/hisp/dhis/db/migration/2.32/V2_32_10__Use_bigint_for_id_columns.sql (/home/dhis/tomcat-dhis/file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-support-db-migration-2.32.0.jar!/org/hisp/dhis/db/migration/2.32/V2_32_10__Use_bigint_for_id_columns.sql)
Line       : 725
Statement  : alter table smscommands alter column smscommandid type bigint

	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1198)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1100)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.hisp.dhis.schema.SchemaService' defined in URL [jar:file:/home/dhis/tomcat-dhis/webapps/ROOT/WEB-INF/lib/dhis-service-schema-2.32.0.jar!/META-INF/dhis/beans.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.hisp.dhis.schema.PropertyIntrospectorService': 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.0.jar!/META-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:
1 Like

Hi,

You have to uncomment and set “max_locks_per_transaction = 1024” in the /etc/postgresql/10/main/postgresql.conf file

Next, you need to restart the service by running “sudo service postgresql restart”

Then stop the tomcat service and start again.

Have you tried them?

1 Like