Empty Reply from Server

I’ve been using Orthanc without issue for a few months now to perform migration tasks and then out of the blue, I started getting an “empty reply from server” returned.

When I issue a manual command with the -vv at the end, this is what I get

* Trying IPADDRESS…
* TCP_NODELAY set
* Connected to IPADDRESS (IPADDRESS) port 8042 (#0)
* Server auth using Basic with user ‘USERNAME’
> POST /modalities/MCPROD1/store HTTP/1.1
> Host: IPADDRESS:8042
> Authorization: Basic REDACTED==
> User-Agent: curl/7.58.0
> Accept: /
> Content-Length: 7944
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
* Done waiting for 100-continue
* We are completely uploaded and fine
* Empty reply from server
* Connection #0 to host 10.36.227.230 left intact
curl: (52) Empty reply from server

Not really sure what’s causing this out of the blue like this. Any ideas?

Please post a complete minimal working example so that other people can reproduce your issue, otherwise it is not possible to provide any support:
https://book.orthanc-server.com/users/support.html

Ok, so what I’m essentially doing is sending a selection of DICOM instances to another modality (McKesson Cardiology PACS).

I issue a POST command to Orthanc’s REST api to accomplish this.

First, I gather my list of studies by using:

curl -X POST --user USERNAME:PASSWORD http://IPADDRESS:8042/tools/find -d ‘{“Level”:“Study”,“Expand”:false,“Query”:{“StudyDate”:“20170801-20170831”}}’

This returns a list of studies for the month of August, 2017.

Then I issue the following command to store the above list to my McKesson C-PACS:

curl -X POST -u USERNAME:PASSWORD http://IPADDRESS:8042/modalities/MCPROD1/store -d ‘[“c4d4d00a-8dd087cb-432a37de-68550505-d0d63070”,“96ad7dff-f8713642-ac0f060a-de40f60e-97b4c705”,“aac7f73f-fcb922ef-b950c4c1-ee1d512e-e2aeb5ae”,“3a8aafa6-3c461989-fe620e53-86c8b34a-6090a875”,“94c7e2bf-23dce14c-8920c4cb-4c93cccc-53f754db”,“12a24226-56314ea4-09b01751-ba21bc33-b00146e7”,“6d052217-ff8ee4ea-32936542-22c78284-b83c6566”,“48973c9c-72364569-64261903-5c3e2db1-ad2f8377”,“598861f5-e4c78dba-8d4749fe-c6488c92-67c31f75”,“819d473e-bda92e11-e67d98f3-e9cd13c7-de3bb5b0”,“636a0e2b-51705ce0-1cea2f93-c0f9e188-4c459b4f”,“aae1401d-6f6f41b2-70c2692c-fc37e281-e7eaf431”,“02d95850-c15b985d-61da1bd8-202bbfa6-fb4bf910”,“0a4dd725-740267f1-6c67941e-8332ece0-295effef”,“52ee2d10-b2ffcc9f-28c7cf9d-f71e49e8-f455aad5”]’

I just thought to check the Orthanc logs and I find this error:

E0423 10:18:01.647147 PluginsManager.cpp:164] MySQL error (2006,HY000): MySQL server has gone away

W0423 10:18:01.647147 PluginsManager.cpp:168] An active MySQL transaction was dismissed

E0423 10:18:01.647147 PluginsManager.cpp:164] MySQL error (2006,HY000): MySQL server has gone away

E0423 10:18:01.647147 PluginsManager.cpp:164] The database is not available, closing the connection

E0423 10:18:01.647147 PluginsManager.cpp:164] Cannot rollback a non-existing transaction

MySql is running fine and I can use the Orthanc webgui fine as well as issue queries and send commands using the Orthanc Tools java application that is widely discussed.

Not sure why I can’t issue the same command using REST.

Wonder if network security implemented a firewall I’m not aware of??

I’m also, strangely, getting an error on the http side:
Your Orthanc server is accepting remote connections, but is using the default username and password, or has user authentication explicitly turned off. Please carefully read your logs and review your configuration, especially options RemoteAccessAllowed, AuthenticationEnabled, and RegisteredUsers.

When I am NOT using the default username/password at all and everything is configured correctly in the settings file. I have authentication enabled and registered users set up.
/**

  • Security-related options for the HTTP server
    **/

// Whether remote hosts can connect to the HTTP server
“RemoteAccessAllowed” : true,

// Whether or not SSL is enabled
“SslEnabled” : false,

// Path to the SSL certificate in the PEM format (meaningful only if
// SSL is enabled)
“SslCertificate” : “certificate.pem”,

// Whether or not the password protection is enabled (using HTTP
// basic access authentication). Starting with Orthanc 1.5.8, if
// “AuthenticationEnabled” is not explicitly set, authentication is
// enabled iff. remote access is allowed (i.e. the default value of
// “AuthenticationEnabled” equals that of “RemoteAccessAllowed”).
/**
“AuthenticationEnabled” : true,
**/

// The list of the registered users. Because Orthanc uses HTTP
// Basic Authentication, the passwords are stored as plain text.
“RegisteredUsers” : {
“USER1” : “PASSWORD1”,“USER2” : “PASSWORD2”,“USER3” : “PASSWORD3”
},

Hi Steve,

For the last problem:

/**
“AuthenticationEnabled” : true,
**/

Authentication is actually commented out !

This excerpts of the log clearly indicates a problem with your MySQL server:

E0423 10:18:01.647147 PluginsManager.cpp:164] MySQL error (2006,HY000): MySQL server has gone away
W0423 10:18:01.647147 PluginsManager.cpp:168] An active MySQL transaction was dismissed

E0423 10:18:01.647147 PluginsManager.cpp:164] MySQL error (2006,HY000): MySQL server has gone away

E0423 10:18:01.647147 PluginsManager.cpp:164] The database is not available, closing the connection

E0423 10:18:01.647147 PluginsManager.cpp:164] Cannot rollback a non-existing transaction

If MySQL is not available, even temporarily, Orthanc is evidently unable to store DICOM images.