Database version - how to tell

Hi all, is there a way to tell what version the database is? I’m attempting to get an instance going that was running previously. I was told it was 2.16. Tomcat is having trouble firing up using the 2.16 .war and I notice an error in the stdout log that seems to indicate the app wants to make changes to the DB structure which makes me suspect the DB is possibly not 2.16:

  • ERROR 2017-07-16 16:55:02,744 HHH000388: Unsuccessful: alter table programstage add constraint fk_programstage_dataentryform foreign key (dataentryformid) references dataentryform (SchemaUpdate.java [localhost-startStop-1])

  • ERROR 2017-07-16 16:55:02,746 ERROR: constraint “fk_programstage_dataentryform” for relation “programstage” already exists (SchemaUpdate.java [localhost-startStop-1])

I’m also getting these in the log:

  • ERROR 2017-07-16 16:56:18,693 org.jasypt.exceptions.EncryptionOperationNotPossibleException

at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1055)

at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725)

at org.jasypt.encryption.pbe.PooledPBEStringEncryptor.decrypt(PooledPBEStringEncryptor.java:498)

at org.jasypt.hibernate4.type.AbstractEncryptedAsStringType.nullSafeGet(AbstractEncryptedAsStringType.java:143)

at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:127)

at org.hibernate.type.AbstractType.hydrate(AbstractType.java:106)

at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2903)

at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1668)

at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1600)

at org.hibernate.loader.Loader.getRow(Loader.java:1500)

at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:712)

at org.hibernate.loader.Loader.processResultSet(Loader.java:940)

at org.hibernate.loader.Loader.doQuery(Loader.java:910)

at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)

at org.hibernate.loader.Loader.doList(Loader.java:2516)

at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2361)

at org.hibernate.loader.Loader.list(Loader.java:2324)

at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:490)

at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)

at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)

at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1268)

at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)

at org.hisp.dhis.hibernate.HibernateGenericStore.getAll(HibernateGenericStore.java:345)

at org.hisp.dhis.configuration.DefaultConfigurationService.getConfiguration(DefaultConfigurationService.java:70)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

at com.sun.proxy.$Proxy30.getConfiguration(Unknown Source)

at org.hisp.dhis.startup.ConfigurationPopulator.execute(ConfigurationPopulator.java:48)

at org.hisp.dhis.system.startup.DefaultStartupRoutineExecutor.execute(DefaultStartupRoutineExecutor.java:115)

at org.hisp.dhis.system.startup.DefaultStartupRoutineExecutor.execute(DefaultStartupRoutineExecutor.java:85)

at org.hisp.dhis.system.startup.StartupListener.contextInitialized(StartupListener.java:68)

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)

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:1127)

