I have geoprocessing service which produces a MapImageLayer as the result. I execute the asynchronously using the JavaScript API method "submitJob" method.
var gpTask = new Geoprocessor(gpTaskUrl);
gpTask.outSpatialReference = {
wkid: 102100
};
gpTask.submitJob(params).then(drawResultData, errBack);It GP task is executed successfully all the time, I see it when I check the server using the job ID. But the resulting map image layer is loaded only in some cases, otherwise I see an error. Specially when the layer is loaded successfully, if I zoom into a specific area there is an increase probability to see the same error.
<SPAN class="punctuation token">[</SPAN>esri<SPAN class="punctuation token">.</SPAN>views<SPAN class="punctuation token">.</SPAN>2d<SPAN class="punctuation token">.</SPAN>layers<SPAN class="punctuation token">.</SPAN>MapImageLayerView2D<SPAN class="punctuation token">]</SPAN> e
<SPAN class="punctuation token">{</SPAN> name<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"dynamiclayer:image-fetch-error"</SPAN><SPAN class="punctuation token">,</SPAN>
message<SPAN class="punctuation token">:</SPAN> <SPAN class="string token"><SPAN>"Unable to load image: </SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Farcgis" target="_blank">https://arcgis</A><SPAN>.<domain>…at=png32&transparent=true&layers=show%3A0&f=image"</SPAN></SPAN><SPAN class="punctuation token">,</SPAN>
details<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>…<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The failed request is:
https://arcgis.<domain>/arcsrv/rest/services/<ResultMapServiceName>/MapServer/jobs/je13d9121d0ee4270894ebd01f66758a1/export?bbox=-14177540.562098123,1761435.9140478536,-4784958.526418162,6990951.641205082&bboxSR=102100&imageSR=102100&size=1920,1069&dpi=96&format=png32&transparent=true&layers=show:0&f=image
This request is made internally as a result of the map loading process.
I found another interesting thing here. If I go to the GP job using the browser and refresh it, then it starts working even in the web app. This is the way I check the job inside the server.
https://arcgis.<domain>/arcsrv/rest/services/<GPServiceName>/GPServer/<GPTaskName>/jobs/je13d9121d0ee4270894ebd01f66758a1
I have already checked the timeout/clean up rules applicable in this GP scenario, it seems they have no impact in this case. I use JS API 4.6, appreciate any help here.