Viewers: Unable to load studies from Orthanc...getting "Cross-Origin Request Blocked" errors

Created on 23 Apr 2020  Â·  31Comments  Â·  Source: OHIF/Viewers

On the latest build Im unable to load studies from Orthanc...The browser console shows a bunch of "Cross-Origin Request Blocked" errors. The last build I complied was from about a month back and it works just fine.

Annotation 2020-04-23 214828

Community

All 31 comments

The resource you are requesting is at the same IP/domain, but a different port. Unless you have something in place to set the appropriate CORS headers, this will happen.

What are the steps to reproduce? Can you identify a version where this worked, and then the one where it stopped working?

The resource you are requesting is at the same IP/domain, but a different port. Unless you have something in place to set the appropriate CORS headers, this will happen.

What are the steps to reproduce? Can you identify a version where this worked, and then the one where it stopped working?

I'm getting the issue weather the study is loaded from the study list or via a direct url. The last build I have that is working correctly is 3.4.1 and the first build Im experiencing the issue on is 3.8.14

What are your steps to reproduce? Are you using the built in docker orthanc command?

What are your steps to reproduce? Are you using the built in docker orthanc command?

I'm building from source and then serving via nginx

What does your nginx configuration look like?

What does your nginx configuration look like?

nginx.txt

What does your nginx configuration look like?

did you find anything in the ngix config file @dannyrb ?

@dannyrb I dont understand why OHIF is accessing http://localhost/dicom-web/ in the attached screenshot. Shouldn't it be trying to access http://localhost:8042/dicom-web/ ?

Annotation 2020-04-24 151037

ok now this is getting weird....some studies are loading just fine(see screenshot)...some partially and other not at all(screenshots already provided)

Annotation 2020-04-24 194611

It's possible 404 or 500 level requests are not appending CORS headers; obfuscating the underlying issue.

It's possible 404 or 500 level requests are not appending CORS headers; obfuscating the underlying issue.

any idea where the issue is? viewer? nginx config?

@dannyrb I dont understand why OHIF is accessing http://localhost/dicom-web/ in the attached screenshot. Shouldn't it be trying to access http://localhost:8042/dicom-web/ ?

Annotation 2020-04-24 151037

@dannyrb this is the thing I'm noticing in all the studies that are failing to load

What does your appConfig look like? How about your series and instance metadata calls?

I'm not sure why you would sometimes hit the route with the port, and other times not. I know some requests are based off location information provided in the metadata.

@dannyrb thank you again for your reply. I have attached my app-config.js file and console log. How do I get series and instance metadata calls(is the attached screenshot sufficent)?

localhost-1587780345480.log

app-config.txt

Annotation 2020-04-25 071101

Does your issue resolve if you modify your appConfig's dicomweb endpoints to use absolute URLs instead of relative URLs?

Does your issue resolve if you modify your appConfig's dicomweb endpoints to use absolute URLs instead of relative URLs?

no it doesn't.

Annotation 2020-04-25 083627

@dannyrb Its just crazy....the older build with the exact same config works fine but the latest one dont. Could it have something to do with the recent metadata overhaul in the 3.7.8+ builds?

@dannyrb I just built 3.7.7(as metadata overhaul is in the 3.7.8+ builds) from source and it works fine.

It's possible, I guess. Its just very odd that this is an intermittent issue depending on the study. I'm not sure I can diagnose further without a docker image or similar reproduction.

I am aware of several larger orgs that are using a post-metadata overhaul version without issue.

It's possible, I guess. Its just very odd that this is an intermittent issue depending on the study. I'm not sure I can diagnose further without a docker image or similar reproduction.

I am aware of several larger orgs that are using a post-metadata overhaul version without issue.

@dannyrb is there anything I can do to help you diagnose the issue? Would it help if I shared a few instances of the studies(or the whole study) causing the issue at my end?

@ranasrule , @dannyrb
This issue is related to something i pointed few days ago : https://github.com/OHIF/Viewers/issues/1602

This problem is related to the bulk/60003000 Route for DICOMWeb while the other route /instance is OK. (look at your screen capture the failing one are /6003000)
This is due to a difference of URI origin interpretation, the bulk/60003000 is taking the URI from dicomweb while the /instance route don't.

