← Back to team overview

dhis2-users team mailing list archive

scheduling task error on db primrary key

 

develop version of dhis2, got : 


 WARN  2017-05-16 02:00:00,500 SQL Error: 0, SQLState: 23503 (SqlExceptionHelper.java [taskSchedule
r-24])
* ERROR 2017-05-16 02:00:00,513 Error: on "fileresource"  update or delete operation  on "externalfilereso
urce" 's "fk_fileresource_externalfileresource" violate constraint....


  detail:键值对(fileresourceid)=(862296)仍然是从表"externalfileresource"引用的. (SqlExceptionHelper.j
ava [taskScheduler-24])
* ERROR 2017-05-16 02:00:00,601 HHH000346: Error during managed flush [could not execute statement]
(SessionImpl.java [taskScheduler-24])
* ERROR 2017-05-16 02:00:00,621 Unexpected error occurred in scheduled task. (TaskUtils.java [taskSc
heduler-24])
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; con
straint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not
execute statement
        at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(Se
ssionFactoryUtils.java:241)
        at org.springframework.orm.hibernate5.HibernateTransactionManager.convertHibernateAccessExce
ption(HibernateTransactionManager.java:755)
        at org.springframework.orm.hibernate5.HibernateTransactionManager.doCommit(HibernateTransact
ionManager.java:590)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(
AbstractPlatformTransactionManager.java:761)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(Abstrac
tPlatformTransactionManager.java:730)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAft
erReturning(TransactionAspectSupport.java:504)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransact
ion(TransactionAspectSupport.java:292)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
        at com.sun.proxy.$Proxy154.deleteFileResource(Unknown Source)
        at org.hisp.dhis.fileresource.FileResourceCleanUpTask.lambda$run$111(FileResourceCleanUpTask
.java:64)
        at java.util.ArrayList.forEach(ArrayList.java:1249)
        at org.hisp.dhis.fileresource.FileResourceCleanUpTask.run(FileResourceCleanUpTask.java:62)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErro
rHandlingRunnable.java:54)
        at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.j
ava: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(Scheduled
ThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadP
oolExecutor.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.hibernate.exception.ConstraintViolationException: could not execute statement
        at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDel
egate.java:112)
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExcepti
onConverter.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:207)
        at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.jav
a:45)
        at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.jav
a:3311)
        at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.jav
a:3548)
        at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:98)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:586)
        at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:460)
        at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlus
hingEventListener.java:337)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.
java:39)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)
        at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:468)
        at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3135
)
        at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2352)
        at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCo
ordinatorImpl.java:491)
        at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoor
dinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:147)
        at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoor
dinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)
        at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoor
dinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231
)
        at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:65)


        at org.springframework.orm.hibernate5.HibernateTransactionManager.doCommit(HibernateTransact
ionManager.java:582)
        ... 20 more
Caused by: org.postgresql.util.PSQLException: 错误: 在 "fileresource" 上的更新或删除操作违反了在 "ex
ternalfileresource" 上的外键约束 "fk_fileresource_externalfileresource"
  详细:键值对(fileresourceid)=(862296)仍然是从表"externalfileresource"引用的.




--

此致

easy

莫愁前路无知己,天下谁人不识君。

Follow ups