This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-f7a66baf-d79a-46f6-8dc2-607930d132e0 XWIKI-25431 Open

An error is logged when the client cancels a request answered with an error page

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-c42de0ba-832d-42ec-8245-ce10a1988142 Simon Urli created this issue on 21/Oct/26 10:21
 
Summary: An error is logged when the client cancels a request answered with an error page
Issue Type: cid:jira-generated-image-avatar-f7a66baf-d79a-46f6-8dc2-607930d132e0 Bug
Affects Versions: 1.3 M2
Assignee: Unassigned
Components: Old Core
Created: 21/Oct/26 10:21
Priority: cid:jira-generated-image-static-minor-9cef1c8f-aa74-41ac-80e6-e845dc8354e3 Minor
Reporter: Simon Urli
Description:

Steps to reproduce

Request a missing attachment (e.g. an image whose attachment doesn't exist, displayed in an editor) and close the connection before XWiki has sent the response, for example by leaving the page or by having the browser cancel the image request.

Result

The following error is logged:

ERROR c.x.x.w.XWikiAction - Connection aborted. Root cause is [IOException: Connection reset by peer]

or, depending on how the connection was closed:

ERROR c.x.x.w.XWikiAction - Connection aborted. Root cause is [IOException: Broken pipe]

Similarly, when an action fails because the client closed the connection with a "Connection reset by peer", the failure is logged at warning level with its stack trace (Uncaught exception), while a "Broken pipe" is not logged.

Expected

Nothing is logged at error or warning level: the client closing the connection is not an error of the server and there's nothing the server can do about it.

Analysis

In XWikiAction#execute(), when the action fails with an error that is answered with an error page (e.g. ERROR_XWIKI_APP_ATTACHMENT_NOT_FOUND, answered with the attachmentdoesnotexist template), and sending this page fails because the client closed the connection (ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION), the failure is logged at error level. XWIKI-7408 lowered the same "Connection aborted" log to debug level when the action itself fails to send the response, but not this one.

Besides, before logging an uncaught exception at warning level, XWikiAction#execute() skips the ones caused by the client closing the connection by comparing the root cause message with IOException: Broken pipe only: depending on whether the client reset the connection, the servlet container reports a broken pipe or a connection reset.

Seen in the functional tests: ImageIT (CKEditor and BlockNote) logs it on the download of missing.png and image.gif in almost every build, in every environment of the XWiki Environment Tests job. The "Broken pipe" variant is registered as a global expected line in LogCaptureValidator; the "Connection reset by peer" variant was logged on PostgreSQL in XWiki Environment Tests build 1410. Found while assessing the impact of failing functional tests on ERROR logs again.

Related to XWIKI-25428, the same kind of problem in the rawResponse Velocity macro.

Proposed fix

  • Log the failure to send the error page at debug level, like the failure to send the response.
  • Skip both the broken pipe and the connection reset root causes before logging an uncaught exception.
 
 

1 update

 
cid:jira-generated-image-avatar-c42de0ba-832d-42ec-8245-ce10a1988142 Changes by Simon Urli on 21/Oct/26 10:21
 
Assignee: Simon Urli