Issue78

Title Orthanc shall display the cUrl error code in his logs
Priority wish Status resolved
Superseder Nosy List admin
Assigned To
Keywords Orthanc Core

Created on 2017-12-13.10:22:22 by admin, last changed by admin.

Messages
msg351 (view) Author: admin Date: 2017-12-13.10:22:22
[BitBucket user: Alain Mazy]
[BitBucket date: 2017-12-13.09:22:22]

any http error leads to the same error message:
```
E1207 14:13:26.928478 22906 StorePeerCommand.cpp:76] Unable to send resource xxx to peer "https://xxx.xxx.xxx/"
E1207 14:13:26.935878 22906 StorePeerCommand.cpp:85] Unable to forward to an Orthanc peer in a Lua script (instance xxx, peer https://xxx.xxx.xxx/): Error in the network protocol
```

We can not differentiate the error.  -> We should at least log the curl error code.  If possible, instead of receiving an 'empty' 400 status code, that would be nice if the curl error code as also included in the HTTP response returned by Orthanc so it can be used by the client making the request.
msg352 (view) Author: admin Date: 2017-12-13.10:24:33
[BitBucket user: Alain Mazy]
[BitBucket date: 2017-12-13.09:24:33]

note that some errors like certificate issues are already differentiated by Orthanc:
```
libCURL error: Peer certificate cannot be authenticated with given CA certificates
```
msg353 (view) Author: admin Date: 2018-01-17.21:37:39
[BitBucket user: Alain Mazy]
[BitBucket date: 2018-01-17.20:37:39]

well, after a code review, it seems that any failing curl call is already logged.
That could still be nice to have error details in the HTTP response returned by Orthanc -> lowering the priority.
msg354 (view) Author: admin Date: 2018-01-18.10:49:24
[BitBucket user: Alain Mazy]
[BitBucket date: 2018-01-18.09:49:24]

got the problem again while using the dicom-web plugin.  Here's a full excerpt of the logs:
Forwarding study to dicom-web server xxx
```
E0118 09:37:35.886484 PluginsManager.cpp:197] Exception while invoking plugin service 27: Error in the network protocol
E0118 09:37:35.886522 PluginsManager.cpp:164] Cannot issue an HTTP query to https://xxx.xxx/dicom-web/studies (HTTP status: 0)
E0118 09:37:35.887153 PluginsErrorDictionary.cpp:111] Exception inside the plugin engine: Error in the network protocol
Failed to forward study: Orthanc HTTP API exception: '500 - Unknown Orthanc HTTP Rest API exception' while accessing 'http://localhost:8042/dicom-web/servers/xxx/stow'
```
msg355 (view) Author: admin Date: 2018-07-26.12:28:03
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2018-07-26.10:28:03]

A new Orthanc configuration option `HttpVerbose` has been introduced by the following changeset: https://hg.orthanc-server.com/orthanc/changeset/959bd8857eb5a98a0976f95fdee1d7712f7aa694

Please could you try again if this new feature fills your needs, by setting `HttpVerbose` to `true` and by running in `--verbose` mode?
msg356 (view) Author: admin Date: 2020-06-16.14:41:09
[BitBucket user: Alain Mazy]
[BitBucket date: 2020-06-16.12:41:09]

I’ve tried again to fail a transfer from DicomWeb, we now get plenty of details:

```
I0616 14:39:18.207275 JobsRegistry.cpp:712] New job submitted with priority 0: c6801429-743e-4418-917b-4d1bfee12016
I0616 14:39:18.215273 JobsEngine.cpp:144] Executing job with priority 0 in worker thread 0: c6801429-743e-4418-917b-4d1bfee12016
E0616 14:39:20.442945 HttpClient.cpp:68] Error code 7 in libcurl: Couldn't connect to server
I0616 14:39:20.449741 HttpClient.cpp:970] HTTP status code 0 in 2216 ms after POST request on: http://localhost:20042/dicom-web/studies
E0616 14:39:20.459740 OrthancException.h:87] Error in the network protocol: libCURL error: Couldn't connect to server
E0616 14:39:20.480779 PluginsManager.cpp:197] Exception while invoking plugin service 34: Error in the network protocol
E0616 14:40:06.149150 PluginsManager.cpp:164] Error in a job: Error in the network protocol
I0616 14:40:07.798149 JobsRegistry.cpp:486] Job has completed with failure: c6801429-743e-4418-917b-4d1bfee12016
```

closing the issue..
History
Date User Action Args
2026-07-29 15:51:21admincreate