This issue has been created
There are 4 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-ab66571c-3cd7-47d6-836b-f6bd3ec3a97f XWIKI-25496 Open

An error is logged when the Chrome Docker container used for the PDF export is removed before XWiki waits for it to stop

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-111cd706-c37c-4e28-a6b1-a0ca502b4e86 Simon Urli created this issue on 22/Oct/26 14:30
 
Summary: An error is logged when the Chrome Docker container used for the PDF export is removed before XWiki waits for it to stop
Issue Type: cid:jira-generated-image-avatar-ab66571c-3cd7-47d6-836b-f6bd3ec3a97f Bug
Affects Versions: 14.4.2
Assignee: Unassigned
Components: Export - PDF
Created: 22/Oct/26 14:30
Priority: cid:jira-generated-image-static-minor-34d97143-9b63-45ab-8421-17673d8d8f9d Minor
Reporter: Simon Urli
Description:

Steps to reproduce

  1. Use the PDF export with the headless Chrome running in a Docker container created by XWiki (the default)
  2. Change the configuration of the Chrome Docker container in the PDF export administration (e.g. the container name or the remote debugging port), which stops the current container

Result

Sometimes the following error is logged:

ERROR g.d.a.a.ResultCallbackTemplate - Error during callback
com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such container: 503a136f7d164b930e7a800ecc1e0990..."}
	at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241)
	at com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)
	at java.base/java.lang.Thread.run(Thread.java:1474)

Expected

Nothing is logged: the container was stopped as asked.

Analysis

The Chrome container is created with automatic removal (ContainerManager#getHostConfig()). ContainerManager#stopContainer() stops it, then waits for it to be stopped with an asynchronous waitContainerCmd. When Docker has already removed the stopped container, the wait request fails with a 404, and docker-java's ResultCallbackTemplate#onError() logs it at error level before passing it to awaitCompletion(), which rethrows it. stopContainer() then ignores the NotFoundException, so the container is stopped as expected and only the error log remains. docker-java reported issue: https://github.com/docker-java/docker-java/issues/1689 (closed without change), the callback being meant to be extended.

Seen in PDFExportIT#updatePDFExportConfigurationWithValidation in the XWiki Environment Tests job (MySQL in build 1409, Oracle in build 1411). Found while assessing the impact of failing functional tests on ERROR logs again.

Proposed fix

Wait for the container to stop with a callback which completes, instead of failing, when the container doesn't exist anymore.

 
 

4 updates

 
cid:jira-generated-image-avatar-111cd706-c37c-4e28-a6b1-a0ca502b4e86 Changes by Simon Urli on 22/Oct/26 14:30
 
Fix Version: 17.10.15
Fix Version: 18.10.0-rc-1
Fix Version: 18.4.8
Assignee: Simon Urli