I am trying to add three layer with different capability in a map viewer. All layers were loading just fine. The other day serving the code again two layer are unable to load and getting image load error and internal server error.
let layer1 = new MapImageLayer({
//Public
url: "https://<domain-url>:6443/arcgis/rest/services/Governorates/<layer1>/MapServer"
});
map.add(layer1);
let layer2 = new FeatureLayer({
//Public
url: "https://<domain-url>:6443/arcgis/rest/services/Governorates/<layer2>/FeatureServer/0"
});
map.add(layer2);
urlUtils.addProxyRule({
urlPrefix: "https://<domain-url>:6443/arcgis/rest/services/Public/<layer3>/MapServer",
proxyUrl: "https://<app-hosting-url>/Proxy/proxy.ashx"
});
const layer3 = new FeatureLayer({
//Private
url: "https://<domain-url>:6443/arcgis/rest/services/Public/<layer3>/MapServer"
});
map.add(layer3);
Layer 1 and layer 3 are giving the following error
[esri.views.2d.layers.MapImageLayerView2D]
{name: 'mapimagelayer:image-fetch-error', details: {…}, message: 'Unable to load image: https://<domain-url>:6…st/services/Governorates/<layer1>/MapServer/export'}
While layer 2 is loading just fine. I restarted ArcGIS Server also an the problem went away momentarily but its happening again.
Solved! Go to Solution.
After a lengthy discussion and diligent investigation by the ESRI Saudi Arabia team and another system analyst from ESRI, we were able to solve the problem.
The main issue was that too many unnecessary services were running, and the default minimum instance setting inside pooling was set to 1. So the server was reaching its maximum capacity and was crashing during midnight and was unable to instantiate the services. At max, were running around 180 ArcSOC services, so you can imagine the load on the CPU. I used the following command in Windows's Command Prompt to find the number of processes running.
tasklist | find /I /C "ArcSOC.exe"
Two main articles helped us in understanding the problem in detail. I have linked them below,
Introducing shared instances in ArcGIS Server
Anticipating and accommodating users
Since we were using the ArcGIS Server version 10.6, we could not use the shared instance pool.
To solve the issue, we determined the critical services by analyzing their demand from Server statistics. We set the Minimum number of instances per machine to 0 for unimportant services. After configuring all the services, our ArcSOC count looked something like this,
Thank you to everyone who helped with the process, including @DebendraBiswas
HI@arahman_mdmajid my recommendation is build a simple, vanilla JS app that reproduces the issue and then call tech support. If nothing changed in the web app, then this most likely is not a problem caused by the ArcGIS JS API.
So this happens every morning where when I serve the Angular app, the layers initially do not appear. And I see the error.
[esri.views.2d.layers.MapImageLayerView2D] o {name: 'mapimagelayer:image-fetch-error', details: {…}, message: 'Unable to load image: <service-url>/MapServer/export'}
After restarting the "ArcGIS Server" service in the Windows server and waiting some time, the layer appears and functions normally.
As @AndyGup suggested, I created a simple JS app with the same layers. Still, I am getting the same errors.
I also tried the service URL individually, I the service shows as follows.
Below I have provided some log and service configuration screens shot to give some insight.
Yesterday after restarting the "ArcGIS Server" service:
Midnight time log of server:
Today when the app requested the service:
Today after restarting the "ArcGIS Server" service
Service parameters are as follows:
How can I resolve this? @George_Thompson and @TanuHoque can you also look into this issue.
I would contact technical support to look into this. It looks like there is an issue with the service.
Can you pull up the service info via the REST end point in the built in JS viewer?
I am currently able to view all the layers from the built-in JS viewer. All are working normally now but every morning I have to restart ArcGIS Server to achieve this.
After a lengthy discussion and diligent investigation by the ESRI Saudi Arabia team and another system analyst from ESRI, we were able to solve the problem.
The main issue was that too many unnecessary services were running, and the default minimum instance setting inside pooling was set to 1. So the server was reaching its maximum capacity and was crashing during midnight and was unable to instantiate the services. At max, were running around 180 ArcSOC services, so you can imagine the load on the CPU. I used the following command in Windows's Command Prompt to find the number of processes running.
tasklist | find /I /C "ArcSOC.exe"
Two main articles helped us in understanding the problem in detail. I have linked them below,
Introducing shared instances in ArcGIS Server
Anticipating and accommodating users
Since we were using the ArcGIS Server version 10.6, we could not use the shared instance pool.
To solve the issue, we determined the critical services by analyzing their demand from Server statistics. We set the Minimum number of instances per machine to 0 for unimportant services. After configuring all the services, our ArcSOC count looked something like this,
Thank you to everyone who helped with the process, including @DebendraBiswas