nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
914 stars 275 forks source link

[BUG] 4.5.0 - API - /channels/{channelId}/messages/{messageId} #6193

Open boukenka opened 4 months ago

boukenka commented 4 months ago

Using MIRTH 4.5.0. I'm trying to get message details in JSON format (this worked before) via API. I got a 500 from the API.

To Reproduce

curl -X GET "https://localhost:8444/api/channels/06de3020-4852-4679-b4ca-2187b927f856/messages/1?metaDataId=0" 
-H  "accept: application/json" -H  "X-Requested-With: OpenAPI"

Expected behavior It should return the message details because it works when requesting a response in XML format.

curl -X GET "https://localhost:8444/api/channels/06de3020-4852-4679-b4ca-2187b927f856/messages/1?metaDataId=0" 
-H  "accept: application/xml" -H  "X-Requested-With: OpenAPI"

The server logs are :

ERROR 2024-05-13 14:17:17.170 [qtp421368307-70] com.mirth.connect.model.converters.ObjectJSONSerializer: javax.xml.transform.TransformerException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[31,28] 2024-05-13 16:17:17 Message: Character reference "&#x0" is an invalid XML character.

Screenshots

image

image

Environment Windows 10, MIRTH 4.5.0

Workaround(s) No workaround.

pacmano1 commented 4 months ago

Interesting. Is that any message on any channel? Maybe post your channel and a single message that shows this behavior? De-identified of course.

boukenka commented 4 months ago

Here are the channel and the message.

Data.zip

pacmano1 commented 4 months ago

I meant the raw message not the XML export of the message.

boukenka commented 4 months ago

I can't export the raw message. Here's a screenshot. I hope it helps.

image

image

pacmano1 commented 4 months ago

Huh? You can export the message from the message viewer.

boukenka commented 4 months ago

When selecting the message, I do 'Select All' from the context menu. Then 'Copy'. Then I open a notepad. Then CRTL-V. Below is what I get.

image

Only the first characters are pasted...

pacmano1 commented 4 months ago

Left menu, export results.

boukenka commented 4 months ago

This is what I have already sent in the previous zip. This time I have exported 2 messages.

Data2.zip

pacmano1 commented 4 months ago

This is what I mean.

image
boukenka commented 4 months ago

Voilà.

Data3.zip

pacmano1 commented 4 months ago

I imported your channel.

The XML files in your last post appear to be binary. I sent one of the binary messages to the channel.

I called:

curl -X GET "https://192.168.66.104:8443/api/channels/06de3020-4852-4679-b4ca-2187b927f856/messages/2?metaDataId=0" -H "accept: application/json" -H "X-Requested-With: OpenAPI"

Returns 200 OK with the message.

boukenka commented 4 months ago

Unfortunately it is not the case on my side.

image

boukenka commented 4 months ago

MIRTH 4.5.0 is running locally in a container (docker).

image

boukenka commented 4 months ago

I did the same curl. Still getting a 500. 😢

curl -X GET "https://localhost:8444/api/channels/06de3020-4852-4679-b4ca-2187b927f856/messages/2?metaDataId=0" 
-H  "accept: application/json" -H  "X-Requested-With: OpenAPI"
pacmano1 commented 4 months ago

Problem here for Nextgen (I don't work for Nextgen), is they won't be able to reproduce your issue.

I am not on a container though. Not that it matters. And I don't understand why you would write to / on a container in your first destination. That is another topic of course.

boukenka commented 4 months ago

Yes, probably. Also the exported channel is marked as 4.5.0.

<channel version="4.5.0">
  <id>06de3020-4852-4679-b4ca-2187b927f856</id>
  <nextMetaDataId>3</nextMetaDataId>
  <name>Channel Test 2</name>
  <description>This is a test channel test 2!</description>
  <revision>1</revision>
  <sourceConnector version="4.5.0">...
boukenka commented 4 months ago

For the container, this is just local testing. There is a mount accessible to the container to write in a local folder.

pacmano1 commented 4 months ago

I removed my post about the bad import, refresh your browser..

pacmano1 commented 4 months ago

Anyway, spent enough time on this. If Nextgen can't reproduce it, I doubt your issue will get traction.

boukenka commented 4 months ago

Thank you for your help in this investigation. Maybe Nextgen will have better luck.

boukenka commented 2 weeks ago

Any update?