Also this route did not benefit of the speed first rendering improvement that was done recently (see https://github.com/OHIF/Viewers/issues/1536)

I think this route still suffers from some inconsistancy compared to the /instance API,

Best regards,

Salim

@ranasrule , @dannyrb
This issue is related to something i pointed few days ago : #1602

This problem is related to the bulk/60003000 Route for DICOMWeb while the other route /instance is OK. (look at your screen capture the failing one are /6003000)
This is due to a difference of URI origin interpretation, the bulk/60003000 is taking the URI from dicomweb while the /instance route don't.

Also this route did not benefit of the speed first rendering improvement that was done recently (see #1536)

I think this route still suffers from some inconsistancy compared to the /instance API,

Best regards,

Salim

@salimkanoun thanks for your reply. So this is a known issue?

Partial issue,

If you configer properly the Host parameter of dicom web plugin of orthanc
you will fly.

The partial issue is that OHIF have different server identification for
these two routes making this problem more difficult to identify

Le dim. 26 avr. 2020 à 01:08, Rana Asim Wajid notifications@github.com a
écrit :

@ranasrule https://github.com/ranasrule , @dannyrb
https://github.com/dannyrb
This issue is related to something i pointed few days ago : #1602
https://github.com/OHIF/Viewers/issues/1602

This problem is related to the bulk/60003000 Route for DICOMWeb while the
other route /instance is OK. (look at your screen capture the failing one
are /6003000)
This is due to a difference of URI origin interpretation, the
bulk/60003000 is taking the URI from dicomweb while the /instance route
don't.

Also this route did not benefit of the speed first rendering improvement
that was done recently (see #1536
https://github.com/OHIF/Viewers/issues/1536)

I think this route still suffers from some inconsistancy compared to the
/instance API,

Best regards,

Salim

@salimkanoun https://github.com/salimkanoun thanks for your reply. So
this is a known issue?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/OHIF/Viewers/issues/1665#issuecomment-619452539, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AGAPT7RHOIDZDYXPDT6MYRTRONUOPANCNFSM4MPG5XLQ
.

Partial issue, If you configer properly the Host parameter of dicom web plugin of orthanc you will fly. The partial issue is that OHIF have different server identification for these two routes making this problem more difficult to identify Le dim. 26 avr. 2020 > .

@salimkanoun can you please guide me regarding how to as you said "configure properly the Host parameter of dicom web plugin of orthanc" ?
Annotation 2020-04-26 041828

in the dicomWeb plugin of Orthanc you have a "host" parameter, this should
have the value of your server address this way the BulkDataURI sent by
orthanc will have the correct value
The other way if you are using a reverse proxy is to give the host value
using Forwarded or Host http header

https://book.orthanc-server.com/plugins/dicomweb.html
https://groups.google.com/forum/#!topic/orthanc-users/DOp8mzaW18c

Le dim. 26 avr. 2020 à 01:15, Rana Asim Wajid notifications@github.com a
écrit :

Partial issue, If you configer properly the Host parameter of dicom web
plugin of orthanc you will fly. The partial issue is that OHIF have
different server identification for these two routes making this problem
more difficult to identify Le dim. 26 avr. 2020 à 01:08, Rana Asim Wajid
[email protected] a écrit :
… <#m_-8237255031458664074_>
@ranasrule https://github.com/ranasrule https://github.com/ranasrule ,
@dannyrb https://github.com/dannyrb https://github.com/dannyrb This
issue is related to something i pointed few days ago : #1602
https://github.com/OHIF/Viewers/issues/1602 <#1602
https://github.com/OHIF/Viewers/issues/1602> This problem is related to
the bulk/60003000 Route for DICOMWeb while the other route /instance is OK.
(look at your screen capture the failing one are /6003000) This is due to a
difference of URI origin interpretation, the bulk/60003000 is taking the
URI from dicomweb while the /instance route don't. Also this route did not
benefit of the speed first rendering improvement that was done recently
(see #1536 https://github.com/OHIF/Viewers/issues/1536 <#1536
https://github.com/OHIF/Viewers/issues/1536>) I think this route still
suffers from some inconsistancy compared to the /instance API, Best
regards, Salim @salimkanoun https://github.com/salimkanoun
https://github.com/salimkanoun thanks for your reply. So this is a known
issue? — You are receiving this because you were mentioned. Reply to this
email directly, view it on GitHub <#1665 (comment)
https://github.com/OHIF/Viewers/issues/1665#issuecomment-619452539>, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AGAPT7RHOIDZDYXPDT6MYRTRONUOPANCNFSM4MPG5XLQ
.

can you please guide me regarding how to as you said "configure properly
the Host parameter of dicom web plugin of orthanc" ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/OHIF/Viewers/issues/1665#issuecomment-619453175, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AGAPT7TNTNGGCVQPJUZZBJ3RONVH7ANCNFSM4MPG5XLQ
.

in the dicomWeb plugin of Orthanc you have a "host" parameter, this should have the value of your server address this way the BulkDataURI sent by orthanc will have the correct value The other way if you are using a reverse proxy is to give the host value using Forwarded or Host http header https://book.orthanc-server.com/plugins/dicomweb.html https://groups.google.com/forum/#!topic/orthanc-users/DOp8mzaW18c Le dim. 26 avr. 2020 à 01:15, Rana Asim Wajid notifications@github.com a écrit :

@salimkanoun Im using a reverse proxy in Nginx. My config file is attached. Can you please show me how to give the host value using Forwarded or Host http header? Ive been pulling my hair out trying to get this to work for the last two days.

What I cant figure out is why all bulk/60003000 requests are directed to "localhost:80" and all others correctly go correctly to http://:8099/orthanc/

nginx.txt

@dannyrb @salimkanoun

Well now things are getting even weirder. Using the attached Nginx config file I'm able to open all studies including bulk/60003000 request ones BUT only as long as I'm accessing OHIF from localhost. When I try to access from another node over the network or the internet all bulk/60003000 requests are directed to "localhost:80"....does this make any sense to you guys?

nginx.txt

@salimkanoun

Ok I think I just fixed it (fingers crossed). In the Orthanc dicomweb.json config file I deleted the "Host" parameter....and that fixed everything. Is there any downside to doing this?

@ranasrule , no that is the good way, this host parameter is deprecated, the informations should come from your reverse proxy http header like i did in PHP

@ranasrule , no that is the good way, this host parameter is deprecated, the informations should come from your reverse proxy http header like i did in PHP

Thanks a bunch for all your help @salimkanoun . Jazakallah.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rlaxodnjs199 picture rlaxodnjs199  Â·  3Comments

AtmiyaVaghela picture AtmiyaVaghela  Â·  4Comments

rossetantoine picture rossetantoine  Â·  5Comments

trung1704ptit picture trung1704ptit  Â·  4Comments

szwang-wthealth picture szwang-wthealth  Â·  3Comments