Failed Export Concepts - MetaSharing module


(Samuel Male) #1

Hi all,

I’m trying to export metadata like Concept from one server to another. But I have failed to publish a package. Could be I don’t know how.

Steps Taken

  • Move to the metadatasharing module dashboard using the legacy ui
  • Moved to the configure data page. I added my url prefix as ‘http://localhost:8080/openmrs
  • Move to Export Metadata —> Create Package.
  • I added Concept data to created Package —> Click Export
  • Opppsss, validation error is caused.

Could you help me here.

MetadaSharing Module version - 1.3.0, Platform - 2.0.6

I have looked through this User guide but it looks obsolete.

cc: @dkayiwa, @ssmusoke


(Samuel Male) #2

This is specifically occurring when export Concepts. Other metadata types are Exported successfully. Could I be doing it wrongly?

cc: @dkayiwa


GSoC 2018 - Merge Patient Data from Multiple Installations - Final Presentation
(Daniel Kayiwa) #3

Does it work if you export one concept?


(Samuel Male) #4

It doesn’t work @dkayiwa


(Samuel Male) #5

Could someone direct me on how to workaround this. Its really blocking me. We can’t merge Patients Data without using this module to share concepts.

cc: @dkayiwa, @ssmusoke, @wyclif


(Willa Mhawila) #6

Take a look at this thread


(Samuel Male) #7

Thanks @willa for looking in this but it looks like error was specific to particular concepts which @akanter could have fixed. I couldn’t get any solution from the thread


(Daniel Kayiwa) #8

Do you get the same error on this server? http://demo.openmrs.org/


(Samuel Male) #9

Yes @dkayiwa


(Willa Mhawila) #10

From the stack trace it seems like you are facing the same problem. From the trace I see

Caused by: org.openmrs.api.DuplicateConceptNameException: ‘Oui’ is a duplicate name in locale ‘fr’

and

Caused by: org.openmrs.api.DuplicateConceptNameException: ‘Não’ is a duplicate name in locale ‘pt’


(Wyclif Luyima) #11

@samuel34 you have an invalid concept with a duplicate french name among the concepts you are attempting to import, please look at the error details for the uuid of concept and try to fix it before you try again.


(Willa Mhawila) #12

On a second thought and may be this is a very naive question, if the server can allow the duplicate names concepts to exist why can’t the metadata sharing module simply export them? What I am wondering is, how does a server end up with duplicates if it is not supposed to be allowed in the first place? Is it possible that they are created outside the API may be or am I missing something?


(Samuel Male) #13

That error is triggered by an export process.

What makes me wonder the same error happens when you try to export Concepts from the demo server.

This what I wanna learn of. I don’t know how


(Willa Mhawila) #14

Can you post the error you are getting on the demo.openmrs.org?


(Samuel Male) #15

Perfect question that I was almost asking @dkayiwa


(Ellen Ball) #16

You could validate the concepts on your server. It’s likely to find the same problem with duplicate names for “yes” in Portuguese (pt) and French (fr) locales. The validation module does a great job of finding duplicates, but you need to clean them up.

https://wiki.openmrs.org/display/docs/Validation+Module


(Samuel Male) #17

Here is the error on the demo site

https://pastebin.com/1F7G8xMv


(Wyclif Luyima) #18

This arises if you imported the concepts outside of the API e.g. by loading a sql script, and this is actually how the CIEL dictionary is loaded

You edit the concept on the source server and fix the name to be unique before you import it.


(Wyclif Luyima) #19

You have several invalid concepts on the source server, I bet if you tried to save one of those offending concepts on the source server on the concept form page in the legacy UI, the operation would fail with that exact same error.

You can use the validation module to find all invalid concepts and fix them before you import them.


(Willa Mhawila) #20

So indeed you have duplicates. Searching for não on demo gives the results below.

I think the easiest fix for testing purposes is retiring the concept that is not being used or renaming as per Wyclif suggestion. Otherwise the comprehensive solution would be to use the validation module as per Ellen’s suggestion.