[Bug 1474419] [NEW] metadata import into empty db in 2.19 dhis2 fails

Public bug reported:

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.

** Affects: dhis2
     Importance: Undecided
         Status: New

** Tags: 2.19 import metadata

** Attachment added: "progress image import (doesn't go further than datasets)"
   https://bugs.launchpad.net/bugs/1474419/+attachment/4428811/+files/metadataImportProgress.png

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

Hi

The java class exceptions which are not useful, is exactly what we need
to figure out these kinds of bugs.. can you please give us the complete
stack trace?

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

Hi Morton,

Hereby the error log. I did it this time with versión 2.20, problem
seems to manifest itself the same in the User Interface. I include the
stdout log file this contains in the end some ERRORS and Warnings
related to the import.

Some background (ignore when short of time) "Why import into a empty database?"

···

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When testing import metadata into 2.19 i wanted to know if all kind of metadata can be imported, so stopped tomcat, dropped the database , created an new empty one, started tomcat and imported our metadata. (Did also tried it with an metadata export from the sierra leone demo server). This went fine with 2.18 but not with 2.19 and 2.20. (all as admin).

** Attachment added: "STDout 2.20"
   https://bugs.launchpad.net/dhis2/+bug/1474419/+attachment/4433489/+files/tomcat7-stderr.2015-07-24.log

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

And stderror log , this one doesn't contain the errors (stdout contains
them see previous message)

** Attachment added: "stderror - seems not useful to me"
   https://bugs.launchpad.net/dhis2/+bug/1474419/+attachment/4433491/+files/tomcat7-stderr.2015-07-24.log

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

Dear Rishi,

Please send the catalina.out or the dhis.log locates in the DHIS2_HOME
which you configured for versions 2.19 and above.

Alex

···

On Fri, Jul 24, 2015 at 12:43 PM, Rishi <rsukul@barcelona.msf.org> wrote:

And stderror log , this one doesn't contain the errors (stdout contains
them see previous message)

** Attachment added: "stderror - seems not useful to me"

https://bugs.launchpad.net/dhis2/+bug/1474419/+attachment/4433491/+files/tomcat7-stderr.2015-07-24.log

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET
Kampala
Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems -
DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don't want to be anything other than what I have been - one tree hill
"

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

Hereby the dhis.log Alex

** Attachment added: "dhis.log"
   https://bugs.launchpad.net/dhis2/+bug/1474419/+attachment/4433530/+files/dhis.log

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

And the Catalina.log

** Attachment added: "Catalina log (from the tomcat log folder)"
   https://bugs.launchpad.net/dhis2/+bug/1474419/+attachment/4433533/+files/catalina.2015-07-24.log

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

Dear Rishi,

This is the error:

  * ERROR 2015-07-24 11:14:49,033 ERROR: llave duplicada viola restricción de unicidad «uk_pbj3u1nk9vnuof8f47utvowmv» Detail: Ya existe la llave (name)=(default). (SqlExceptionHelper.java [taskScheduler-1])
Translate to English for me.

Alex

···

On Fri, Jul 24, 2015 at 1:32 PM, Rishi rsukul@barcelona.msf.org wrote:

And the Catalina.log

** Attachment added: “Catalina log (from the tomcat log folder)”

https://bugs.launchpad.net/dhis2/+bug/1474419/+attachment/4433533/+files/catalina.2015-07-24.log

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 in 2.19 dhis2 fails

Status in DHIS:

New

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


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET

Kampala

Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems - DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don’t want to be anything other than what I have been - one tree hill "

HI Alex,
It Is a unique constraint violation, I assume on inserting data from the metadata import, which is strange cause the database is empty. See below the translation

error 2015... .....Duplicate key violation
of the unique constraint «uk_pbj3u1nk9vnuof8f47utvowmv»
Detail: The key already exists.

ERROR 2015-07-24 11:14:49,033 ERROR: llave duplicada viola
restricción de unicidad «uk_pbj3u1nk9vnuof8f47utvowmv»
  Detail: Ya existe la llave (name)=(default).
(SqlExceptionHelper.java [taskScheduler-1])

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

Rishi,

Is data coming from a 2.19 instance or lower instance?