at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask.run(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

(StartupListener.java [localhost-startStop-1])

Any help appreciated!

An update on this, it turns out the encryption.password setting in the hibernate.properties file was overwritten with an incorrect value. Fortunately someone on the team recalled what it was previously as the file had not been backed up along with the database. That accounts for the org.jasypt.exceptions. EncryptionOperationNotPossibleException error. I am now able to get the system up and access the UI. Lesson, always backup hibernate.properties along with the database!

I am still getting some errors and warnings, they may be benign, but if anyone has insight into them, I would appreciate it greatly, particularly the errors:

  • WARN 2017-07-16 19:05:27,445 [127.0.0.1]:5701 [dev] [3.2.1] No join method is enabled! Starting standalone. (HazelcastInstanceImpl.java [localhost-startStop-1])

* ERROR 2017-07-16 19:05:45,648 HHH000388: Unsuccessful: alter table programstage add constraint fk_programstage_dataentryform foreign key (dataentryformid) references dataentryform (SchemaUpdate.java [localhost-startStop-1])

* ERROR 2017-07-16 19:05:45,649 ERROR: constraint “fk_programstage_dataentryform” for relation “programstage” already exists (SchemaUpdate.java [localhost-startStop-1])

  • WARN 2017-07-16 19:06:37,114 RP discovery / realm validation disabled; (RealmVerifier.java [localhost-startStop-1])

  • WARN 2017-07-16 19:07:16,113 Did not find any ViewResolvers to delegate to; please configure them using the ‘viewResolvers’ property on the ContentNegotiatingViewResolver (ContentNegotiatingViewResolver.java [localhost-startStop-1])

  • WARN 2017-07-16 19:07:26,335 Did not find any ViewResolvers to delegate to; please configure them using the ‘viewResolvers’ property on the ContentNegotiatingViewResolver (ContentNegotiatingViewResolver.java [localhost-startStop-1])

  • WARN 2017-07-16 19:07:29,027 Ignoring action package with no actions: struts-default (DefaultModuleManager.java [http-bio-8080-exec-7])

  • WARN 2017-07-16 19:07:29,028 Ignoring action package with no actions: spring-default (DefaultModuleManager.java [http-bio-8080-exec-7])

  • WARN 2017-07-16 19:07:29,028 Ignoring action package with no actions: dhis-web-commons (DefaultModuleManager.java [http-bio-8080-exec-7])

  • WARN 2017-07-16 19:07:29,030 Ignoring action package with no actions: dhis-web-ohie (DefaultModuleManager.java [http-bio-8080-exec-7])

  • WARN 2017-07-16 19:07:29,030 Ignoring action package with no actions: dhis-web-portal (DefaultModuleManager.java [http-bio-8080-exec-7])

Cheers,

Ed

Hi Edward,

there is no way currently to tell the version from the database. As you say it is recommended to back up the encryption key when enabling encryption, otherwise you risk losing attribute data for good (it is mentioned in the installation docs here).

The constraint error you get might stem from an application rename of that foreign key. Have a look at the programstage table and see if there is a foreign key to dataentryform table with another name. If so either rename it to fk_programstage_dataentryform or just delete it and restart the app.

best regards,

Lars

···

On Mon, Jul 17, 2017 at 1:48 AM, Edward Robinson erobinson@projectbalance.com wrote:

An update on this, it turns out the encryption.password setting in the hibernate.properties file was overwritten with an incorrect value. Fortunately someone on the team recalled what it was previously as the file had not been backed up along with the database. That accounts for the org.jasypt.exceptions. EncryptionOperationNotPossibleException error. I am now able to get the system up and access the UI. Lesson, always backup hibernate.properties along with the database!

I am still getting some errors and warnings, they may be benign, but if anyone has insight into them, I would appreciate it greatly, particularly the errors:

  • WARN 2017-07-16 19:05:27,445 [127.0.0.1]:5701 [dev] [3.2.1] No join method is enabled! Starting standalone. (HazelcastInstanceImpl.java [localhost-startStop-1])

* ERROR 2017-07-16 19:05:45,648 HHH000388: Unsuccessful: alter table programstage add constraint fk_programstage_dataentryform foreign key (dataentryformid) references dataentryform (SchemaUpdate.java [localhost-startStop-1])

* ERROR 2017-07-16 19:05:45,649 ERROR: constraint “fk_programstage_dataentryform” for relation “programstage” already exists (SchemaUpdate.java [localhost-startStop-1])

  • WARN 2017-07-16 19:06:37,114 RP discovery / realm validation disabled; (RealmVerifier.java [localhost-startStop-1])
  • WARN 2017-07-16 19:07:16,113 Did not find any ViewResolvers to delegate to; please configure them using the ‘viewResolvers’ property on the ContentNegotiatingViewResolver (ContentNegotiatingViewResolver.java [localhost-startStop-1])
  • WARN 2017-07-16 19:07:26,335 Did not find any ViewResolvers to delegate to; please configure them using the ‘viewResolvers’ property on the ContentNegotiatingViewResolver (ContentNegotiatingViewResolver.java [localhost-startStop-1])
  • WARN 2017-07-16 19:07:29,027 Ignoring action package with no actions: struts-default (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,028 Ignoring action package with no actions: spring-default (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,028 Ignoring action package with no actions: dhis-web-commons (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,030 Ignoring action package with no actions: dhis-web-ohie (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,030 Ignoring action package with no actions: dhis-web-portal (DefaultModuleManager.java [http-bio-8080-exec-7])

Cheers,

Ed


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Thank you Lars, I will do as you suggested and respond with results when I have a chance (hopefully later today)

Regards

Ed

···

Hi Edward,

there is no way currently to tell the version from the database. As you say it is recommended to back up the encryption key when enabling encryption, otherwise you risk losing attribute data for good (it is mentioned in the installation docs
here
).

The constraint error you get might stem from an application rename of that foreign key. Have a look at the programstage table and see if there is a foreign key to dataentryform table with another name. If so either rename it to fk_programstage_dataentryform or just delete it and restart the app.

best regards,

Lars

On Mon, Jul 17, 2017 at 1:48 AM, Edward Robinson erobinson@projectbalance.com wrote:

An update on this, it turns out the encryption.password setting in the hibernate.properties file was overwritten with an incorrect value. Fortunately someone on the team recalled what it was previously as the file had not been backed up along with the database. That accounts for the org.jasypt.exceptions. EncryptionOperationNotPossibleException error. I am now able to get the system up and access the UI. Lesson, always backup hibernate.properties along with the database!

I am still getting some errors and warnings, they may be benign, but if anyone has insight into them, I would appreciate it greatly, particularly the errors:

  • WARN 2017-07-16 19:05:27,445 [127.0.0.1]:5701 [dev] [3.2.1] No join method is enabled! Starting standalone. (HazelcastInstanceImpl.java [localhost-startStop-1])

__ * ERROR 2017-07-16 19:05:45,648 HHH000388: Unsuccessful: alter table programstage add constraint fk_programstage_dataentryform foreign key (dataentryformid) references dataentryform (SchemaUpdate.java [localhost-startStop-1])__

* ERROR 2017-07-16 19:05:45,649 ERROR: constraint “fk_programstage_dataentryform” for relation “programstage” already exists (SchemaUpdate.java [localhost-startStop-1])

  • WARN 2017-07-16 19:06:37,114 RP discovery / realm validation disabled; (RealmVerifier.java [localhost-startStop-1])
  • WARN 2017-07-16 19:07:16,113 Did not find any ViewResolvers to delegate to; please configure them using the ‘viewResolvers’ property on the ContentNegotiatingViewResolver (ContentNegotiatingViewResolver.java [localhost-startStop-1])
  • WARN 2017-07-16 19:07:26,335 Did not find any ViewResolvers to delegate to; please configure them using the ‘viewResolvers’ property on the ContentNegotiatingViewResolver (ContentNegotiatingViewResolver.java [localhost-startStop-1])
  • WARN 2017-07-16 19:07:29,027 Ignoring action package with no actions: struts-default (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,028 Ignoring action package with no actions: spring-default (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,028 Ignoring action package with no actions: dhis-web-commons (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,030 Ignoring action package with no actions: dhis-web-ohie (DefaultModuleManager.java [http-bio-8080-exec-7])
  • WARN 2017-07-16 19:07:29,030 Ignoring action package with no actions: dhis-web-portal (DefaultModuleManager.java [http-bio-8080-exec-7])

Cheers,

Ed


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org