Replicate error

hello its me again bumbling through…
after finding the replicate script, running into the weird authenticate error : “https://groups.google.com/g/orthanc-users/c/KZ_iYOet5IQ/m/AUQWiSiAAQAJ
and fixing that, i am now running into this wall:

From Target System
“Sending study 3ab67604-18c3d3cc-880f80fc-1d445b9b-8e9a1dab…
Traceback (most recent call last):
File “Replicate.py”, line 113, in
DoPostDicom(‘%s/instances’ % TARGET, dicom)
File “Replicate.py”, line 92, in DoPostDicom
raise Exception('Unable to contact Orthanc at: ’ + url)
Exception: Unable to contact Orthanc at: http://localhost:8042//instances

From Source System
“Sending study 3ab67604-18c3d3cc-880f80fc-1d445b9b-8e9a1dab…
Traceback (most recent call last):
File “Replicate.py”, line 117, in
DoPostDicom(‘%s/instances’ % TARGET, dicom)
File “Replicate.py”, line 96, in DoPostDicom
raise Exception('Unable to contact Orthanc at: ’ + url)
Exception: Unable to contact Orthanc at: http://192.168.20.119:8042//instances

its the first study so i dunno, now both systems are in the same subnet, both have 4 terabytes of free storage(well the source system has 3.4, so say 660 gigs of data to move?/thousands of studies at least), both have 40 GB of ram.

granted some studies can reach 2gb in file size when downloaded. any suggestions on modifying the script so i can get a better error msg?

Hi,

No need to change the script, it is likely a network configuration error.

You should first play with ping, telnet and curl to validate that you can access the target.
e.g from source system:
ping 192.168.20.119 should tell you if there is a chance of connection (note however that ping might be blocked by your target firewall)
telnet 192.168.0.8 8042 should tell you if the firewall are configured correctly and Orthanc is reachable. If you get “Unable to connect”, check your target firewall settings.
curl http://localhost:8042/system should tell you if you need credentials or not to connect to Orthanc

Once you get an answer from curl, you may start running your script

HTH

Alain.

hello alain!
today ive been playing with the network, ping works, ssh works.
ufw is configured correctly

" *****@imeprov01pacs:~$ ping -c30 192.168.20.119
PING 192.168.20.119 (192.168.20.119) 56(84) bytes of data.
64 bytes from 192.168.20.119: icmp_seq=1 ttl=64 time=0.920 ms

64 bytes from 192.168.20.119: icmp_seq=30 ttl=64 time=0.727 ms

— 192.168.20.119 ping statistics —
30 packets transmitted, 30 received, 0% packet loss, time 29651ms
rtt min/avg/max/mdev = 0.457/0.641/0.920/0.097 ms"

sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To Action From


22/tcp (OpenSSH) ALLOW IN Anywhere
80/tcp (Apache) ALLOW IN Anywhere
443/tcp ALLOW IN Anywhere
4242 ALLOW IN Anywhere
8042 ALLOW IN Anywhere

curl results:

  1. from source to target system
    "*****@imeprov01pacs:~$ curl --verbose -u : http://192.168.20.119:8042/system
  • Trying 192.168.20.119:8042…
  • TCP_NODELAY set
  • Connected to 192.168.20.119 (192.168.20.119) port 8042 (#0)
  • Server auth using Basic with user ‘falr’

GET /system HTTP/1.1
Host: 192.168.20.119:8042
Authorization: Basic
User-Agent: curl/7.68.0
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Connection: keep-alive
    < Keep-Alive: timeout=1
    < Content-Type: application/json; charset=utf-8
    < Content-Length: 395
    <
    {
    “ApiVersion” : 16,
    “CheckRevisions” : false,
    “DatabaseBackendPlugin” : “/usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so”,
    “DatabaseVersion” : 6,
    “DicomAet” : “IMEPROSPS”,
    “DicomPort” : 4242,
    “HttpPort” : 8042,
    “IsHttpServerSecure” : true,
    “Name” : “Imepro San Pedro Sula”,
    “PluginsEnabled” : true,
    “StorageAreaPlugin” : null,
    “Version” : “1.10.1”
    }
  • Connection #0 to host 192.168.20.119 left intact
  1. to localhost
    *****@imeprov01pacs:~$ curl --verbose -u : http://localhost:8042/system
  • Trying 127.0.0.1:8042…
  • TCP_NODELAY set
  • Connected to localhost (127.0.0.1) port 8042 (#0)
  • Server auth using Basic with user ‘falr’

GET /system HTTP/1.1
Host: localhost:8042
Authorization: Basic
User-Agent: curl/7.68.0
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 200 OK
    < Connection: keep-alive
    < Content-Type: application/json; charset=utf-8
    < Content-Length: 427
    <
    {
    “ApiVersion” : 4,
    “DatabaseBackendPlugin” : “/usr/lib/orthanc/libOrthancPostgreSQLIndex.so.3.2-1ubuntu4”,
    “DatabaseVersion” : 6,
    “DicomAet” : “IMEPROVILLANUEVA”,
    “DicomPort” : 4242,
    “HttpPort” : 8042,
    “IsHttpServerSecure” : true,
    “Name” : “ImeproVillanueva”,
    “PluginsEnabled” : true,
    “StorageAreaPlugin” : “/usr/lib/orthanc/libOrthancPostgreSQLStorage.so.3.2-1ubuntu4”,
    “Version” : “1.5.8”
    }
  • Connection #0 to host localhost left intact

and still this is the result i get:
*****@imeprov01pacs:/usr/share/doc/orthanc/Samples/Python$ python3 Replicate.py http://*****:*****@localhost:8042/ http://192.168.20.119:8042/
Sending study 3ab67604-18c3d3cc-880f80fc-1d445b9b-8e9a1dab…
Traceback (most recent call last):
File “Replicate.py”, line 117, in
DoPostDicom(‘%s/instances’ % TARGET, dicom)
File “Replicate.py”, line 96, in DoPostDicom
raise Exception('Unable to contact Orthanc at: ’ + url)
Exception: Unable to contact Orthanc at: http://192.168.20.119:8042//instances

i know the new server is working correctly because ive been able to upload files manually to the webviewer, and directly from the dicom equipment so i have the last day or 2 of studies inside to test, the old system was using postgresql for storage the new one is using the filesystem(already checked for permissions errors in the orthanc logs, nope).

im gona keep trying and if i resolve this ill update.
in the meantime any suggestions are welcome

The script is trying to reach http://192.168.20.119:8042//instances (there is a double / ). Try changing it to http://192.168.20.119:8042/instances

hello all and for the ppl reading this in the future… got it working.
and sadly no frank it wasn’t that, it was something much more simple: it requires authentication in both parameters, not just in one.

the example provided in the orthanc book read like this:

"$ python Replicate.py http://orthanc:password@localhost:8042/ http://192.168.0.2/ "

and per my examples previously i tried that and the script did not provide any feedback indicating an auth issue.

so (sadly i did not think of this before wasting so many hours) i said to myself, lets try giving both the source and the target user and passwords

****@imeprov01pacs:/usr/share/doc/orthanc/Samples/Python$ python3 Replicate.py http://user:password@localhost:8042/ http:// user:password@ @192.168.20.119:8042/
and that my friends got the script going, right now 20 something gigs of 660 have been moved.
ohh something else, if there is an interrupt in the console (like for copying a line of text for posting on the web…) the script does not resume where it left off, it starts from the first study all over again

1 Like