Error in DHIS2.29: File Resource Clean Up Failed

Dear All,

After our upgrade last week to 2.29, I started getting this system notification and not sure what it means.

Could anybody please help with this.

Job ‘File resource clean up’ failed

System title:
Base URL: null
Time: 2018-07-26T02:00:00.015+01:00
Message: could not execute statement; SQL [n/a]; constraint [fk_document_fileresourceid]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

Cause: org.hibernate.exception.ConstraintViolationException: could not execute statement
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:178)
at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3325)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3562)
at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:99)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:589)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1437)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:493)
at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3207)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2413)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:156)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)
at org.springframework.orm.hibernate5.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:582)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:518)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy132.deleteFileResource(Unknown Source)
at org.hisp.dhis.fileresource.FileResourceCleanUpJob.lambda$execute$0(FileResourceCleanUpJob.java:97)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.hisp.dhis.fileresource.FileResourceCleanUpJob.execute(FileResourceCleanUpJob.java:95)
at org.hisp.dhis.scheduling.DefaultJobInstance.executeJob(DefaultJobInstance.java:145)
at org.hisp.dhis.scheduling.DefaultJobInstance.execute(DefaultJobInstance.java:67)
at org.hisp.dhis.scheduling.DefaultSchedulingManager.lambda$scheduleJob$1(DefaultSchedulingManager.java:158)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table “fileresource” violates foreign key constraint “fk_document_fileresourceid” on table “document”
Detail: Key (fileresourceid)=(344538) is still referenced from table “document”.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:132)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:384)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)
… 41 more

Thank you.

Warm Regards,

Ifeanyi

Read DrMaestro’s Blog

3 Likes

Hi @ifeanyiokoye,

Sorry for the late reply. There is a jira issue describing this problem here.

This bug does not affect your normal DHIS2 interaction, so you can safely ignore it. We will however work on fixing this as soon as we can.

2 Likes

Thank you @Stian

3 Likes

Thanks – we are still waiting for the fix :slight_smile:

2 Likes

Hi @Hazim_Timimi,

this issue should have been fixed during a fix for another issue. Please let me know if you are still experiencing the issue on the latest version of DHIS2.

1 Like

Thanks Stian. I think it is fixed now (at least I’m not getting a daily failure message anymore :-)).

2 Likes

We saw this error last on the 30th of May 2019 on version 2.30.

1 Like

Hi @ifeanyiokoye,

Which build of Version 2.30 were you using as at 30th of May, 2019?

1 Like

Not sure @jomutsani as we have done 2 or more updates.
Thanks

1 Like

That’s okay; but I hope now you are okay and sorted on the current build.