Why don't try this:
Import metadata into 2.18 (which you said it works), then upgrade to 2.19
(make sure you run the script provided for upgrade), then export metadata.
Use the metadata exported from 2.19 and import it into a new 2.19 database
and you see if you replicate the error.
It may due to constraints added in 2.19.

Alex

···

On Fri, Jul 24, 2015 at 3:39 PM, Rishi <rsukul@barcelona.msf.org> wrote:

HI Alex,
It Is a unique constraint violation, I assume on inserting data from the
metadata import, which is strange cause the database is empty. See below
the translation

error 2015... .....Duplicate key violation
of the unique constraint «uk_pbj3u1nk9vnuof8f47utvowmv»
Detail: The key already exists.

ERROR 2015-07-24 11:14:49,033 ERROR: llave duplicada viola
restricción de unicidad «uk_pbj3u1nk9vnuof8f47utvowmv»
  Detail: Ya existe la llave (name)=(default).
(SqlExceptionHelper.java [taskScheduler-1])

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET
Kampala
Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems -
DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don't want to be anything other than what I have been - one tree hill
"

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

Hi Alex, I did export a couple of weeks ago the metadata from the
Sierra Leone demo Server (which at that time was 2.19) and imported it
into 2.18 on my machine (which worked) and tried it also with 2.19
which failed.

I tried today again to export metadata from the Sierra Leone demo
server now it is upgraded to 2.20, but there seems to be an problem
with it, just starting the full metadat export ends in a general error
page. I will try again next week.

This should be similar as to what you are suggesting, right?

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

I have the same problem in Mozambique. Import never finishes it gets
‘stuck’ during importing of meta-data sets.

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

I found a workaround :

1) Import meta-data twice first with dry option then normal to 2.19 live
2) Meta-data detailed export from 2.19 live (separate files)
3) Import meta-data with dry run = yes to 2.19 server
4) Import meta-data option "new and update" with dry run = no and preload cache = no to 2.19 server

It works with:
Data elements
Indicators
Sets and groups
Users and users role but later need reassign roles to users

do not work with:
organization units

If anybody tries please inform about the results.

···

--
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 in 2.19 dhis2 fails

Status in DHIS:
  New

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

** Summary changed:

- metadata import into empty db in 2.19 dhis2 fails
+ Metadata import into empty db in 2.19 dhis2 fails because of already existing key

** Summary changed:

- Metadata import into empty db in 2.19 dhis2 fails because of already existing key
+ Metadata import into empty db fails because of already existing key violating unique constraint

···

--
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:
  New

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

Hi,

Was this solved? It seems you might have been encountering a bug we had
before, where the importer tried to create multiple default
category/categoryCombo etc.

Try something like this in psql, and see if it gives you 2 rows (on the server you are exporting from)
select * from categorycombo where name='default';

···

--
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:
  New

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

Btw, this was fixed in 2.18+, but if the bug already hit you.. you will
need to clean up the database

···

--
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:
  New

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

** Changed in: dhis2
       Status: New => Fix Released

···

--
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

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: * INFO 2015-09-10 12:51:29,185 [Level: INFO, category: METADATA_IMPORT, time: T - Pastebin.com

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

This is the metadata xml with categorycombo:

<categoryOptionCombos>
    <categoryOptionCombo name="(default)" created="2015-09-03T10:20:17.958+0000" lastUpdated="2015-09-03T10:20:17.958+0000" id="BBXnLh9nNvl">
      <externalAccess>false</externalAccess>
      <categoryCombo name="default" created="2015-09-03T10:20:17.949+0000" lastUpdated="2015-09-03T10:20:17.959+0000" id="tAF8NMLIZj8">
        <externalAccess>false</externalAccess>
        <publicAccess>--------</publicAccess>
      </categoryCombo>
      <ignoreApproval>false</ignoreApproval>
      <categoryOptions>
        <categoryOption name="default" created="2015-09-03T10:20:17.927+0000" lastUpdated="2015-09-03T10:20:17.959+0000" id="j18mBHu8iiB">
          <externalAccess>false</externalAccess>
          <publicAccess>--------</publicAccess>
        </categoryOption>
      </categoryOptions>
    </categoryOptionCombo>
  </categoryOptionCombos>

···

--
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