I have an EB application with a print map tool in it that has been failing regularly lately. There's a lot of weird conditions going on here so I'm going to bullet point all the scenarios:
For reference, we use the standard ArcGIS print service, and all the data in the map we're trying to print is either from our own ArcGIS Online hosted feature services, or a different organization's (our county government) server hosted parcel layer.
I'd check the developer toolbar (f12) and check for errors/info in the tabs. It seems likely it's issues accessing certain layers with different user permissions.
I'll check the developer toolbar, but they were able to use the print map function for over a year with no issue before this started happening. None of the permissions have changed. And in the situations described above, the 2nd and 3rd bullet point describes different users with the same permissions.
I have seen some strange behavior from the print services. in Exb recently too.
Sometimes it requires creating a 'custom' print service when using a custom layout.
If it's failing from different computers I'd be curious if the routing in the network is the same for them when calling the service, or if something in between is blocking them also. when checking the Dev Tools via F12 look for any failing Network requests also.
@TimWestern @DavidPike I finally got the opportunity to look at the computers that were having the issue,. I tested on my own (ArcGIS admin credential) login and on the login credentials of the end users who initially brought this problem to my attention. The map failed to print, and this is the error message I received in the console:
I then proceeded to check on my new laptop, which has never tried to use the print function in ExB, as I've only had this laptop a week, and I received this error on my laptop too.
Edit: I also tested on my desktop, and received the same error, which is new, because I used to not have any problems with the print function on my desktop.
Any advice here? Thanks
Yeah this is the ArcGIS Online CORS Error I've seen before.
Basically its blocking one system (whatever the base url for the experience is from fetching the sharing item there with the token. (I was thinking an item_id should be in the query)
When you setup your experience builder for this did you create an application, setup a client ID
Like in this screen shot?
If so did you click manage, and ensure the host URL under application is correcft and that you have redirect URLs setup (It may look like this:
If you have, then the only other thought I have is that your Administrator may need to do something to enable CORS for your domain where the experience is hosted.
The reason that message occurs is because the layer is loading data from ArcGIS Online in the experience, but since it doesn't recognize the experience request URL hostname or path its blocking it at the AGOL side.
That's what I believe may be going on.
now I saw an example of some extension (may or may not still work in Chrome) over here by @RachelGomez
https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error/td-p/1081694
But this is likely only a temporary fix for testing, the server needs something, or the experience side needs something to be submitted when it makes that call to know it should be 'treated' as a same-origin. (I believe its somewhere in Administration for the server, but I don't have access on our systems to make those kinds of changes to show you an example.)
This article on the ArcGIS Server information might give some clues:
https://enterprise.arcgis.com/en/server/latest/administer/linux/restricting-cross-domain-requests-to...
I don't have an option for a credentials section. I am the org's administrator though, so I can look into the settings and see if there's somewhere where I can enable CORS.
I did look over that other Community post you shared though. Are you suggesting I look into a CORS unblocking extension? Or more along the lines of the marked solution where they have too many features on a layer that has limited features allowed?
The extension would only help for local development I think, if the service/application is needed by multiple people, people outside your network, it's not a great idea to expect everyone to have and know how to configure an extension.
How did you create the experience? Did you go to New App > Create Experience? (this creates it inside of your instance, and is not like a local dev or hosted experience IIRC)
The other is to go to new item
You can create an application there, and you can also setup API Key and OAuth 2.0 Credentials for custom applications.
I'm not sure which you may need most.
I made it over 2 years ago so I'm not positive the method, but I think I created it directly as a new item from the ExB site.
The app is really only used by 2 people, both within my network, so a browser extension would be an easy deploy, assuming our IT team okays that installation.
Let us know if that works in your context. I had never seen this extension before, so don't have an example to test it against.