Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-19806

BridgeAuthorizationManager errors when deleting a subwiki which cause errors when creating another subwiki

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 14.4.2, 13.10.7, 14.5
    • 13.5, 13.10.6, 14.4.1
    • Security
    • Windows 11 Pro 64 bit, Chrome 102, using a local instance of XWiki 14.4.1 on MariaDB 10.6, Tomcat 9.0.63, reproduced also on Jetty/HSQL
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      STEPS TO REPRODUCE

      1. Create a subwiki (e.g. named 'subwikiglobal' with Scope 'Both global and local users are available in the wiki')
      2. Eventually after creating it wait for the Search Indexing Queue to be 0 to avoid any SOLR related errors
      3. Delete that subwiki
      4. Observe the XWiki console
      5. Create another subwiki (e.g. named 'subwikiglobal2')

      EXPECTED RESULTS

      The subwiki is deleted without any errors in console. The new subwiki is created also without errors in console/browser.

      ACTUAL RESULTS

      When deleting the subwiki ('subwikiglobal') there are many errors related to BridgeAuthorizationManager failing to load rights (please find attached the full logs). Partial stacktrace:

      2022-06-09 13:05:49,448 [http-nio-1115-exec-6 - http://localhost:1115/xwiki/bin/view/WikiManager/DeleteWiki] ERROR a.i.BridgeAuthorizationManager - Failed to load rights for user [xwiki:XWiki.ILIE] on [subwikiglobal:Sandbox.WebHome].
      org.xwiki.security.authorization.AuthorizationException: Could not retrieve the owner of this wiki when checking access to [Wiki subwikiglobal]
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:266)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.addImpliedGlobalRule(DefaultSecurityEntryReader.java:363)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getImpliedRules(DefaultSecurityEntryReader.java:340)
             
      	   [......]
      	   
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: The wiki subwikiglobal does not exist
              at com.xpn.xwiki.XWiki.getWikiOwner(XWiki.java:1583)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:264)
              ... 248 common frames omitted
      2022-06-09 13:05:49,464 [http-nio-1115-exec-6 - http://localhost:1115/xwiki/bin/view/WikiManager/DeleteWiki] ERROR a.i.BridgeAuthorizationManager - Failed to load rights for user [xwiki:XWiki.ILIE] on [subwikiglobal:XWiki.Notifications.Code.NotificationsDisplayerUIX].
      org.xwiki.security.authorization.AuthorizationException: Could not retrieve the owner of this wiki when checking access to [Wiki subwikiglobal]
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:266)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.addImpliedGlobalRule(DefaultSecurityEntryReader.java:363)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getImpliedRules(DefaultSecurityEntryReader.java:340)
      		
              [......]
      		
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: The wiki subwikiglobal does not exist
              at com.xpn.xwiki.XWiki.getWikiOwner(XWiki.java:1583)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:264)
              ... 248 common frames omitted
      2022-06-09 13:05:49,485 [http-nio-1115-exec-6 - http://localhost:1115/xwiki/bin/view/WikiManager/DeleteWiki] ERROR a.i.BridgeAuthorizationManager - Failed to load rights for user [xwiki:XWiki.ILIE] on [subwikiglobal:Main.WebHome].
      org.xwiki.security.authorization.AuthorizationException: Could not retrieve the owner of this wiki when checking access to [Wiki subwikiglobal]
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:266)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.addImpliedGlobalRule(DefaultSecurityEntryReader.java:363)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getImpliedRules(DefaultSecurityEntryReader.java:340)
      		
              [......]
      		
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: The wiki subwikiglobal does not exist
              at com.xpn.xwiki.XWiki.getWikiOwner(XWiki.java:1583)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:264)
              ... 248 common frames omitted
      2022-06-09 13:05:49,505 [http-nio-1115-exec-6 - http://localhost:1115/xwiki/bin/view/WikiManager/DeleteWiki] ERROR a.i.BridgeAuthorizationManager - Failed to load rights for user [xwiki:XWiki.ILIE] on [subwikiglobal:XWiki.PageTagsUIX].
      org.xwiki.security.authorization.AuthorizationException: Could not retrieve the owner of this wiki when checking access to [Wiki subwikiglobal]
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:266)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.addImpliedGlobalRule(DefaultSecurityEntryReader.java:363)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getImpliedRules(DefaultSecurityEntryReader.java:340)
      		
              [......]
      		
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: The wiki subwikiglobal does not exist
              at com.xpn.xwiki.XWiki.getWikiOwner(XWiki.java:1583)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:264)
              ... 248 common frames omitted
      2022-06-09 13:05:49,522 [http-nio-1115-exec-6 - http://localhost:1115/xwiki/bin/view/WikiManager/DeleteWiki] ERROR a.i.BridgeAuthorizationManager - Failed to load rights for user [xwiki:XWiki.ILIE] on [subwikiglobal:Sandbox.TestPage1].
      org.xwiki.security.authorization.AuthorizationException: Could not retrieve the owner of this wiki when checking access to [Wiki subwikiglobal]
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:266)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.addImpliedGlobalRule(DefaultSecurityEntryReader.java:363)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getImpliedRules(DefaultSecurityEntryReader.java:340)
      		
              [......]
      		
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: The wiki subwikiglobal does not exist
              at com.xpn.xwiki.XWiki.getWikiOwner(XWiki.java:1583)
              at org.xwiki.security.authorization.internal.DefaultSecurityEntryReader.getWikiOwner(DefaultSecurityEntryReader.java:264)
              ... 248 common frames omitted
      		
      		[.....]

      When the new subwiki 'subwikiglobal2' is created, there are some errors in browser logs related to previously deleted subwiki 'subwikiglobal' and it offers the option to 'Clean & delete this wiki'.

      However, I've noticed that after the deletion of the first subwiki the instance is restarted, the new subwiki is created without errors.

      It is to be mentioned that the issue doesn't reproduce at all times, but very often from what I've tested.

      I've reproduced it also on 13.10.6 and it seems the regression was introduced starting 13.5 as I didn't reproduce on XWiki 13.4.7.

      Attachments

        Issue Links

          Activity

            People

              surli Simon Urli
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: