Unable to load image layer via localhost in Angular

389
5
Jump to solution
10-15-2021 01:06 AM
arahman_mdmajid
New Contributor III

 

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.

Abdur Rahman
GIS Developer
0 Kudos
1 Solution

Accepted Solutions
arahman_mdmajid
New Contributor III

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,

ArcSOC Count.png

 

Thank you to everyone who helped with the process, including @DebendraBiswas 

Abdur Rahman
GIS Developer

View solution in original post

0 Kudos
5 Replies
AndyGup
Esri Regular Contributor

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.

arahman_mdmajid
New Contributor III

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.

arcgis server rest service error.PNG

 Below I have provided some log and service configuration screens shot to give some insight.

Yesterday after restarting the "ArcGIS Server" service:

server log 1 - 21 Oct 2021.png

 

Midnight time log of server:

server log 2 - 21 Oct 2021.png

 

Today when the app requested the service:

server log 3 - 21 Oct 2021.png

 

Today after restarting the "ArcGIS Server" service 

server log 4 - 21 Oct 2021.png

Service parameters are as follows:

arcgis server service parameters.PNG

 How can I resolve this? @George_Thompson  and @TanuHoque can you also look into this issue.

Abdur Rahman
GIS Developer
0 Kudos
George_Thompson
Esri Frequent Contributor

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?

--- George T.
0 Kudos
arahman_mdmajid
New Contributor III

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. 

server pic 1.png

 

server pic 2.png

 

server pic 3.png

 

 

Abdur Rahman
GIS Developer
0 Kudos
arahman_mdmajid
New Contributor III

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,

ArcSOC Count.png

 

Thank you to everyone who helped with the process, including @DebendraBiswas 

Abdur Rahman
GIS Developer

View solution in original post

0 Kudos