Bug 64859 - Assertion errros org.apache.catalina.mapper.Mapper.internalMap(Mapper.java:744)
Summary: Assertion errros org.apache.catalina.mapper.Mapper.internalMap(Mapper.java:744)
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.34
Hardware: All Linux
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2020-10-29 11:14 UTC by marcin borcz
Modified: 2020-10-29 19:26 UTC (History)
1 user (show)

Full stacktraces for mentioned log entries (5.63 KB, text/plain)
2020-10-29 11:14 UTC, marcin borcz

Note You need to log in before you can comment on or make changes to this bug.
Description marcin borcz 2020-10-29 11:14:41 UTC
Created attachment 37538 [details]
Full stacktraces for mentioned log entries

We had observed the following assertion errors, total 356 cases.

   at org.apache.catalina.mapper.Mapper.internalMap(Mapper.java:744)"

Above errors were preceded by the two log info entries

Encountered a non-recycled request and recycled it forcedly.

"org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
java.lang.IllegalStateException: Unexpected state: headers already parsed. Buffer not recycled?"

Full log entries are in the attachment.

Assertion errors had occurred for 2 hours and then the problem disappeared. After a few hours, we had noticed another two cases this time not preceded by any connected log entries. After that, we restarted the problematic instance and the situation has not repeated anymore.

Almost the same configuration and application are in use for weeks so it's rather not an issue.

Application and installation:
Spring Boot 2.0 + Vaadin 8 
The application running in Kubernetes based on image tomcat:9.0.34-jdk8-openjdk-slim
Comment 1 Mark Thomas 2020-10-29 19:26:32 UTC
This is typically caused by an application or library retaining a reference to a request, response, InputStream, OutputStream etc. beyond the lifetime of the original request (Tomcat recycles these objects and you end up with two threads trying to use the same object).

The users list is usually the best place to debug issues such as these.

If you are sure a reference is not being retained and you are able to reproduce this issue feel free to re-open this report and provide the necessary steps to recreate the issue from a clean install of the latest release of a currently supported Tomcat major version (e.g. 9.0.x).