GML import fails

Hello everyone,

Any idea why this is happening? Trying to import on CODE.

I get error: No matching object for given reference. Identifier was UID, and object was [TVZbiEo7gjb] (OrganisationUnit).

The error UID is changing every time.

There is this topic which seems to have the same? problem…I cannot re-do the file. Issue while importing .gml file : No matching object for given reference. Identifier was UID, and object was X

1 Like

Hi @tomasmatas,

There are a few known issues with the GML import that make it hard to understand what is going on (see but I suspect that the CODE of one of the objects in your GML file cannot be uniquely mapped to an Organisation Unit. This has two consequences.

  1. All of the other, valid, entries are ignored (the import is performed as a single transaction and fails if there are any errors).
  2. Internally (regardless whether you identify be Name, Code, or UID in the GML file) the system tries to map the provided identifier to an existing UID. If it cannot it seems to generate one and return that in the failure message. Clearly this is not very useful, as it doesn’t tell the user which object caused the problem. This is one of the reasons that DHIS2-7077 is still open.

So, unfortunately, you will have to find out which of your CODEs (we know it is only 1 out of the 515, as you only get one error message) and correct the CODE, remove the record, or add that CODE to an existing/new OU. (One way to identify the invalid record would be to keep splitting your file: i.e. import the records in two halfs; one will fail; split that in two; one will fail; and so on. In that way you will get to the invalid record quite quickly by a process of elimination). The file is just an xml file, so you should be able to edit with any editor. PM me if you need some assistance.

Finally, just be aware of the other known issue that no summary is shown in the app when the upload is successful!

Kind regards,

1 Like

Thank you Phil. Indeed there was one mismatch in the file and it caused the error.

I managed to fix it and did the import.



1 Like