Select to view content in your preferred language

Custom Print Service Failing

10527
26
Jump to solution
07-07-2022 03:27 PM
LeviRoberts
Occasional Contributor

We are using ArcGIS Enterprise 9.1 and are trying to publish custom printing services from ArcPro 3.0.

We have followed very closely to the two resources listed below. And we are experiencing inconsistent results.

Share custom layouts for printing from ArcGIS Pro

Enabling High-Quality Printing in Web Applications

The error we are now consistenly recieving is "Error executing tool. Export Web Map : Missing or invalid layout template file. Failed to execute (Export Web Map)."

We have tried a variety of layouts, from including titles and overview maps like in the video, to including nothing but the WEBMAP_MAP_FRAME. It will print the "MAP ONLY" option, but when we try printing any custom layouts it will fail.

The default printing service works fine, and the custom services we built in ArcMap are still working, but anything in Pro is failing us.

In this session, techniques will be described and demonstrated for exporting high quality maps from web applications. We will cover creating printed PDF documents, printing to scale, leveraging ArcGIS Pro layouts, displaying all content on the map, modifying the map content during the export ...
26 Replies
LeviRoberts
Occasional Contributor

I wanted to post a follow up with some of our findings in case others run into similar issues, and also in case an ESRI rep sees this. It might be useful to know that all of this testing was in Chrome.

Publishing printing services from ArcPro 3.0 seems to not work, not matter what. We've tested this with services in the map and without services in the map. We've cleared caches, cookies, histories and everything else. No matter what we do, we always get the same error.

Error executing tool. Export Web Map : Missing or invalid layout template file. Failed to execute (Export Web Map).

Because of this thread, we scaled back to ArcPro 2.9. At this point we started having some inconsistent behavior with our printing services, but only when we had a map layer that required a password. If all the layers in the web app were public, we did not experience any errors. The error always followed the same format.

Error executing tool. Export Web Map : Layer "[secure layer name]": Unable to connect to map server at [secure layer url]. Failed to execute (ExportWebMap). Failed to execute (Export Web Map).

ESRI support told me that the issue might be with our ArcGIS Server maching using a self signed certificate, which is what ESRI recommends in the first place, but as I've tested it seems certificates have nothing to do with it.  I still have not nailed down what triggers the failures to start, but what we've realized is that it has something to do with cookies, at least in Chrome. Most recently I had two printing services in one web app that contained a secured layer, one printing service was created from ArcMap and the other from ArcPro. Once I cleared the cookies they both ran fine. What is odd though is I then published a new printing service to our server, and suddenly our printing services errored out and we received the above error again. I cleared the cookies and that resolved the issue.

¯\_(ツ)_/¯

NickN
by
Occasional Contributor

I was running into the "Error executing tool. Export Web Map : Failed to create layer from service at https://xxxxxxxx. Failed to execute (Export Web Map)." error as well which led me to this thread. Your message about cookies led me to try using it in an incognito window. Lo and behold it worked, so clearing cookies was the solution for me as well.

For anyone else viewing this thread the error only occurred if I had a secured layer turned on. If only public layers were on the error did not occur. Clearing the cookies was the only way to get the print to work with secured layers visible.

0 Kudos
GJY
by
New Contributor III

@LeviRoberts thank you for this, I was about to dive down an SSL/cert rabbit hole before I read this, clearing cookies saved the day!

0 Kudos
vijaybadugu
Occasional Contributor II

I am facing same error. Error executing tool. Export Web Map : Missing or invalid layout template file. Failed to execute (Export Web Map).

0 Kudos
by Anonymous User
Not applicable

Hi @LeviRoberts, I am in the same boat as you with your second error. 

The behaviour is described in this article here - Print maps that contain secured services 

Essentially because your GIS Server has a self signed certificate (which you correctly noted is the standard practice), the print service is unable to use the Portal referrers token to access the secured services. 

There are two workarounds, Short Term Tokens and Embedding credentials into a service:

Short Term Tokens:

- if your services have short term tokens enabled (which is default and recommended) then if you start your session by going directly to your web app, then you will be prompted to sign in to the web app. This will generate a token that is stored in the web map, which is then passed to the Print Service which can then successfully access your secure services. You should be able to replicate this easily - copy the URL of your web app, open an incognito/private browser window and paste your web app URL. Sign in to your portal account, and then you should be able to print any of your secured services. 

This is obviously an annoying workaround. 

Embedding credentials into a service:

- You can create a python script that uses the Convert Web Map To ArcGIS Project function, and embed credentials to your site into this script with the ImportCredentials function. 

There are examples of how to use this in ConvertWebMapToArcGISProject example 8

-------------------------------------------------------

This is where I am stuck, because I cannot get the script to work. We have no registered folders for our server so rely on copying the templates, but every way I try to use this function as per the example, I just get errors and fail the script. 

 

Would love to know if anyone else has used this script and if they have the same errors, or are successful. 

 

Now this is where

0 Kudos
Pei-SanTsai
New Contributor III

I'm having problem to get the script to work & I have tried other method, haven't get it worked.  The ArcMap version was way much easier.  

0 Kudos
TomThompson41
New Contributor

This is a known bug with publishing custom layouts from ArcGIS Pro v3.0:

BUG-000151319: When publishing a custom print service to Portal 10.9.1 with custom print templates created or modified in ArcGIS Pro 3.0, the templates are not detectable by widgets in Web AppBuilder and REST.

 

This issue will arise in Enterprise 10.9.1, and 10.8.1, and potentially later version. 

 

Work around is to leverage Pro v2.9.x to create the layouts as noted in the solution by @BenClark 

0 Kudos
TomThompsonEsriCA
Esri Contributor

This is a known bug with publishing custom layouts from ArcGIS Pro v3.0:

BUG-000151319: When publishing a custom print service to Portal 10.9.1 with custom print templates created or modified in ArcGIS Pro 3.0, the templates are not detectable by widgets in Web AppBuilder and REST.

 

This issue will arise in Enterprise 10.9.1, and 10.8.1, and potentially later version. 

 

Work around is to leverage Pro v2.9.x to create the layouts as noted in the solution by @BenClark 

JeffLegato1
Occasional Contributor

Thanks. We were suffering from this bug as well but were able to overwrite our fresh incompatible 3.0 print templates and republish the print service from an older version of Pro. Our IT are hesitant to upgrade to Enterprise 11 because we have some 3rd party workflows that will need to be tested to ensure compatibility. 

0 Kudos
TanuHoque
Esri Regular Contributor

hello all,

We are using ArcGIS Enterprise 9.1 and are trying to publish custom printing services from ArcPro 3.0.

When you publish* a print service from ArcGIS Pro 3.0, your Enterprise server must be 11.0 or above.

* more precisely when you create a layout template (aka pagx file) from Pro 3.0.

 

As you know ArcGIS Pro 3.0 is a major release. Document types such as projects, maps etc. that you create in 3.0 can't be directly opened in 2x. If you must share with older client, then you need share that out as project package, map package etc.

Since Enterprise 10.9.1 is an older version and it not aware of 3.0 changes, a print service running on 10.9.1 can't recognize layout templates created from 3.0 (even when you publish it from 3.0).

Please let me know if you have any question.