Mike Jumper created GUACAMOLE-2052:
--------------------------------------

             Summary: Logging of request details fails with recent Tomcat
                 Key: GUACAMOLE-2052
                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-2052
             Project: Guacamole
          Issue Type: Bug
          Components: guacamole-ext
    Affects Versions: 1.6.0
            Reporter: Mike Jumper
             Fix For: 1.6.0


When testing {{staging/1.6.0}} under Tomcat 9.0.91, I encounter the following 
exception filling the logs:

{code:none}
SLF4J(E): Failed toString() invocation on an object of type 
[org.apache.guacamole.event.RemoteAddress]
SLF4J(E): Reported exception:
java.lang.IllegalStateException: The request object has been recycled and is no 
longer associated with this facade
        at 
org.apache.catalina.connector.RequestFacade.checkFacade(RequestFacade.java:856)
        at 
org.apache.catalina.connector.RequestFacade.getHeader(RequestFacade.java:516)
        at 
javax.servlet.http.HttpServletRequestWrapper.getHeader(HttpServletRequestWrapper.java:82)
        at 
javax.servlet.http.HttpServletRequestWrapper.getHeader(HttpServletRequestWrapper.java:82)
        at 
javax.servlet.http.HttpServletRequestWrapper.getHeader(HttpServletRequestWrapper.java:82)
        at 
org.apache.guacamole.event.RemoteAddress.toString(RemoteAddress.java:86)
        ...
        at 
org.apache.guacamole.rest.auth.TokenRESTService.createToken(TokenRESTService.java:174)
        at 
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        ...
{code}

This is caused by Tomcat recycling the underlying request object, which is then 
no longer usable via the facade stored within the {{Credentials}} object. The 
new behavior looks to be either the result of new defaults or new sanity checks.

We'll have to start storing the most relevant parts of the request directly 
within {{Credentials}} instead of relying on direct access to the request.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to