Custom error page issue when Dynatrace Agent is installed with SPS
search cancel

Custom error page issue when Dynatrace Agent is installed with SPS


Article ID: 97146


Updated On:


CA Single Sign On Secure Proxy Server (SiteMinder) CA Single Sign On SOA Security Manager (SiteMinder) CA Single Sign-On SITEMINDER CA Single Sign On Agents (SiteMinder)



Dynatrace Agent installed on CA Access Gateway (SPS) to monitor performance.

When enabling the Custom error page on the CA Access Gateway (SPS), it was observed that Tomcat is Evaluating the Exception properly and Redirecting to the correct Error page, however, for some reason, the 500 Status generated by Tomcat for the Error page is not being committed.

Use case as Follows:

  1. Error page Enabled on CA Access Gateway (SPS) (1).
  2. http_socket_timeout was set to 2 min, meaning CA Access Gateway will wait for a Response from the backend for 2 min. If not request received, Tomcat will issue a Timeout:

    Exception along with 500 Status 

    [][Noodle::doGet][][][][][][][][][][][][][][][][ Read timed out at Method)]
    [Thread performing the required IO interupted. might be the connection time out.] 
    [Thread performing the required IO interupted. might be the connection time out.] 
    [][ErrorPageImpl::displayMessage][][][][][][][][][][][][][][][][ after calling generateHTML, message: <HTML><HEAD><TITLE>Secure Proxy Server - Error Report</TITLE><style>body { font-family: verdana, Georgia, Arial, "Times New Roman", Times, serif; }</style></HEAD><BODY><H1><center>Secure Proxy Server - Error Report</center></H1><H2>Error Details</H2><TABLE><TR VALIGN="TOP"><TD><H3>Request URI</H3></TD><TD>:</TD><TD>/YourResourceHere</TD></TR><TR VALIGN="TOP"><TD><H3>Error Type</H3></TD><TD>:</TD><TD>SPS Exception</TD></TR><TR VALIGN="TOP"><TD><H3>Error Code</H3></TD><TD>:</TD><TD>Noodle_InteruptedIOException</TD></TR><TR VALIGN="TOP"><TD><H3>Error Message</H3></TD><TD>:</TD><TD>Thread performing the required IO interupted. might be the connection time out.</TD></TR></TABLE></BODY></HTML>]
  3. The issue is the 500 Generated by Tomcat is not being set correctly, instead, from the mod_jk trace, it was observed that the message returned to the client (browser) was Status 200 instead which is leading to a blank page displayed on the browser side instead of the error message:

    [debug] jk_ajp_common.c (739): (ajp13) status = 200



Debugging the issue lead to Dynatrace Agent causing issues with the status committed.

Below is a snippet from debugging a transaction:

30-Apr-2018 4:27:28 PM org.apache.coyote.Response setCommitted 
  1. Dynatrace called flush() and attempted to commit: 

    INFO: *** defect *** stack is: at org.apache.coyote.Response.setCommitted( 
    at org.apache.coyote.ajp.AbstractAjpProcessor.prepareResponse( 
    at org.apache.coyote.ajp.AbstractAjpProcessor.action( 
    at org.apache.coyote.Response.action( 
    at org.apache.coyote.Response.sendHeaders( 
    at org.apache.catalina.connector.OutputBuffer.doFlush( 
    at org.apache.catalina.connector.OutputBuffer.close( 
    at org.apache.catalina.connector.CoyoteWriter.close( 
    at com.dynatrace.diagnostics.agent.introspection.uem.impl.AgentInjectingWriter.close(null:-1) 
    at com.dynatrace.diagnostics.agent.introspection.uem.impl.AutoHtmlInjectorWriter.close(null:-1) 

  2. When the call to flush happened, the commit flag (Tomcat side) for this response transaction becomes TRUE.
      - What that means is no other parts of the code can change or modify the status, response message, or anything about the response.
      - If any attempt to change any part of the response, tomcat will throw an illegal state exception.

  3. This dynatrace flush happened BEFORE CA Access Gateway can attempt to change the status response from 200 to 500 due to the IOException captured, due to the connection timeout:

    30-Apr-2018 4:27:28 PM org.apache.catalina.connector.Response setStatus 
    WARNING: *** de355930 *** (1) Catalina does NOT set status in setStatus!!! 

  4. Tomcat finally got the recycle called which resets everything including the commit flag, but the status in the previous response was sent as 200 instead of the intended 500. 

    30-Apr-2018 4:27:28 PM org.apache.coyote.Response recycle 
    INFO: *** defect *** stack is: at org.apache.coyote.Response.recycle( 
    at org.apache.coyote.ajp.AbstractAjpProcessor.recycle( 



Possible Solution if Dynatrace is to be kept:

  1. Attempt to REVERSE the call to dynatrace and have the application call Dyantrace LAST. The ordering is important.
  2. Or, suppress the flush called happening in Dyntrace or somewhere in its application. CA Access Gateway (SPS) should be the one and only one that should call the response flush. 

Additional Information



     Custom Error Pages Configuration