# Meta-data export with dependencies Fails

**URL:** <https://community.dhis2.org/t/meta-data-export-with-dependencies-fails/33915>\
**Category:** Support - Assistance technique\
**Created:** [13 February 2018 09:45 UTC](https://community.dhis2.org/t/meta-data-export-with-dependencies-fails/33915 "2018-02-13T09:45:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Calle\_Hedberg](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/calle_hedberg/32/33875_2.png) [@Calle\_Hedberg](https://community.dhis2.org/u/Calle_Hedberg)\
**Post date:** [13 February 2018 09:45 UTC](https://community.dhis2.org/t/meta-data-export-with-dependencies-fails/33915/1 "2018-02-13T09:45:38Z")

</div>

Hi

I’m trying to export a single data set from one instance to another - it is a relatively simple data set with about 20 data elements, all using the same categorycombo.

Import fails with the following message:

org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “uk\_qp9201a4m6jl53sei0huh4l6s”

Detail: Key (shortname)=(default) already exists.

So it looks like the import cannot handle that the “default” catcombo obviously vary from the source to the destination instance.

Is this a bug, or expected behaviour?

Regards

Calle

> **···**
>
> * * *
> 
> Calle Hedberg
> 
> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
> 
> Tel/fax (home): +27-21-685-6472
> 
> Cell: +27-82-853-5352
> 
> Iridium SatPhone: +8816-315-19119
> 
> Email: [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> Skype: calle\_hedberg
> 
> * * *

---

<div class="post-metadata">

**Author:** ![SamuelJohnson](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/samueljohnson/32/100_2.png) [@SamuelJohnson](https://community.dhis2.org/u/SamuelJohnson)\
**Post date:** [15 February 2018 21:43 UTC](https://community.dhis2.org/t/meta-data-export-with-dependencies-fails/33915/2 "2018-02-15T21:43:02Z")

</div>

Hi Calle,

Which version of DHIS2 are you using? In November I found a similar bug in 2.28 ([DHIS2-2493](https://jira.dhis2.org/browse/DHIS2-2493)), where the import chokes on an unknown catCombo, but the cause is slightly different – it attempts to persist the data element with a NULL catCombo instead of substituting ‘default’ (and catCombo is a NOT NULL column).

Importing unknown catCombos (eg foreign ‘default’ catCombos) worked well in 2.25, 2.26 and 2.27 when we tested them back in November, so it would be great to get this feature working properly again in 2.28.

Cheers, Sam.

> **···**
>
> **From:** Dhis2-devs [dhis2-devs-bounces+samuel.johnson=qebo.co.uk@lists.launchpad.net](mailto:dhis2-devs-bounces+samuel.johnson=qebo.co.uk@lists.launchpad.net) on behalf of Calle Hedberg [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> **Reply-To:** “[calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)” [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> **Date:** Tuesday, 13 February 2018 at 09:47
> 
> **To:** DHIS2 Developers [dhis2-devs@lists.launchpad.net](mailto:dhis2-devs@lists.launchpad.net)
> 
> **Subject:** [Dhis2-devs] Meta-data export with dependencies Fails
> 
> Hi
> 
> I’m trying to export a single data set from one instance to another - it is a relatively simple data set with about 20 data elements, all using the same categorycombo.
> 
> Import fails with the following message:
> 
> org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “uk\_qp9201a4m6jl53sei0huh4l6s”
> 
> Detail: Key (shortname)=(default) already exists.
> 
> So it looks like the import cannot handle that the “default” catcombo obviously vary from the source to the destination instance.
> 
> Is this a bug, or expected behaviour?
> 
> Regards
> 
> Calle
> 
> * * *
> 
> Calle Hedberg
> 
> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
> 
> Tel/fax (home): +27-21-685-6472
> 
> Cell: +27-82-853-5352
> 
> Iridium SatPhone: +8816-315-19119
> 
> Email: [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> Skype: calle\_hedberg
> 
> * * *

---

<div class="post-metadata">

**Author:** ![Calle\_Hedberg](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/calle_hedberg/32/33875_2.png) [@Calle\_Hedberg](https://community.dhis2.org/u/Calle_Hedberg)\
**Post date:** [16 February 2018 09:58 UTC](https://community.dhis2.org/t/meta-data-export-with-dependencies-fails/33915/3 "2018-02-16T09:58:49Z")

</div>

Sam

I was importing into 2.28, yes - sorry, should have specified that.

I will add the above as a comment to DHIS2-2493, then, even if the scenario/cause might be slightly different (but it is probably related)

Regards

Calle

> **···**
>
> On 15 February 2018 at 23:43, Sam Johnson [samuel.johnson@qebo.co.uk](mailto:samuel.johnson@qebo.co.uk) wrote:
> 
> > Hi Calle,
> 
> > 
> 
> > Which version of DHIS2 are you using? In November I found a similar bug in 2.28 ([DHIS2-2493](https://jira.dhis2.org/browse/DHIS2-2493)), where the import chokes on an unknown catCombo, but the cause is slightly different – it attempts to persist the data element with a NULL catCombo instead of substituting ‘default’ (and catCombo is a NOT NULL column).
> 
> > 
> 
> > Importing unknown catCombos (eg foreign ‘default’ catCombos) worked well in 2.25, 2.26 and 2.27 when we tested them back in November, so it would be great to get this feature working properly again in 2.28.
> 
> > 
> 
> > Cheers, Sam.
> 
> > 
> 
> > 
> 
> > **From:** Dhis2-devs [dhis2-devs-bounces+samuel.johnson=qebo.co.uk@lists.launchpad.net](mailto:dhis2-devs-bounces+samuel.johnson=qebo.co.uk@lists.launchpad.net) on behalf of Calle Hedberg [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> > 
> > **Reply-To:** “[calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)” [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> > 
> > **Date:** Tuesday, 13 February 2018 at 09:47
> > 
> > **To:** DHIS2 Developers [dhis2-devs@lists.launchpad.net](mailto:dhis2-devs@lists.launchpad.net)
> > 
> > **Subject:** [Dhis2-devs] Meta-data export with dependencies Fails
> 
> > 
> 
> > Hi
> 
> > 
> 
> > I’m trying to export a single data set from one instance to another - it is a relatively simple data set with about 20 data elements, all using the same categorycombo.
> 
> > 
> 
> > Import fails with the following message:
> 
> > 
> 
> > org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “uk\_qp9201a4m6jl53sei0huh4l6s”
> 
> > Detail: Key (shortname)=(default) already exists.
> 
> > 
> 
> > So it looks like the import cannot handle that the “default” catcombo obviously vary from the source to the destination instance.
> 
> > 
> 
> > Is this a bug, or expected behaviour?
> 
> > 
> 
> > Regards
> 
> > Calle
> 
> > * * *
> 
> > Calle Hedberg
> 
> > [46D Alma Road, 7700 Rosebank, SOUTH AFRICA](https://maps.google.com/?q=46D+Alma+Road,+7700+Rosebank,+SOUTH+AFRICA&entry=gmail&source=g)
> 
> > Tel/fax (home): +27-21-685-6472
> 
> > Cell: +27-82-853-5352
> 
> > Iridium SatPhone: +8816-315-19119
> 
> > Email: [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> > Skype: calle\_hedberg
> 
> > * * *
> 
> > 
> 
> –
> 
> * * *
> 
> Calle Hedberg
> 
> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
> 
> Tel/fax (home): +27-21-685-6472
> 
> Cell: +27-82-853-5352
> 
> Iridium SatPhone: +8816-315-19119
> 
> Email: [calle.hedberg@gmail.com](mailto:calle.hedberg@gmail.com)
> 
> Skype: calle\_hedberg
> 
> * * *
