Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-47484

Moving question with attachment cause the question to be no longer editable with "A system error has occurred" ERROR

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Step to replicate

      1. Create a question and attach an attachmen to the question.
      2. Edit the question and move it to another space.
      3. Edit the question again.

      Observed Result:
      The following ERROR appear in the browser

      Your Confluence administrator can use the support request form to create a support ticket which will include this information.
      
      We will respond as promptly as possible.
      Thank you!
      
      Return to site homepage…
      Cause
      
      java.lang.NullPointerException: inputStream cannot be null
      at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
      Stack Trace:[hide]
      
      java.lang.NullPointerException: inputStream cannot be null
      at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
      at com.atlassian.confluence.pages.persistence.dao.AttachmentDataStream$InputStreamWrapper.<init>(AttachmentDataStream.java:43)
      at com.atlassian.confluence.pages.persistence.dao.filesystem.FileSystemAttachmentDataDao.rawBinaryWrapper(FileSystemAttachmentDataDao.java:155)
      at com.atlassian.confluence.pages.persistence.dao.filesystem.FileSystemAttachmentDataDao.saveDataForAttachment(FileSystemAttachmentDataDao.java:150)
      at 
      

      The attachment which is stored in the filesystem are not moved to the new location after the question is moved to the new space. The attachment still exist in the old location in the filesystem. Because the question in the new space is trying to refer to the attachment in the new location, it could not find the attachment which resulted in the ERROR.

      For example
      Before the question was moved to the new space, the attachment is stored in the following location in the filesystem:

      /home/jing/atlassian/atlassian-confluence-5.6.6/data/attachments/ver003/172/223/59473922/146/60/59310146/59441182

      After it has been moved it is still in the same location:

      /home/jing/atlassian/atlassian-confluence-5.6.6/data/attachments/ver003/172/223/59473922/146/60/59310146/59441182

      By right, the value /172/223/59473922 in the path above should be difference as it is suppose to be reffering to new spaceid as explained here https://confluence.atlassian.com/display/DOC/Hierarchical+File+System+Attachment+Storage.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jcheok Jing Hwa Cheok (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: