# Cryptic errors from REST API

**URL:** <https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418>\
**Category:** Development\
**Tags:** restws\
**Created:** [August 30, 2022, 9:09am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418 "2022-08-30T09:09:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cornelmasson](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cornelmasson/32/16778_2.png) [@cornelmasson](https://talk.openmrs.org/u/cornelmasson)\
**Post date:** [August 30, 2022, 9:09am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/1 "2022-08-30T09:09:30Z")

</div>

I’m using reference app 12.2, posting new encounters for the first time. Whenever there is a validation error, OpenMRS just returns a very cryptic message like:

`Request processing failed; nested exception is org.openmrs.module.webservices.rest.web.response.ConversionException: observations on class org.openmrs.Encounter`

or

… the same ConversionException with: `encounterDatetime on class org.openmrs.Encounter`

So, after trial and error on the 2nd one, it seems OpenMRS doesn’t like microseconds in the date format. I’m still trying to figure out what is wrong with the 1st one, the observations in the encounter, since the error message is of no help. Also nothing in the logs.

Can this error reporting be improved, it’s hard to make progress at the moment?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [August 31, 2022, 12:45pm UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/3 "2022-08-31T12:45:40Z")

</div>

Feel free to [create a ticket](https://wiki.openmrs.org/display/docs/Tickets) for this.

---

<div class="post-metadata">

**Author:** ![cornelmasson](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cornelmasson/32/16778_2.png) [@cornelmasson](https://talk.openmrs.org/u/cornelmasson)\
**Post date:** [September 1, 2022, 8:21am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/4 "2022-09-01T08:21:22Z")

</div>

I have an OpenMRS ID (login), but can’t log into JIRA. Who can I contact to give me JIRA access?

---

<div class="post-metadata">

**Author:** ![cornelmasson](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cornelmasson/32/16778_2.png) [@cornelmasson](https://talk.openmrs.org/u/cornelmasson)\
**Post date:** [September 1, 2022, 10:20am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/5 "2022-09-01T10:20:12Z")

</div>

Another case of deficient error reporting for encounter/observation:

The obs has value= **6** , for a ConceptNumeric with low\_absolute= **0** , hi\_absolute= **5**.

In the OpenMRS log, I can see the correct error:

`org.openmrs.api.ValidationException: 'obs id is null' failed to validate with reason: valueNumeric: error.outOfRange.high`

However, the exception that is returned to the _caller_ is 100% unusable. It looks like an exception in the exception handler, so the message is unusable:

`No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.openmrs.api.ValidationException['errors']->org.springframework.validation.BindException['bindingResult']->org.springframework.validation.BeanPropertyBindingResult['messageCodesResolver'])`

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [September 1, 2022, 12:21pm UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/6 "2022-09-01T12:21:22Z")

</div>

> [@cornelmasson](#):
>
> Who can I contact to give me JIRA access?

OpenMRS help desk: [Help Desk - Resources - OpenMRS Wiki](https://wiki.openmrs.org/display/RES/Help+Desk)

---

<div class="post-metadata">

**Author:** ![cornelmasson](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cornelmasson/32/16778_2.png) [@cornelmasson](https://talk.openmrs.org/u/cornelmasson)\
**Post date:** [September 5, 2022, 9:35am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/7 "2022-09-05T09:35:36Z")

</div>

Issue RESTWS-899 logged on JIRA [here](https://issues.openmrs.org/browse/RESTWS-899).

---

<div class="post-metadata">

**Author:** ![cornelmasson](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cornelmasson/32/16778_2.png) [@cornelmasson](https://talk.openmrs.org/u/cornelmasson)\
**Post date:** [September 19, 2022, 7:52am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/8 "2022-09-19T07:52:49Z")

</div>

Thanks @dkayiwa, I saw on [JIRA RESTWS-899](https://issues.openmrs.org/browse/RESTWS-899) that at least one error was fixed. My Rest Web Services OMOD version is **2.32.0.68810c** , running under ref app 2.12. How do I upgrade to **2.34**?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [September 19, 2022, 8:40am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/9 "2022-09-19T08:40:58Z")

</div>

Upgrade to the latest which is version 2.36.0

[http://guide.openmrs.org/en/Administering%20OpenMRS/maintenance.html](http://guide.openmrs.org/en/Administering%20OpenMRS/maintenance.html)

[https://wiki.openmrs.org/display/docs/Administering+Modules](https://wiki.openmrs.org/display/docs/Administering+Modules)

---

<div class="post-metadata">

**Author:** ![cornelmasson](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cornelmasson/32/16778_2.png) [@cornelmasson](https://talk.openmrs.org/u/cornelmasson)\
**Post date:** [September 19, 2022, 10:51am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/10 "2022-09-19T10:51:17Z")

</div>

I have upgraded the module to 2.36, but now I have database compatibility issues. I guess there are Liquibase changesets to run to migrate 2.32 to 2.36? What is the recommended way of doing this ? Can I get the list of changeset XML files somewhere?

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [September 19, 2022, 12:18pm UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/11 "2022-09-19T12:18:20Z")

</div>

> [@cornelmasson](#):
>
> I guess there are Liquibase changesets to run to migrate 2.32 to 2.36?

The REST module doesn’t make use of liquibase. Can you describe the “database compatibility issues” you are seeing?

---

<div class="post-metadata">

**Author:** ![cornelmasson](https://talk.openmrs.org/user_avatar/talk.openmrs.org/cornelmasson/32/16778_2.png) [@cornelmasson](https://talk.openmrs.org/u/cornelmasson)\
**Post date:** [September 20, 2022, 7:02am UTC](https://talk.openmrs.org/t/cryptic-errors-from-rest-api/37418/12 "2022-09-20T07:02:35Z")

</div>

Yeah, I also found it strange that the REST API would require db changes. I sort of assumed that the newer version of the REST API triggered different code paths in OpenMRS core, and that those paths required db updates.

Unfortunately, I have reverted to version 2.32 because of the errors I was seeing, and I didn’t record the exact error message. It was along the lines of not finding some lookup value with name “ZZ”. I then looked for any reference to “ZZ” in the Liquibase snapshots from my reference application, and found column `concept_datatype.hl7_abbreviation` assigned that value, so I assumed it had something to do with changesets. I might be wrong, though…

From liquibase-core-data-2.3.x.xml:

```auto
<insert tableName="concept_datatype">
	<column name="concept_datatype_id" valueNumeric="11"/>
	<column name="name" value="Rule"/>
	<column name="hl7_abbreviation" value="ZZ"/>
	<column name="description" value="Value derived from other data"/>
	<column name="creator" valueNumeric="1"/>
	<column name="date_created" valueDate="2006-09-11T00:00:00"/>
	<column name="retired" valueBoolean="false"/>
	<column name="retired_by"/>
	<column name="date_retired"/>
	<column name="retire_reason"/>
	<column name="uuid" value="8d4a5e96-c2cc-11de-8d13-0010c6dffd0f"/>
</insert>

```
