Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
boukenka opened this issue May 13, 2024 · 21 comments
Open

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

boukenka opened this issue May 13, 2024 · 21 comments
Labels
bug Something isn't working

Comments

@boukenka
Copy link

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.

@boukenka boukenka added the bug Something isn't working label May 13, 2024
@pacmano1
Copy link
Collaborator

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
Copy link
Author

Here are the channel and the message.

Data.zip

@pacmano1
Copy link
Collaborator

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

@boukenka
Copy link
Author

boukenka commented May 13, 2024

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

image

image

@pacmano1
Copy link
Collaborator

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

@boukenka
Copy link
Author

boukenka commented May 13, 2024

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
Copy link
Collaborator

Left menu, export results.

@boukenka
Copy link
Author

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

Data2.zip

@pacmano1
Copy link
Collaborator

This is what I mean.
image

@boukenka
Copy link
Author

Voilà.

Data3.zip

@pacmano1
Copy link
Collaborator

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
Copy link
Author

boukenka commented May 13, 2024

Unfortunately it is not the case on my side.

image

@boukenka
Copy link
Author

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

image

@boukenka
Copy link
Author

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
Copy link
Collaborator

pacmano1 commented May 13, 2024

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
Copy link
Author

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
Copy link
Author

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

@pacmano1
Copy link
Collaborator

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

@pacmano1
Copy link
Collaborator

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

@boukenka
Copy link
Author

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

@boukenka
Copy link
Author

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants