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

Abusive modification of the cached document when moving an attachment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 18.4.3, 18.6.0-rc-1, 17.10.10
    • 17.10.9, 18.5.0, 18.4.2
    • Attachments
    • None
    • Windows 11 Pro, Firefox 152, using an instance of XWiki 18.4.2 on PostgreSQL 17, Tomcat 11.0.23
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. Add an attachment to a page
      2. Go to 'Attachments' tab, click on 'Move' from the 'Actions' column
      3. Choose a new page under 'New Attachment Location'
      4. Click 'Submit' button
      5. Click on 'Job log' to expand and observe the move logs

      Expected results

      No warnings are displayed (related to abusive modifications).

      Actual results

      The following warning is displayed twice:

       Abusive modification of the cached document
      class java.lang.IllegalStateException: Abusive modification of the cached document
          at com.xpn.xwiki.doc.XWikiDocument.warnWithStackTrace(XWikiDocument.java:9416)
          at com.xpn.xwiki.doc.XWikiDocument.setMetaDataDirty(XWikiDocument.java:2459)
          at com.xpn.xwiki.internal.doc.XWikiAttachmentList.updateList(XWikiAttachmentList.java:263)
          at com.xpn.xwiki.internal.doc.XWikiAttachmentList.remove(XWikiAttachmentList.java:158)
          at com.xpn.xwiki.doc.XWikiDocument.removeAttachment(XWikiDocument.java:5692)
          at com.xpn.xwiki.doc.XWikiDocument.removeAttachment(XWikiDocument.java:5678)
          at org.xwiki.attachment.internal.refactoring.job.MoveAttachmentJob.moveAttachment(MoveAttachmentJob.java:162)
          at org.xwiki.attachment.internal.refactoring.job.MoveAttachmentJob.process(MoveAttachmentJob.java:112)
          at org.xwiki.refactoring.internal.job.AbstractEntityJob.process(AbstractEntityJob.java:225)
          at org.xwiki.refactoring.internal.job.AbstractEntityJob.runInternal(AbstractEntityJob.java:202)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:246)
          at org.xwiki.job.AbstractJob.run(AbstractJob.java:223)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
          at java.base/java.lang.Thread.run(Thread.java:1474)
      

      No warnings on the XWiki console.

      The issue could be also reproduced on XWiki 17.10.9 and 18.6.0-SNAPSHOT.
       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: