Hi Chris,

Thanks for your reply. Thanks also for your warning against interfering with 
the setting allowedRequestAttributesPattern ('Setting the value to ".*" is a 
violation of sane security policy'). I guessed as much, and am grateful for 
your confirmation.

On the subject of mod_jk, we are apparently talking about the same thing. In 
our set-up the mod_jk log is called isapi_redirect.log.
The code that generates the error is indeed /native/common/jk_ajp_common.c. The 
part where the error is generated is:

ae->reuse = (int)jk_b_get_byte(msg);
if (!ae->reuse) {
     * AJP13 protocol reuse flag set to false.
     * Tomcat will close its side of the connection.
    jk_log(l, JK_LOG_WARNING, "(%s) AJP13 protocol: Reuse is set to false",

This code snippet says that reuse is determined - at the end of a response - 
from a byte obtained from some message. Which raises two questions:

1) The response to the "ping" REST request has status code 204 ("No Content"). 
If, as you say, a 204 response is OK, then where would the reuse byte come from?
2) Do you know a way to set the "AJP13 protocol reuse flag" to true? As far as 
we know, the only "reuse" settings at our disposal are the current worker 
settings, worker.workerName.connection_pool_size=500
and worker. workerName.max_reuse_connections=250.

Kind regards,


-----Oorspronkelijk bericht-----
Van: Christopher Schultz <ch...@christopherschultz.net> 
Verzonden: 16 June 2020 19:55
Aan: Tomcat Users List <users@tomcat.apache.org>
Onderwerp: Re: Warning "AJP13 protocol: Reuse is set to false" written logs 
every second of every day. Please help.

Hash: SHA256


On 6/15/20 09:45, Alfred Bakia wrote:
> Thanks, Chris. To respond to your remarks:
> 1) The warnings, "AJP13 protocol: Reuse is set to false", are being
logged by Tomcat (in the Tomcat AJP connector logs).

Weird. I can't find that string anywhere in code or other files in Tomcat, but 
its right there in mod_jk:

./native/common/jk_ajp_common.c:            jk_log(l, JK_LOG_WARNING,
"(%s) AJP13 protocol: Reuse is set to false",

Are you sure you are looking at the right log file?

> 2) As I mentioned earlier, the versions and settings of the servers 
> (and their respective IIS web servers) are the same.
> In any case I have discovered "how" the warning occurs. It is indeed 
> triggered by the REST API.
> The culprit is a REST request in the form:
> http://www.ourdomain.com/api/srv2/exercises/93/1431/26346/ping
> It is a POST request and "ping" is a custom REST method. It is just a 
> ping, so the status code of the response is 204 ("No Content").

A 204 response should not cause any problem.

> I can confirm that every ping request results in the warning
> "AJP13 protocol: Reuse is set to false" being written to Tomcat's 
> connector logs.
> Researching this on the web, I found the suggestion to add 
> allowedRequestAttributesPattern=".*" to the AJP connector in 
> server.xml.
> Is this a viable solution?

This has nothing to do with your REST API. This is a change made to recent 
versions of Tomcat that may require you to allow certain non-standard variables 
to be passed-over from your web server to Tomcat via AJP.

If your "ping" REST API is requiring some information to be passed from the web 
server to Tomcat and you are seeing errors on the Tomcat side, then you may 
have to fiddle with the allowedRequestAttributesPattern. Setting the value to 
".*" is a violation of sane security policy.

But I see no evidence that your "Reuse is set to false" error is related (yet) 
to the allowedRequestAttributesPattern. If you see errors in the Tomcat log, 
please post them and we'll see.

The allowedRequestAttributesPattern wasn't added to Tomcat until
9.0.31 so if you really are running 9.0.21, then adding 
allowedRequestAttributesPattern will accomplish nothing.

- -chris
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/


To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to