← Back to team overview

dhis2-devs team mailing list archive

Bug - 2.27 - Exception importing dashboards

 

Hello,

I am not able to import some dashboards.

It seems to be imported first time but they dont appear. When trying to
import again, the dry option says all elements will be updated except the
dashboard which will be created. When really importing it hangs but in the
logs there's one exception about violating unique constraint.

I've open a ticket on JIRA
https://jira.dhis2.org/browse/DHIS2-1938

Here's the log attached.

Thank you !
Ramón.
* INFO  2017-08-21 14:19:50,316 (teena.kunjumen) Updating 5 object(s) of type Chart (DefaultObjectBundleService.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,316 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:19:50 CEST 2017, message: (teena.kunjumen) Updating 5 object(s) of type Chart] (InMemoryNotifier.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,439 (teena.kunjumen) Updating 5 object(s) of type DashboardItem (DefaultObjectBundleService.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,440 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:19:50 CEST 2017, message: (teena.kunjumen) Updating 5 object(s) of type DashboardItem] (InMemoryNotifier.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,488 (teena.kunjumen) Creating 1 object(s) of type Dashboard (DefaultObjectBundleService.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,488 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:19:50 CEST 2017, message: (teena.kunjumen) Creating 1 object(s) of type Dashboard] (InMemoryNotifier.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,506 Cleared Hibernate caches (DefaultHibernateCacheManager.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,506 (teena.kunjumen) Import:Commit took 0.19 seconds (DefaultMetadataImportService.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,506 (teena.kunjumen) Import:Done took 0.22 seconds (DefaultMetadataImportService.java [taskScheduler-25])
* INFO  2017-08-21 14:19:50,506 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:19:50 CEST 2017, message: (teena.kunjumen) Import:Done took 0.22 seconds] (InMemoryNotifier.java [taskScheduler-25])
* INFO  2017-08-21 14:20:57,443 Read JSON file. Importing metadata. (ImportMetaDataTask.java [taskScheduler-11])
* INFO  2017-08-21 14:20:57,444 (teena.kunjumen) Import:Start (DefaultMetadataImportService.java [taskScheduler-11])
* INFO  2017-08-21 14:20:57,444 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:20:57 CEST 2017, message: (teena.kunjumen) Import:Start] (InMemoryNotifier.java [taskScheduler-11])
* INFO  2017-08-21 14:20:57,490 (teena.kunjumen) Import:Preheat[REFERENCE] took 0.04 seconds (DefaultPreheatService.java [taskScheduler-11])
* INFO  2017-08-21 14:20:57,492 (teena.kunjumen) Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java [taskScheduler-11])
* INFO  2017-08-21 14:20:57,492 (teena.kunjumen) Import:Commit took 0.00 seconds (DefaultMetadataImportService.java [taskScheduler-11])
* INFO  2017-08-21 14:20:57,492 (teena.kunjumen) Import:Done took 0.05 seconds (DefaultMetadataImportService.java [taskScheduler-11])
* INFO  2017-08-21 14:20:57,492 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:20:57 CEST 2017, message: (teena.kunjumen) Import:Done took 0.05 seconds] (InMemoryNotifier.java [taskScheduler-11])
* INFO  2017-08-21 14:21:26,463 Read JSON file. Importing metadata. (ImportMetaDataTask.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,464 (teena.kunjumen) Import:Start (DefaultMetadataImportService.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,464 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:21:26 CEST 2017, message: (teena.kunjumen) Import:Start] (InMemoryNotifier.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,486 (teena.kunjumen) Import:Preheat[REFERENCE] took 0.02 seconds (DefaultPreheatService.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,488 (teena.kunjumen) Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,488 (teena.kunjumen) Updating 5 object(s) of type Chart (DefaultObjectBundleService.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,488 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:21:26 CEST 2017, message: (teena.kunjumen) Updating 5 object(s) of type Chart] (InMemoryNotifier.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,615 (teena.kunjumen) Updating 5 object(s) of type DashboardItem (DefaultObjectBundleService.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,615 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:21:26 CEST 2017, message: (teena.kunjumen) Updating 5 object(s) of type DashboardItem] (InMemoryNotifier.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,672 (teena.kunjumen) Creating 1 object(s) of type Dashboard (DefaultObjectBundleService.java [taskScheduler-18])
* INFO  2017-08-21 14:21:26,672 [Level: INFO, category: METADATA_IMPORT, time: Mon Aug 21 14:21:26 CEST 2017, message: (teena.kunjumen) Creating 1 object(s) of type Dashboard] (InMemoryNotifier.java [taskScheduler-18])
* WARN  2017-08-21 14:21:26,682 SQL Error: 0, SQLState: 23505 (SqlExceptionHelper.java [taskScheduler-18])
* ERROR 2017-08-21 14:21:26,683 ERROR: duplicate key value violates unique constraint "uk_myox13mr8r27oxl7ts33ntpd5"
  Detail: Key (uid)=(e9vMnmCUpsC) already exists. (SqlExceptionHelper.java [taskScheduler-18])
* ERROR 2017-08-21 14:21:26,684 Unexpected error occurred in scheduled task. (TaskUtils.java [taskScheduler-18])
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:207)
        at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2999)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3499)
        at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)
        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(AbstractFlushingEventListener.java:337)
        at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
        at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)
        at org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:173)
        at sun.reflect.GeneratedMethodAccessor2168.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
        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.$Proxy190.commit(Unknown Source)
        at org.hisp.dhis.dxf2.metadata.DefaultMetadataImportService.importMetadata(DefaultMetadataImportService.java:127)
        at sun.reflect.GeneratedMethodAccessor2157.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
        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.$Proxy192.importMetadata(Unknown Source)
        at org.hisp.dhis.importexport.action.util.ImportMetaDataTask.call(ImportMetaDataTask.java:99)
        at org.hisp.dhis.security.SecurityContextRunnable.run(SecurityContextRunnable.java:57)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        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: duplicate key value violates unique constraint "uk_myox13mr8r27oxl7ts33ntpd5"
  Detail: Key (uid)=(e9vMnmCUpsC) already exists.
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2476)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2189)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
        at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:136)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:384)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)
        ... 45 more

Follow ups