PrintTask Error

273
4
07-10-2020 08:56 AM
KevinHanley2
New Contributor II

Strugging to figure out why my PrintTask is returning an error. Here is a screenshot of both my routine and the error that is being returned. I know that in 10.7 or so the json formatting is picky, but the Export Web Map service we're using was created with 10.1 so I don't think that's what is going on.

If seeing the entire error would be beneficial let me know. It's a couple pages of text so I figured I'd spare you the wall of text if anyone could make sense of the Object.b.g.load error on its own. Thank you so much.

0 Kudos
4 Replies
Noah-Sager
Esri Regular Contributor

It's difficult to say without seeing the entire error message. Couple things to try:

1) If you swap in the AGO utility print service, do you get the same error?

https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%... 

2) The current 3x version of the API is 3.33, if you update to the latest version, do you get the same error?

0 Kudos
KevinHanley2
New Contributor II

Thanks for the reply. I've adjusted my code to move to 3.33 and also tried the other service and I appear to be getting the same results. Here is the full error:

error = Error: Unable to complete operation. at Object.B.f.load (https://js.arcgis.com/3.33/init.js:957:296) at https://js.arcgis.com/3.33/init.js:88:429 at c (https://js.arcgis.com/3.33/init.js:104:350) at e (https://js.arcgis.com/3.33/init.js:104:139) at b.Deferred.resolve.callback (https://js.arcgis.com/3.33/init.js:105:479) at c (https://js.arcgis.com/3.33/init.js:105:63) at e (https://js.arcgis.com/3.33/init.js:104:139) at b.Deferred.resolve.callback (https://js.arcgis.com/3.33/init.js:105:479) at https://js.arcgis.com/3.33/init.js:93:98 at m (https://js.arcgis.com/3.33/init.js:108:248) 548 debugger; 549 alert(error); 550 } 551 552 function printResult(result) { 553 debugger; 554 window.open(result.url, "_blank") 555 } 556 557 var template = new PopupTemplate({ 558 title: "<table style=width:100%><tr><th>PARCEL NUMBER</th><th>OWNER</th><th>ADDRESS</th><th>ADDRESS 2</th><th>CITY</th><th>ST</th><th>ZIP</th><tr><tr><td><a href=https://qpublic.schneidercorp.com/application.aspx?AppID=855&LayerID=15999&PageTypeID=4&PageID=7114&Q=1569379244&KeyValue={PIN_DSP}>{PIN_DSP}</a></td><td>{OWNER_NAME}</td><td>{ADDRESS_1}</td><td>{ADDRESS_2}</td><td>{CITY_NAME}</td><td>{ST}</td><td>{ZIPCODE}</td></th></table>", 559 fieldInfos: [ 560 { fieldName: "PIN_DSP", visible: false }, 561 { fieldName: "OWNER_NAME", visible: false }, 562 { fieldName: "ADDRESS_1", visible: false }, 563 { fieldName: "ADDRESS_2", visible: false }, 564 { fieldName: "CITY_NAME", visible: false }, 565 { fieldName: "ST", visible: false }, 566 { fieldName: "ZIPCODE", visible: false } 567 ], 568 }); 569 570 var PLSSLayer = new ArcGISDynamicMapServiceLayer("http://172.27.8.54:6080/arcgis/rest/services/PropertyApp/TwnSecRng/MapServer",{ 571 "id": "PLSS Lines", 572 "visible": true, 573 useMapImage: true, 574 }); Line 548, Column 2 Coverage: n/a Debugger paused Watch Call Stack printError index.html:548 (anonymous) PrintTask.js:6 c init.js:104 e init.js:104 reject.errback init.js:106 c init.js:105 e init.js:104 reject.errback init.js:106 (anonymous) init.js:64 c init.js:104 e init.js:104 reject.errback init.js:106 _errorHandler init.js:2372 (anonymous) init.js:64 f PrintTask.js:13 _errorHandler init.js:2372 (anonymous) init.js:64 error Geoprocessor.js:14 (anonymous) init.js:974 c init.js:104 e init.js:104 reject.errback init.js:106 c init.js:105 e init.js:104 reject.errback init.js:106 c init.js:105 e init.js:104 reject.errback init.js:106 c init.js:105 e init.js:104 reject.errback init.js:106 (anonymous) init.js:971 c init.js:104 e init.js:104 reject.errback init.js:106 c init.js:105 e init.js:104 reject.errback init.js:106 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 (anonymous) init.js:93 m init.js:108 k init.js:108 resolve init.js:110 a init.js:109 m init.js:108 k init.js:108 resolve init.js:110 a init.js:109 m init.js:108 k init.js:108 resolve init.js:110 a init.js:109 m init.js:108 k init.js:108 resolve init.js:110 d init.js:140 f init.js:145 load (async) r init.js:145 m init.js:141 b.xhr init.js:93 b.xhrGet init.js:93 B init.js:964 f init.js:967 G init.js:974 (anonymous) init.js:975 c init.js:104 B.then.then init.js:106 always init.js:114 z init.js:975 execute Geoprocessor.js:14 c.<computed> init.js:1151 _execute PrintTask.js:13 (anonymous) PrintTask.js:6 (anonymous) init.js:64 c init.js:104 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 (anonymous) init.js:969 c init.js:104 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 c init.js:105 e init.js:104 resolve.callback init.js:105 (anonymous) init.js:93 m init.js:108 k init.js:108 resolve init.js:110 a init.js:109 m init.js:108 k init.js:108 resolve init.js:110 a init.js:109 m init.js:108 k init.js:108 resolve init.js:110 a init.js:109 m init.js:108 k init.js:108 resolve init.js:110 d init.js:140 f init.js:145 load (async) r init.js:145 m init.js:141 b.xhr init.js:93 b.xhrGet init.js:93 B init.js:964 f init.js:967 G init.js:974 (anonymous) init.js:975 c init.js:104 B.then.then init.js:106 always init.js:114 z init.js:975 execute PrintTask.js:6 PrintTool index.html:538 (anonymous) index.html:414 Scope

0 Kudos
Noah-Sager
Esri Regular Contributor

Hmm, if you have the Network tab open in the Developer tools, can you find the "execute" call and look at the response there?

Can you provide a reproducible test case so I can better diagnose?

KevinHanley2
New Contributor II

Thanks for the reply. Doesn't look like the Developers tools page is going to give us too helpful of information. The preview page has a few more lines than the response page, but both of them basically look like this. No details.

  1. {error: {code: 400, message: "Unable to complete operation.", details: []}}
    1. error: {code: 400, message: "Unable to complete operation.", details: []}
      1. code: 400
      2. details: []
      3. message: "Unable to complete operation."

When I look at the json it's passing, it looks correct to me.

I'll talk to some of my network people about trying to get this map accessible outside our network to allow you to troubleshoot further. Thank you again for helping me out.