Bug 183 - C-ECHO always fails
Summary: C-ECHO always fails
Status: RESOLVED FIXED
Alias: None
Product: Orthanc
Classification: Unclassified
Component: Orthanc Core (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Assignee: Sébastien Jodogne
URL:
Depends on:
Blocks:
 
Reported: 2020-06-29 15:17 CEST by Sébastien Jodogne
Modified: 2020-06-29 15:28 CEST (History)
0 users

See Also:


Attachments
echo_bug.tar.gz (2.06 KB, application/gzip)
2020-06-29 15:17 CEST, Sébastien Jodogne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sébastien Jodogne 2020-06-29 15:17:00 CEST
[BitBucket user: Nick Farrell]
[BitBucket date: 2020-06-26.02:47:06]

While setting up orthanc, I have seen the C-ECHO fail, with the following logged:

`HttpServer.cpp:824] POST /modalities/MYAET/echo`

`OrthancException.h:86] Bad file format: Must provide a JSON object`

With orimus docker versions 20.5.0 and 20.5.1, C-ECHO works as expected. Versions 20.5.2 and above fail.  
This was tested using docker compose with two peer orthanc instances, running the same version of the docker image.

There were no special settings in orthanc.json.

\(I am not sure whether this counts as a major or minor bug. While not impeding the flow of normal data it is a major headache when deploying and maintaining Orthanc instances, and may mask other errors.\)
Comment 1 Sébastien Jodogne 2020-06-29 15:17:02 CEST
Created attachment 17 [details]
echo_bug.tar.gz
Comment 2 Sébastien Jodogne 2020-06-29 15:28:18 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2020-06-26.06:47:01]

This is not a bug. Indeed, the error message indicates that you must provide a JSON object. Consider the following Orthanc configuration file:

```
{
  "DicomModalities" : {
    "self" : [ "ORTHANC", "localhost", 4242 ]
  }
}
```

The following call would fail \(no JSON object provided in the body of the HTTP request\):

```
curl -v http://localhost:8042/modalities/self/echo -X POST -d ''
```

But the following call would success:

```
curl -v http://localhost:8042/modalities/self/echo -X POST -d '{}'
```
Comment 3 Sébastien Jodogne 2020-06-29 15:28:20 CEST
[BitBucket user: Nick Farrell]
[BitBucket date: 2020-06-26.09:38:07]

I get this error using the web interface, not the HTTP interface. Perhaps the web plugin does not supply the empty JSON payload when the button is pressed?

If you cannot replicate this I can provide a docker compose setup which will allow you to do so yourself, manually.

Rgards,

Nick.
Comment 4 Sébastien Jodogne 2020-06-29 15:28:21 CEST
[BitBucket user: Nick Farrell]
[BitBucket date: 2020-06-26.09:50:26]
Comment 5 Sébastien Jodogne 2020-06-29 15:28:22 CEST
[BitBucket user: Nick Farrell]
[BitBucket date: 2020-06-26.09:51:45]

If you untar the attached file and execute the dev script, you will see that the echo test to the adjacent orthanc instance fails, using the web interface on port 8042.

Simply modify the anonymiser yaml’s image to 20.5.1 and it will work.
Comment 6 Sébastien Jodogne 2020-06-29 15:28:23 CEST
[BitBucket user: Nick Farrell]
[BitBucket date: 2020-06-26.09:57:20]

What you say above in your comment is partly correct. I do have an automated test below, and it works with 20.5.1 but not 20.5.2, possibly as it validates the json being POSTed. However, the web interface appears to not have been updated when this change was made.



```python
def test_c_echo() -> None:
    post(segment="/modalities/TrafficControl/echo", hostname="anonymiser", data="")
```
Comment 7 Sébastien Jodogne 2020-06-29 15:28:24 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2020-06-27.08:50:31]

I thank you for your patience and for your explanations, and I confirm that there was indeed a bug in Orthanc Explorer. This is fixed by the following changeset, that will be part of forthcoming 1.7.2 release: https://hg.orthanc-server.com/orthanc/rev/ce7709cb380e