← Back to team overview

dhis2-devs team mailing list archive

Sync of admin user fails when modifying 'admin'

 

Hi Morten,

I am using DHIS version 2.23 with the new importer. I am using two
instances of DHIS for metadata sync. Whenever I make some changes to the
*admin* user on one instance and sync into the other, the Sync fails and
throws an exception. However, if I create a new user, and make
modifications, the sync is successful (Throws no exceptions)
Is this a known issue?


Following is the Log trace for the exception:


* WARN  2016-03-28 14:55:14,258 SQL Error: 0, SQLState: 23505
(SqlExceptionHelper.java [qtp1727373358-379])

** ERROR 2016-03-28 14:55:14,258 ERROR: duplicate key value violates unique
constraint "uk_ktwf16f728hce9ahtpmm7w5lx"*

*  Detail: Key (uid)=(ARhWqW6Lohm) already exists. (SqlExceptionHelper.java
[qtp1727373358-379])*

** ERROR 2016-03-28 14:55:14,259 Exception occurred while trying to import
the metadata. could not execute statement; SQL [n/a]; constraint
[uk_ktwf16f728hce9ahtpmm7w5lx]; nested exception is
org.hibernate.exception.ConstraintViolationException: could not execute
statement (DefaultMetadataSyncService.java [qtp1727373358-379])*

*org.springframework.dao.DataIntegrityViolationException: could not execute
statement; SQL [n/a]; constraint [uk_ktwf16f728hce9ahtpmm7w5lx]; nested
exception is org.hibernate.exception.ConstraintViolationException: could
not execute statement*

    at
org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163)

    at
org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730)

    at
org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592)

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

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

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

    at com.sun.proxy.$Proxy141.addVersion(Unknown Source)

    at
org.hisp.dhis.dxf2.metadata.sync.DefaultMetadataSyncService.doMetadataSync(DefaultMetadataSyncService.java:211)

    at
org.hisp.dhis.webapi.controller.metadata.sync.MetadataSyncController.metadataSync(MetadataSyncController.java:78)

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

    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:497)

    at
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

    at
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)

    at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

    at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817)

    at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731)

    at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

    at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

    at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)



Could you please help fix this?



*Thanks*

Archana Chillala
Application Developer
Email archanac@xxxxxxxxxxxxxxxx
Telephone +91 9100960533 <+91+9100960533>
[image: ThoughtWorks]
<http://www.thoughtworks.com/?utm_campaign=archana-chillala-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>

Follow ups