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

Images in Questions for Confluence don't work

XMLWordPrintable

      Summary

      Images attached to initial Confluence Questions are not displayed in another Browser session.

       

      Testing Environment

      Confluence 6.6.1 with Confluence Question plugin v2.5.5

      (Also tested this Confluence v6.3.1 and 6.7.2)
      (Also tested this with Collaborative Editing disabled which does not help)
       

      Steps to Reproduce

      1. Create a new Question by clicking on "Ask question"
      2. Attach an image to the question.
      3. Add topic and Save. 
      4. Open the question in a fresh browser, like Safari's Private Window.
      5. Open the question again, the image will not be displayed.

       

      Expected Result

      The image show up correctly as the user uploaded.


       

      Actual Result

      The image doesn't appear and the browser shows a resource not found error.


       

      Resolution:

      Upgrade to Confluence Questions 2.6.6 or newer

      Diagnosis 1:

      1. When clicking on "Ask Question", a row in CONTENT is inserted immediately with the following content (e.g. CONTENTID 3407882)

      contentid hibernateversion contenttype title                 lowertitle            version creator                          creationdate        
      --------- ---------------- ----------- --------------------- --------------------- ------- -------------------------------- ------------------- 
      3407882   2                CUSTOM      ignorable draft title ignorable draft title 1       2c96b0bc61791f10016179204cb80000 2018-03-12 14:56:06 
      

      2. Once the attachment is uploaded into the Question and the Question is Saved, the above row is eventually updated and deleted and a new row in CONTENT is created with a brand new contentid (e.g. 3407884)

      contentid hibernateversion contenttype title                lowertitle           version 
      --------- ---------------- ----------- -------------------- -------------------- ------- 
      3407885   1                ATTACHMENT  jstack_analysis3.png jstack_analysis3.png 1       
      3407884   2                CUSTOM      3407882              3407882              1       
      

      3. However, in BODYCONTENT, the image attachment in the body is still pointing to the very original PAGE ID 3407882 instead of the new PAGE ID (i.e. 3407884):

      bodycontentid body                                                                                                                                                                          
      ------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
      3440649       <p>3407882<img src="http://localhost:6670/c670/download/attachments/3407882/myimage.png?version=1&amp;modificationDate=1520826995407&amp;api=v2" height="250" /></p> 
      

      Diagnosis 2:

      1. Check the URL for the Confluence Question, e.g.:

      http://localhost:8090/questions/3407895/how-do-i-reset-the-wifi
      

      2. Right click on the broken image of the initial Confluence Question post and the ID after the attachments does not match to the above Question URL, e.g. image is linking to 3407893 and not the above 3407895:

      http://localhost:8090/download/attachments/3407893/jstack_analysis2.png?version=1&modificationDate=1520827628523&api=v2
      

      Workaround 1 - for New Questions

      The following procedure is not a scalable workaround, but works.

      1. Create a new question and save it without any images in it.
      2. Browse to that question again and edit it.
      3. Upload the images required in the question and save it.

      Workaround 2 - for Existing Questions

      1. Open the faulty Question.
      2. Right Click on the broken image of the Question and Open Image in a New Tab.
      3. Match the URL of the Question and the New Tab. Update the number after attachments in the New Tab to be the same as the the number after questions and press Enter.
      4. The Image will be displayed.
      5. Download this image.
      6. Edit the faulty Question and re-attach the image.

        1. 404.png
          404.png
          263 kB
        2. right-click.png
          right-click.png
          80 kB
        3. match URL.png
          match URL.png
          125 kB
        4. image bug.png
          image bug.png
          268 kB
        5. image attached.png
          image attached.png
          281 kB

              qpham@atlassian.com Quan Pham
              haftab Hassan Aftab
              Votes:
              13 Vote for this issue
              Watchers:
              25 Start watching this issue

                Created:
                Updated:
                Resolved: