search cancel

Agent management -> Agent Properties is blurred out

book

Article ID: 215894

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio)

Issue/Introduction

When we go to agent management and click on an agent to view its properties, the new window that launches is blurred out. We have noticed this for servers that have hostnames similar to: servername.domain.com

 

Environment

Release : < 6.7.4

Component : CA RELEASE AUTOMATION CORE

Cause

We checked and can confirm that the problem is indeed caused by Spring MVC that we use in the product backend.

Explanation:

There is a mechanism in Spring MVC that is enabled by default and is triggered for requests that have an argument with dots in the request URL. It tries to infer content type requested by the client based on the part after the last dot in the argument (which is considered as file extension). Value of the "Accept" HTTP header that is supposed to specify the content type requested by the client and that is placed into the request by browser is ignored by this mechanism by default.
 
It's only triggered when:
1. Agent is shown as reachable in UI (for unreachable agents UI won't send any requests to backend)
2. Agent has dots in its nimi id (because nimi id becomes part of request URL)
3. User clicks the agent in the UI to see/edit its properties.

How it works:

1. If the part after the last dot in the URL request is not a recognizable file extension it's ignored and the request is processed normally. 
For example:
Reachable agent nimi id is: server1.abc.testlab.net 
=> request URL will contain : /datamanagement/a/v6/agents/server1.abc.testlab.net 
=> ".net" is not a classic recognizable file extension and cannot be mapped to any content type so it's ignored and the request is processed normally.
 
2. If the part after the last dot in the URL is a recognizable file extension then the content type requested by the client is inferred. And then the mechanism checks what content type can the server produce for this URL: if produced content type matches requested content type request is processed normally. 
For example:
Reachable agent nimi id is: server1.abc.testlab.xml
=> request URL will contain : /datamanagement/a/v6/agents/server1.abc.testlab.xml  
=> ".xml" is a recognizable file format so the content type requested by the client is inferred as text (e.g. "text/xml" or "text/*). The controller processing the request returns JSON which also corresponds to text content type ("text/*") and it matches what was inferred for the client so the request is again processed normally.
 
3. If the part after the last dot in the URL is a recognizable file extension but the inferred content type for the client does not match the content type that server can produce then HTTP 406 is returned indicating that the URL is correct but the request cannot be processed. 
For example:
Reachable agent nimi id is: server1.abc.testlab.com
=> request URL will contain : /datamanagement/a/v6/agents/server1.abc.testlab.com
=> ".com" is a classic recognizable file format so the content type requested by the client is inferred as binary ("application/octet-stream"). But there is still only one controller on the server for this URL and the content type that it can produce is still "text/*" so there is a mismatch and the error response 406 is returned.

Resolution

The recently released cumulative 6.7.4 includes the same configuration change as suggested below. Please refer the Release Notes for 6.7.4 for additional details of what else is included in the cumulative fix. 

 

The reason this mechanism exists is that backend may want to process requests with different requested content types differently and that's how Spring MVC allows doing so. The setting mentioned below will disable content type inference based on file extension for the whole application. 

Disabling the mechanism that causes it via the Spring MVC configuration in "wrapperContext.xml" located in "./webapps/datamanagement/WEB-INF" directory within installed NAC.
 
1: Create a backup of ./webapps/datamanagement/WEB-INF/wrapperContext.xml
2: Open the wrapperContext.xml file in edit mode
3: Make below requested configuration change i.e.
 
In order to disable it the following line:
<mvc:annotation-driven/>
Should be replaced with this:
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
    <property name="favorPathExtension" value="false" />
</bean>
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager"/>
4: Save the file and restart the NAC service.

 

Attachments