← Back to team overview

dhis2-devs team mailing list archive

[Bug 1474419] Re: Metadata import into empty db fails because of already existing key violating unique constraint

 

In need of advice - it does not seem to be fixed... Downloaded the most
recent WAR file, created a new PostgreSQL DB and imported the attached
metadata.xml.zip file (exported from a 2.20 dhis2 system).

ERROR: duplicate key violates unique constraint „uk_pbj3u1nk9vnuof8f47utvowmv“
  Detail: Key „(name)=(default)“ already exists.

Full log: http://pastebin.com/wSu4UtzL

The select statement mentioned above returns only one row:

 categorycomboid |     uid     | code |         created         |       lastupdated       |  name   | datadimensiontype | skiptotal | userid | publicaccess
-----------------+-------------+------+-------------------------+-------------------------+---------+-------------------+-----------+--------+--------------
              14 | tAF8NMLIZj8 |      | 2015-09-03 12:20:17.949 | 2015-09-03 12:20:17.959 | default | DISAGGREGATION    | f         |        | --------
(1 row)

WAR file: 2.20 Build 19848
Java version: 1.8.0_51

** Attachment added: "metadata export file"
   https://bugs.launchpad.net/dhis2/+bug/1474419/+attachment/4460494/+files/all.xml.zip

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1474419

Title:
  Metadata import into empty db fails because of already existing key
  violating unique constraint

Status in DHIS:
  Fix Released

Bug description:
  Dhis2 version: 2.19
  tested: local and with the demo Sierra Leone server.
  OS: Local Windows 7, tomcat(-7.0.62) , postgres 9.4
  browser: Firefox and Chrome.

  Problem statement
  Dhis2 version 2.19 fails  to imports metadate into empty database. Goes fine with 2.18 version.

  How tested
   Test 1. Do a default meta data export in msf dhis2 data on dhis2 version 2.19. 
  Stop tomcat, drop database , create a new empty database.
  1.	Start tomcat, start metadata import as admin user.
  2.	Check import summary, see Detailed error description below.

  Detailed error description
  Import never finishes it gets ‘stuck’  during importing  of Data sets. 
   
  In tomcat cat log the following is found.
  SEVERE: Servlet.service() for servlet [webapi] in context with path [/dhis] threw exception
  org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
  	at … (a lot of java class exceptions calls that are not helpful)
  	
  Test 2, same but then with an meta data export into  the Sierra Leone demo server. With same result ( as described in the detailed err description).
  Test 3. Same but then with 2.18 version of dhis2 installed local and with a dhis2 import with Sierra leone demo data and our data,  both goes fine.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1474419/+subscriptions


References