search cancel

Azure probe throws JsonMappingException - Fatal transport error processing get request (400)

book

Article ID: 227874

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

We want use the Azure probe to monitor some customer environments.

There are two resource groups in our target azure environment:

1) a test group named "abc" with a linux system

2) a productive group named "def" with serveral linux and windows systems

 

We configured these resource groups, but only in the "abc"" group a cluster is found and can be configured further for alarms. For the "def" group we get an exception instead:

 

Sep 16 09:11:06:576 FATAL [Resource Manager Collection [omniga-obungi]- 5, azure] Fatal transport error processing get request //subscriptions/2f07cb9b-3f64-49bb-ae6e-6a6a296fb27c/resourceGroups/tf-aks-prod/providers/Microsoft.ContainerService/managedClusters?api-version=2018-03-31
Sep 16 09:11:06:576 FATAL [Resource Manager Collection [omniga-obungi]- 5, azure] com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
 at [Source: [email protected]0; line: 38, column: 7] (through reference chain: com.nimsoft.probe.application.azure.model.ResponseWrapper["value"]->java.util.ArrayList[0]->com.nimsoft.probe.application.azure.model.AzureManagedCluster["properties"]->com.nimsoft.probe.application.azure.model.AzureManagedClusterProperties["linuxProfile"])
 at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
 at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:857)
 at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:853)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.handleNonArray(CollectionDeserializer.java:292)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:227)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:217)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:25)
 at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:520)
 at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:101)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:222)
 at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:152)
 at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:520)
 at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:101)
 at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:222)
 at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:152)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:217)
 at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:25)
 at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:520)
 at com.fasterxml.jackson.module.afterburner.deser.SettableObjectMethodProperty.deserializeAndSet(SettableObjectMethodProperty.java:55)
 at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:156)
 at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3736)
 at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2810)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector$ResponseHandlerImpl.handleEntity(AzureResourceManagerCollector.java:257)
 at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:72)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector$ResponseHandlerImpl.handleResponse(AzureResourceManagerCollector.java:278)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:190)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector.processGetRequest(AzureResourceManagerCollector.java:302)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector.executeAPIRequest(AzureResourceManagerCollector.java:189)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector$2.call(AzureResourceManagerCollector.java:206)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector$2.call(AzureResourceManagerCollector.java:203)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)

Cause

The reason for this issue is this exception:

 

Oct 04 15:00:32:430 FATAL [Resource Manager Collection [omniga-aks-prod]- 22, azure] Fatal transport error processing get request (400) https://management.azure.com//subscriptions/2f07cb9b-3f64-49bb-ae6e-6a6a296fb27c/resourceGroups/tf-net-prod/providers/Microsoft.ClassicCompute/virtualMachines?api-version=2016-04-01 
Oct 04 15:00:32:430 FATAL [Resource Manager Collection [omniga-aks-prod]- 22, azure] org.apache.http.client.HttpResponseException: Bad Request
 at org.apache.http.impl.client.AbstractResponseHandler.handleResponse(AbstractResponseHandler.java:69)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector$ResponseHandlerImpl.handleResponse(AzureResourceManagerCollector.java:363)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:190)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector.processGetRequest(AzureResourceManagerCollector.java:388)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector.executeAPIRequest(AzureResourceManagerCollector.java:274)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector$3.call(AzureResourceManagerCollector.java:291)
 at com.nimsoft.probe.application.azure.impl.rm.AzureResourceManagerCollector$3.call(AzureResourceManagerCollector.java:288)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)

 

 

The API call:
https://management.azure.com//subscriptions/{{subscriptionId}}/resourceGroups/cloud-shell-storage-northeurope/providers/Microsoft.ClassicCompute/virtualMachines?api-version=2016-04-01

Cause:
API call is failing due to classic compute provider is Disallowed Provider (The operation is not permitted for namespace 'Microsoft.ClassicCompute')

Environment

Release : 20.3

Component : UIM - AZURE

Resolution

Engage your Azure administrator and verify in azure portal whether this Microsoft.ClassicCompute provider registered or not ?

 

Steps to verify:


•   Sign in to the Azure portal.
•   Select All services.

•  In the All services box, enter subscription, and then select Subscriptions.
•   Select the subscription from the subscription list to view.
•  Select Resource providers and view the list of available resource providers.

 

Here please verify Microsoft.ClassicCompute provider status, whether registered or not?

if it's not registered, it will cause this issue. 

 

--> If it's not registerd please follow the instructions below:

 

 

•   Sign in to the Azure portal. 
•   Select All services. 
•   In the All services box, enter subscription, and then select Subscriptions. 
•   Select the subscription from the subscription list to view. 
•   Select Resource providers and view the list of available resource providers. Then follow: Registering a resource provider configures your subscription to work with the resource provider. 

 

The scope for registration is always the subscription. By default, many resource providers are automatically registered. However, you may need to manually register some resource providers.

To register a resource provider, you must have permission to perform the /register/action operation for the resource provider. This operation is included in the Contributor and Owner roles. 

To register a resource provider, select Register.  Register link/resource providers (Ex : Microsoft.Blueprint). Refer : https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services