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

4933
15
Jump to solution
04-30-2021 02:18 PM
Arne_Gelfert
Occasional Contributor III

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
1 Solution

Accepted Solutions
TanuHoque
Esri Regular Contributor

@Arne_Gelfert 

Please make sure the print service Execution Mode is Synchronous. I think WAB print widget does not like async print services.

 

About writing out pdf issue, that was a bug that fix in a 10.8.1 patch. I'd recommend you to upgrade to 10.8.1 and install the following patches.

https://support.esri.com/en/download/7834

https://support.esri.com/en/download/7868

View solution in original post

0 Kudos
15 Replies
TanuHoque
Esri Regular Contributor

@Arne_Gelfert 

Please make sure the print service Execution Mode is Synchronous. I think WAB print widget does not like async print services.

 

About writing out pdf issue, that was a bug that fix in a 10.8.1 patch. I'd recommend you to upgrade to 10.8.1 and install the following patches.

https://support.esri.com/en/download/7834

https://support.esri.com/en/download/7868

0 Kudos
Arne_Gelfert
Occasional Contributor III

Thanks, Tanu. I was about to reach out to you directly, based on some helpful feedback you provided last year. I said I was on 10.8 but I had actually applied SP1, so running on 10.8.1. But it looks like the bug is in 10.8.1 so I'll try out those patches. Thanks so much on a Friday afternoon!

 

0 Kudos
Arne_Gelfert
Occasional Contributor III

Tanu, thank you - Problem Solved!

Many hours of retracing my steps, testing, repeating, reading online posts, comparing old vs. new before I thought to post here. Man, thanks for helping me save the week. Next time, I'll have more confidence in my own process.

I do have to ask though: How do you guys manage to break existing functionality with each new release? Who is in charge of regressions testing?🙄


Have a good weekend and thanks again!

imranrajjad_cc
New Contributor II

Hi, can you please tell me what made the error go away? I am also on 10.8.1 but have not installed any patches yet. My custom layout is also acting weird. If I try to print a host Map Image layer and Feature layer, I only get the Map Image Layer

0 Kudos
Arne_Gelfert
Occasional Contributor III

Hey there - Sorry to hear about your issues. The only thing that worked for me was to skip 10.8.x altogether and go to 10.9. What I set up in 10.6 failed in 10.8.1. In 10.9, I could use everything, no tweaks or configuration changes needed. To me this had to be a bug in 10.8.1 but I don't have time in my life to jump through all the hoops of logging or discussing bugs with ESRI. Haha. So I just went to the next version and never had another issue. The big sleeping dragon nightmare of mine is now having to upgrade again one day. Good luck to you. I'd say just go to 10.9. 

0 Kudos
MikeBrannagan
New Contributor II

Unfortunately I can not move to 10.9 (or above yet) until I get some server upgrades (or a new server).  I applied the patches mentioned by Tanu but still no success.  Maybe I can push my IT department to get me the server upgrades I need so I can try 10.9 but would really like to resolve this at 10.8.1 until that time.

0 Kudos
Arne_Gelfert
Occasional Contributor III

Sorry, Mike. I moved on to 10.9 and have no insights to share for 10.8. Luckily, there is now Enterprise 11 if you're feeling adventurous.

0 Kudos
MikeBrannagan
New Contributor II

Someday - need my GIS server moved off of Windows 2012 Server to do that.  Thanks for the reply Arne.

0 Kudos
TanuHoque
Esri Regular Contributor

@MikeBrannagan 

Is it not printing only when the output type is pdf?

0 Kudos