No 'Access-Control-Allow-Origin' Error from AGOL

3598
10
08-15-2016 09:27 AM
MichaelPorter1
New Contributor III

When I try and load an application from AGOL - I get the following error in the console:

XMLHttpRequest cannot load http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer?f=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://[domain].maps.arcgis.com' is therefore not allowed access.

where [domain] is my company domain. The problem occurs only in Chrome and only in certain instances of Chrome. Security folk swear all installs are the same.

I see the threads talking about this when you are writing the JS (i.e. How to use Cross Origin Resource Sharing (CORS) from ArcGIS API Javascript Application? - Geographic... ) . Any guesses or suggestions on how to handle / troubleshoot when you are using an AGOL app? Is it possible that this is a red herring and that it is actually masking another problem?

Thanks

Tags (3)
0 Kudos
10 Replies
KatieCullen
Regular Contributor II

Hi Michael,

Is the application publicly available? Are any of the layers in the application coming from ArcGIS for Server? In addition what is the Chrome version being used? 

Thanks,

Katie

0 Kudos
MichaelPorter1
New Contributor III

Hi Katie,

Attached is my console dump for navigating to and opening an app on AGOL.

Thanks

0 Kudos
MichaelPorter1
New Contributor III

Hi Katie,

Now it's sporadic in ie as well. I think version 52. All layers are hosted on agol and are pwd protected.

Thanks for your help!

Sent from my iPhone

0 Kudos
MichaelPorter1
New Contributor III

- No it is not publicly available.

- All layers are hosted feature services on AGOL

- Chrome version 52.0.2743.116

Is now sporadically not working on ie. Could get it to work in Chrome if used the following command line options:

c:\Program Files\Google\Chrome\Application\chrome.exe --disable-web-security --user-data-dir

0 Kudos
MichaelPorter1
New Contributor III

Here is my console dump:

Load arcgis.com

Exception in onResRdy: TypeError: Cannot read property 'htmlRes' of undefined
main.js:59 Uncaught ReferenceError: arcgismicrosite is not definedinit @ main.js:59(anonymous function) @ VM294:1
init.js:157 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
VM317:1 GET http://dnn506yrbagrg.cloudfront.net/pages/scripts/0006/8609.js?408709 net::ERR_TOO_MANY_REDIRECTS(anonymous function) @ VM317:1
PardotTagManager.js:52 domain www.arcgis.com not found

Click "Sign In"

Exception in onResRdy: TypeError: Cannot read property 'htmlRes' of undefined
config.js:559 cdn server url: //cdn.arcgis.com/cdn/10175
about:blank:1 Invalid 'X-Frame-Options' header encountered when loading 'https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id=arcgisonline…display=iframe&parent=ht... 'ALLOW-FROM https://www.arcgis.com' is not a recognized directive. The header will be ignored.
ContentScript.js:84 Exception in onResRdy: TypeError: Cannot read property 'htmlRes' of undefined

Sign In

Exception in onResRdy: TypeError: Cannot read property 'htmlRes' of undefined
2index.html:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.
config.js:559 cdn server url: //cdn.arcgis.com/cdn/10175
4index.html:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.

My Content

content.html:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.
ContentScript.js:84 Exception in onResRdy: TypeError: Cannot read property 'htmlRes' of undefined
content.html:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.
config.js:559 cdn server url: //cdn.arcgis.com/cdn/101752
content.html:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.

Open Application

item.html?id=d52cfae…:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.
ContentScript.js:84 Exception in onResRdy: TypeError: Cannot read property 'htmlRes' of undefined
item.html?id=d52cfae…:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.
config.js:559 cdn server url: //cdn.arcgis.com/cdn/10175
6item.html?id=d52cfae…:1 Redirect at origin 'http://cdn.arcgis.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://nycdohmh.maps.arcgis.com' is therefore not allowed access.

0 Kudos
KatieCullen
Regular Contributor II

Hi Michael,

I apologize for my silence, I was in training the past two days. I will take some time to review this additional information you provided. In the end we may need to create a support case to address this question. If that is the case I can get this created for you.

Thanks!

Katie

0 Kudos
MichaelPorter1
New Contributor III

Thanks

May be no need. IT called in Proxy folk and it looks like problem is fixed.

I'll update you as this progresses.

Thanks for your help!

0 Kudos
KatieCullen
Regular Contributor II

Hi Michael,

I just wanted to circle back with you and see if you are still experiencing any issues. Please let me know if you need to look into this question further.

Thanks,

Katie

0 Kudos
JaviMollà
New Contributor

Hi

How did they resolved the problem? We're facing the same trouble

Thanks

0 Kudos