This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-416e88b3-eb0c-4d0e-8ff0-16280a2c0fc4 XWIKI-25420 Open

Errors are logged when deleting a wiki whose users have cached asynchronous rendering results

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-ff52d19e-d294-459a-86cf-f073541223ac Simon Urli created this issue on 20/Oct/26 12:09
 
Summary: Errors are logged when deleting a wiki whose users have cached asynchronous rendering results
Issue Type: cid:jira-generated-image-avatar-416e88b3-eb0c-4d0e-8ff0-16280a2c0fc4 Bug
Affects Versions: 11.8
Assignee: Unassigned
Components: Rendering - Async, Wiki
Created: 20/Oct/26 12:09
Priority: cid:jira-generated-image-static-minor-c471d900-5054-45cf-8c81-189b78ed973c Minor
Reporter: Simon Urli
Description:

Steps to reproduce

  1. Create a subwiki
  2. Log in with a user of the subwiki and view pages rendered asynchronously (so that rendering results associated with right checks for that user are cached)
  3. Delete the subwiki

Expected

The wiki is deleted without error.

Actual

The wiki is deleted, but an error is logged for each cached right check involving the deleted wiki:

ERROR o.x.s.a.DefaultAuthorizationManager - Failed to load rights for user [subwiki:XWiki.LocalSubWikiUser] on [subwiki:XWiki.LocalSubWikiUser].
org.xwiki.security.authorization.AuthorizationException: Failed to get groups for user or group [subwiki:XWiki.LocalSubWikiUser] in wiki [Wiki subwiki]
	at org.xwiki.security.internal.DefaultUserBridge.getGroupsReferencesFor(DefaultUserBridge.java:129)
	...
	at org.xwiki.security.authorization.DefaultAuthorizationManager.hasAccess(DefaultAuthorizationManager.java:116)
	at org.xwiki.rendering.async.internal.AsyncRendererCache.checkRight(AsyncRendererCache.java:301)
	at org.xwiki.rendering.async.internal.AsyncRendererCache.cleanCacheForRight(AsyncRendererCache.java:295)
	at org.xwiki.rendering.async.internal.AsyncRendererCacheListener.onEvent(AsyncRendererCacheListener.java:88)
	at org.xwiki.security.authorization.internal.DefaultSecurityCacheRulesInvalidatorListener.onEvent(DefaultSecurityCacheRulesInvalidatorListener.java:180)
	at com.xpn.xwiki.XWiki.afterDelete(XWiki.java:4718)
	...
	at org.xwiki.wiki.internal.manager.DefaultWikiDeleter.delete(DefaultWikiDeleter.java:68)
	at org.xwiki.wiki.internal.manager.DefaultWikiManager.delete(DefaultWikiManager.java:147)
	at org.xwiki.wiki.script.WikiManagerScriptService.deleteWiki(WikiManagerScriptService.java:222)
Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 0: Exception while executing query. Named query = [listGroupsForUser]
Caused by: org.xwiki.query.QueryException: Exception while executing query. Named query = [listGroupsForUser]
Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: No wiki with id [subwiki] could be found

Analysis

DefaultWikiDeleter#delete deletes the wiki descriptor document before the wiki database. Deleting the descriptor triggers a RightUpdatedEvent (DefaultSecurityCacheRulesInvalidatorListener), on which AsyncRendererCacheListener calls AsyncRendererCache#cleanCacheForRight(): every right check associated with a cached rendering result is evaluated again, including the ones whose user or entity belongs to the wiki being deleted. Since the wiki descriptor is gone, evaluating them fails and DefaultAuthorizationManager logs an error (and returns false, so the cache entries are removed anyway). The WikiDeletedEvent handling of AsyncRendererCacheListener comes later, after the database is deleted, and doesn't remove the right checks of the deleted wiki.

A possible fix: in AsyncRendererCache, remove the entries associated with a right check whose user or entity belongs to a wiki that doesn't exist anymore, without evaluating it.

Found in the logs of SubWikiIT (xwiki-platform-wiki-test-docker) in the XWiki Environment Tests job on CI (master builds 1406 and 1409, in 6 of the 8 environment runs), when the test deletes the subwiki it created.

 
 

1 update

 
cid:jira-generated-image-avatar-ff52d19e-d294-459a-86cf-f073541223ac Changes by Simon Urli on 20/Oct/26 12:10
 
Assignee: Simon Urli