Select to view content in your preferred language

ArcGIS Server Custom Print (GP) Service Fails to Produce PDF output

5460
15
Jump to solution
04-30-2021 02:18 PM
Arne_Gelfert
Regular Contributor

Struggling with migration of an existing ArcGIS Server custom print service (GP Service). Basically this used the steps here to publish some custom layouts via the ExportWebMap/GetLayouttemplates server tools, as explained here.

This is working in 10.6 but not in my new 10.8 environment. I thought the issue was on the publishing end. But even after upgrading Pro to match AGE 10.8, creating new Layout files (PAGX) and republishing, the problem persists.

Here is what I'm seeing when sending webmap JSON to service from a custom Print widget in WAB ('custom' does not imply Wild West - I made some tweaks to the Print widget and this has worked just fine in 10.6).

The REST endpoint URL for the custom print service is hardcoded into the Print widget's in the WAB app's folder:

apps\my_app\configs\Print\config_widgets_Print_Widget_NaN.json

Even before submitting print job, Dev Tools informs me when opening Print widget:

 

Get Layout Templates Info Error Error: Invalid URL
    at Object.B.f.load (init.js:957)
    at init.js:88
    at c (init.js:104)
    at e (init.js:104)
    at b.Deferred.resolve.callback (init.js:105)
    at c (init.js:105)
    at e (init.js:104)
    at b.Deferred.resolve.callback (init.js:105)
    at init.js:93
    at m (init.js:108)

 

After submitting, job fails:

 

Error: esriJobFailed
    at Object._handler (PrintTask.js:7)
    at init.js:64
    at b (PrintTask.js:13)
    at Object._successHandler (init.js:2371)
    at Object._jobUpdateHandler (Geoprocessor.js:11)
    at init.js:64
    at Object.load (Geoprocessor.js:11)
    at init.js:973
    at c (init.js:104)
    at e (init.js:104)

 

The 'Geoprocessor' line goes back to '_getJobStatus' when trying to go a jobs folder.

Similary, in my AGS log file, I see an issue with getting to a PDF file ...

 

<?xml version="1.0" encoding="utf-8" ?>
<Msg time='2021-04-30T15:35:38,218' type='SEVERE' code='20010' target='customPrinting/my_failing.GPServer' methodName='GPServerSync.CheckMessages' machine='<my_server>' process='8608' thread='12016' user='null'  requestId='7dd6ba0a-ea9a-4ce1-aba8-c657f4ef8999'>Error executing tool.
Export Web Map Job ID: j715e45d677d6477ab46a9f72a68c15b5 : error raised...

E:\arcgisserver\directories\arcgisjobs\customprinting\my_failing_gpserver\j715e45d677d6477ab46a9f72a68c15b5\scratch\9e42231a-a9f3-11eb-9e8f-005056a6efee.pdf

E:\arcgisserver\directories\arcgisjobs\customprinting\my_failing_gpserver\j715e45d677d6477ab46a9f72a68c15b5\scratch\9e42231a-a9f3-11eb-9e8f-005056a6efee.pdf

Failed to execute (Export Web Map).
Failed to execute (Export Web Map).
</Msg>

 

My suspicion was that service is trying to write a PDF and lacks permissions (for whatever reason). But even granting AGS account full control over the 'directories' folder , it fails. 

Any suggestions what else I can check? I'm not sure if it's an issue with getting to the templates - I see the template files in the service directory on the AGS machine after publishing - or with creating a PDF output file, or both. 

This is published as 'Asynchronous'.

0 Kudos
15 Replies
MikeBrannagan
New Contributor II

OK - I'm likely making a mess here trying different things.  This print widget is from an ArcMap template and is missing the Get Layout Templates task - so that is likely why I'm getting the "Get Layout Templates Info Error". So I need to figure out why that didn't upload when I published the service.

I did try publishing from ArcGIS Pro and got a different error "Unable to complete operation." Missing or Invalid layout template file is the error when I hover over the red exclamation point on the Print Widget.

0 Kudos
MikeBrannagan
New Contributor II

Well - as expected - now that I have the Get Layout Templates published - no errors.  However my custom text elements didn't fill out - but I was prompted to enter data (although I'm trying to have it pull from a selected parcel automatically).

I shouldn't have posted until I had made sure I had everything uploaded.

0 Kudos
TanuHoque
Esri Regular Contributor

@MikeBrannagan 

Did I get it right that you published your print service from ArcMap? if so, then the patch is not going to work. Those patches were explicitly for print services published from Pro and when your output format is pbf.

 

Regarding publishing from ArcGIS Pro, did you try steps provided in the help topic below? And still you are running into some issues?
https://enterprise.arcgis.com/en/server/latest/publish-services/windows/tutorial-publish-additional-...

Please note, you must re-author layout template from ArcGIS Pro; you can't use layout templates i.e. mxd in a print service published from Pro... One shortcut would to be import mxd in Pro and then save your layouts as .pagx files.

Note: if you move to ArcGIS Pro 3.0 or later AND authored your layout templates in Pro 3.0 or above, you must publish to 11.0 or above server.

ArcGIS Pro 3.0 or above + .pagx files authored in pre 3.0 --> then you can publish a print service to a pre 11.0 server.

MikeBrannagan
New Contributor II

Yes - so I had tried with ArcGIS Pro and got a different error "Unable to complete operation." Missing or Invalid layout template file is the error when I hover over the red exclamation point on the Print Widget. So that is likely because I'm at ArcGIS Pro 3.0 like you said.  After trying with Pro and it not working I tried with ArcMap - so looks like I need to drop my Pro version back down to something pre 3.0 and see if that is the answer.

I appreciate the help Tanu - thank you.

NTSAdministrator
New Contributor II

Hi @TanuHoque ,

I created my custom print layouts in ArcGIS Pro 3.0 and published to my Enterprise Portal 10.9 following the documentation you referenced.

When I try to print the map in Map Viewer Classic I get an error " An error occurred while creating the printed map". On the Arc GIS Server Manager Logs it says "Error executing tool. Export Web Map : Missing or invalid layout template file. Failed to execute (Export Web Map)."

Are you saying in order for the Printing Service to work I need to upgrade to Enterprise Portal 11.0 or create and publish layouts from an pre 3.0 Arc Pro project? 

0 Kudos
TanuHoque
Esri Regular Contributor

hi @NTSAdministrator 


Are you saying in order for the Printing Service to work I need to upgrade to Enterprise Portal 11.0 or create and publish layouts from an pre 3.0 Arc Pro project? 


That is correct. Either you need to upgrade to Enterprise 11.0 or above or use ArcGIS Pro 2.9 or older.

ArcGIS Enterprise 10.9 has ArcGIS Pro 2.x runtime. As you know Pro 3.0 is a major upgrade and any project or project item such as mapx, pagx, aprx etc. that you create in 3.0 can't be opened directly in ArcGIS Pro 2x.

That is why when you create layout templates (.pagx files) in 3.0 and share them as part of a print service in 10.9.1 or older, it can't open because it only knows how to open pagx files created in 2.x not in 3.x.

I hope this helps. Apologies that it is not as straight forward 😞