Error importing metadata using Metadata Sharing on Platform 1.11.5

I am trying to migrate metadata from my old Platform 1.9.3 to my newly installed Platform 1.11.5 using the Metadata Sharing Module. When importing a package I am always getting this error:

type Exception report
message org/openmrs/ConceptWord
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.NoClassDefFoundError: org/openmrs/ConceptWord

I also tried importing metadata having Hibernate Compatibility Module installed, but it was still unsuccessful.

Both Metadata Mapping and Metadata Sharing modules are up to date in both installations.

Use the latest version of this module.

I am using the version of Hibernate Compatibility Module which I checked out from it’s github page: https://github.com/openmrs/openmrs-module-hibernatecompatibility

Is this the latest version ? If not, where can I find the latest version ?

I mean latest version of the Metadata Sharing Module.

I’m not sure that it’s possible to export using MDS from one OpenMRS version, and import into another OpenMRS version…

You can import/export between varieties of 1.9 and 1.10.

This describes the problem with concept_word table which is gone from 1.11 (?):

Ellen

1 Like

Ellen is right. @jevgeni, please report your issue in JIRA under the META project and we will fix it.

Thank you very much everyone for your support. I have reported the issue in JIRA.

Originally, I was trying to upgrade my OpenMRS Platform 1.9.3 to the latest OpenMRS Platform 1.11.5, but encountered several problems which I posted in these topics:

Is there an alternative solution to migrate metadata to a new installation? Is there maybe also a way to transfer patient data (name, obs etc.) to a new installation?

I tried importing forms from 1.9.3 to 1.10.3. Some could not be imported, because of problems with particular concepts like ‘yes’ or ‘no’. I am getting errors like this when importing forms containing these concepts:

Caused by: org.openmrs.api.APIException: ‘1067’ failed to validate with reason: Only one preferred name is allowed for each locale, Only one fully specifies name is allowed for each locale

Trying to (re)save the affected concept under dictionary, yields the same error. I checked the fully specified name and synonyms for each locale and can confirm that none are the same. The error also happens, if I choose ‘Merge (prefer mine)’ when importing.

Can you check the the preferred names? You should have only one per locale. It is possible that you have multiples for some language that you don’t even use.

select concept_name_id,name, locale,locale_preferred 
from concept_name 
where concept_id = 1067
order by locale;

There are same names for the locale ‘en’ which are also both preferred ones. I deleted these entries (also deleting the respective entry from concept_word table). Now when trying to import a form which is using this concept, it still fails when it tries to save the respective concept without detailed exception specification. Trying to (re)save the concept under dictionary yields a ‘query did not return unique result error: 2’ error.

I am using a freshly installed Platform 1.10.3 with the original, non-modified DB with demo data.

Sorry for your trouble. Is the error message still pointing to 1067? Is there some error in the catalina.out log file? Could you post the results of the mysql select for 1066 and 1067?

1 Like

I could actually solve the problem for 1065 and 1066 by modifying the locale in the DB (changing it from ‘en’ to ‘en_US’ and ‘en_GB’ respectively). The problem also occurs with 5087 (‘pulse’). Changing locales in the DB in a similar way enables saving the concept in the dictionary, but during metadata import I am getting the ‘query did not return a result: 2’ error.

This is the query result for 1067 (unmodified):

+-----------------+-----------------------+--------+------------------+
| concept_name_id | name                  | locale | locale_preferred |
+-----------------+-----------------------+--------+------------------+
|          127334 | জানিনা                | bn     |                1 |
|            1067 | UNKNOWN               | en     |                1 |
|            1140 | Unknown               | en     |                1 |
|          108335 | Desconocido           | es     |                1 |
|          108336 | Desconocida           | es     |                0 |
|          105793 | Inconnu               | fr     |                0 |
|            1141 | Ne sait pas           | fr     |                1 |
|          111191 | Не известно           | ru     |                1 |
|          106309 | Ntabizi               | rw     |                1 |
|          110114 | HAIJULIKANI           | sw     |                1 |
+-----------------+-----------------------+--------+------------------+

I should have explained the rules better. Only 1 unvoided preferred name is allowed for each locale. Case doesn’t matter. I should have added the voided field to the query. Your results show 2 preferred names for ‘en’ – ‘UNKNOWN’ and ‘Unknown’. Maybe one is already voided. 2 preferred names will not be validated during metadata sharing. Best to change the locale_preferred instead of changing the locale.

Try using this query to confirm voided status:

select concept_name_id,name, locale, locale_preferred 
from concept_name 
where concept_id = 1067
and voided = 0
order by locale;
2 Likes

I changed the locale_preferred for ‘Unknown’/‘en’ like this:

+-----------------+-----------------------+--------+------------------+
| concept_name_id | name                  | locale | locale_preferred |
+-----------------+-----------------------+--------+------------------+
|          127334 | জানিনা                | bn     |                1 |
|            1067 | UNKNOWN               | en     |                1 |
|            1140 | Unknown               | en     |                0 |
|          108335 | Desconocido           | es     |                1 |
|          108336 | Desconocida           | es     |                0 |
|          105793 | Inconnu               | fr     |                0 |
|            1141 | Ne sait pas           | fr     |                1 |
|          111191 | Не известно           | ru     |                1 |
|          106309 | Ntabizi               | rw     |                1 |
|          110114 | HAIJULIKANI           | sw     |                1 |
+-----------------+-----------------------+--------+------------------+

Now when trying to save the concept under dictionary and also during metadata import, it does not complain about the preferred locale anymore, but still throws an error saying that only one fully specified name is allowed.

Changing the locale of ‘Unknown’ to ‘en_GB’ solves the problem, but metadata import still gets stuck on 5087 (‘Pulse’).

The original version of 5087 looks like this:

+-----------------+------------+--------+------------------+
| concept_name_id | name       | locale | locale_preferred |
+-----------------+------------+--------+------------------+
|           92750 | Heart rate | en     |                0 |
|            2929 | HEART RATE | en     |                0 |
|            2188 | Pulse      | en     |                1 |
|            2967 | HR         | en     |                0 |
|            1437 | PULSE      | en     |                1 |
|            2497 | HR         | en     |                0 |
|           87031 | HR         | en     |                0 |
|           92927 | HR         | en     |                0 |
|            2189 | POULS      | fr     |                1 |
|          126366 | Pilsasyon  | ht     |                1 |
+-----------------+------------+--------+------------------+

I changed it to this:

+-----------------+------------+--------+------------------+
| concept_name_id | name       | locale | locale_preferred |
+-----------------+------------+--------+------------------+
|           92927 | HR         | de     |                0 |
|           87031 | HR         | en     |                0 |
|           92750 | Heart rate | en_GB  |                0 |
|            2188 | Pulse      | en_GB  |                1 |
|            2967 | HR         | en_GB  |                0 |
|            2929 | HEART RATE | en_US  |                0 |
|            1437 | PULSE      | en_US  |                1 |
|            2497 | HR         | en_US  |                0 |
|            2189 | POULS      | fr     |                1 |
|          126366 | Pilsasyon  | ht     |                1 |
+-----------------+------------+--------+------------------+

After the changes 5087 can be saved under dictionary, but metadata import still fails with a ‘query did not return unique result’ error.

Try adding a few more useful and informational fields to your query:

select concept_name_id,name,locale,voided,locale_preferred,concept_name_type from concept_name

There should be 1 FULLY_SPECIFIED name per locale; 1 locale_preferred = 1 per locale. Changing the locale might solve some of the issues, but it’s not the correct use of the data model. It is meant for things like “center” (en) vs “centre” (en_gb).