You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2025/02/05 10:30:41 UTC

[Bug 69567] New: Tomcat returns 200 OK instead of 500 Internal Server Error on cache eviction failure leading to application errors

https://bz.apache.org/bugzilla/show_bug.cgi?id=69567

            Bug ID: 69567
           Summary: Tomcat returns 200 OK instead of 500 Internal Server
                    Error on cache eviction failure leading to application
                    errors
           Product: Tomcat 11
           Version: 11.0.1
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: Yosr.Hmouda@PROSTEP.com
  Target Milestone: -------

I encountered an issue with Apache Tomcat 11.0.1 (and also v11.0.2) where
Tomcat logs a warning when it fails to evict cache entries due to insufficient
space, but instead of sending a 500 Internal Server Error, it returns a 200 OK
response. This is problematic because the resource cannot be properly served,
no content is returned, yet a 200 OK status is sent. This causes errors in the
application, as it fails to load necessary resources.

Details: When Tomcat’s cache reaches its limit, and eviction of expired cache
entries fails, Tomcat logs the warning:

"05-Feb-2025 10:31:16.231 WARNUNG [http-nio-8080-exec-2]
org.apache.catalina.webresources.Cache.getResource Unable to add the resource
at [/gui/.../.../Navigation.js] to the cache for web application [/x-gui-x]
because there was insufficient free space available after evicting expired
cache entries - consider increasing the maximum size of the cache"

However, instead of returning a 500 Internal Server Error, Tomcat still
responds with 200 OK, even when the resource cannot be served correctly from
the cache. This leads to errors in the frontend console, and the application
does not work.

The following errors appear in the browser’s developer console:

"ext-all-rtl-debug.js?_dc=1738747870964:10032 [E] [Loader] app.view.InfoView
from app/.../.../appView.js
log @ ext-all-rtl-debug.js?_dc=1738747870964:10032
logx @ ext-all-rtl-debug.js?_dc=1738747870964:10068
Ext.apply.log.log.error @ ext-all-rtl-debug.js?_dc=1738747870964:10071"

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 69567] Tomcat returns 200 OK instead of 500 Internal Server Error on cache eviction failure leading to application errors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69567

--- Comment #4 from Christopher Schultz <ch...@christopherschultz.net> ---
Yass, please test the current release candidate 11.0.3.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 69567] Tomcat returns 200 OK instead of 500 Internal Server Error on cache eviction failure leading to application errors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69567

--- Comment #2 from Yass <Yo...@PROSTEP.com> ---
Thank you for your response.

While I understand that cache eviction failures should not impact the resource
serving process itself, in my case, the behavior is slightly different. The
application works as expected when I increase the cache size
(cacheMaxSize="104857600"). The issue seems to occur specifically in Apache
Tomcat versions 10.1.32, 11.0.1 and 11.0.2. With versions earlier than 11.0.1,
I am not seeing this behavior. 

Steps to Reproduce:
-Start Tomcat 11.0.1 or 11.0.2.
-Set cacheMaxSize="1024" in the application's context.xml: <Resources
cacheMaxSize="1024"/>.
-Deploy an application serving large resources (e.g., JS files).
-Tomcat returns 200 OK, but the resource is missing (no content).

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 69567] Tomcat returns 200 OK instead of 500 Internal Server Error on cache eviction failure leading to application errors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69567

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Cache eviction failures shouldn't impact the serving of the resource. It is
just a warning that the resource will not be cached as sufficient room could
not be made for it in the cache.

If you are seeing errors that the root cause might be related but it is
something different.

Please provide the simplest possible test case that demonstrates this issue.

You might also want to test with 11.0.3 (currently being voted on) as there is
at least one potentially related issue (bug 69527) fixed in that release.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 69567] Tomcat returns 200 OK instead of 500 Internal Server Error on cache eviction failure leading to application errors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69567

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Mark Thomas <ma...@apache.org> ---


*** This bug has been marked as a duplicate of bug 69527 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 69567] Tomcat returns 200 OK instead of 500 Internal Server Error on cache eviction failure leading to application errors

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69567

--- Comment #5 from Yass <Yo...@PROSTEP.com> ---
The version 11.0.3. worked!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org