Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-39539

Unable to load preview in Attachments macro without first loading preview from thumbnail

    XMLWordPrintable

Details

    Description

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

      Summary

      When attempting to preview an attachment in Attachments list macro, (in this case a .docx file), you receive error:

      We can't preview this file. You'll have to download the file to view it.

      However, if you add an attachment thumbnail of the same file at the bottom of the page, i.e. Insert > Files and Images, save the page, and then load that first and then try to load the preview from Attachments List, it then works.

      Environment

      • Confluence Cloud 5.9.1-OD-2015.40.1-0001

      Steps to Reproduce

      1. Create page in Confluence
      2. Upload .docx test file
      3. Insert Attachments macro (remove any previews added by uploading document.
      4. On the next line, click Insert > Files and Images, select the document, insert.
      5. Save page.
      6. Expand attachments list and click Preview button. Preview will not load and you'll receive an error asking you to download.
      7. Click thumbnail you added below, preview will load. Sometimes you'll need to try this twice.
      8. Exit out of preview, and now try to load the preview from the Attachments list, and it will load.

      Expected Results

      Preview should load on the first try.

      Actual Results

      The only error from the logs appears when initially saving the page.

      2015-10-12 11:00:01.181901500 2015-10-12 11:00:01,178 WARN [conversion-thread-cloud-10-internal] [net.sf.hibernate.StaleObjectStateException] <init> An operation failed due to stale data
      2015-10-12 11:00:01.181903500  -- referer: https://*/wiki/pages/createpage.action?spaceKey=ds&fromPageId=327686 | url: /wiki/pages/docreatepage.action | userName: sysadmin | action: docreatepage
      2015-10-12 11:00:01.181904500 net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for com.atlassian.confluence.pages.Attachment instance with identifier: 2621451
      2015-10-12 11:00:01.181916500 	at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:513)
      2015-10-12 11:00:01.181917500 	at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:673)
      2015-10-12 11:00:01.181917500 	at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:630)
      2015-10-12 11:00:01.181919500 	at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
      2015-10-12 11:00:01.181920500 	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2476)
      2015-10-12 11:00:01.181920500 	at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2462)
      2015-10-12 11:00:01.181924500 	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2420)
      2015-10-12 11:00:01.181924500 	at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2288)
      2015-10-12 11:00:01.181924500 	at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
      2015-10-12 11:00:01.181925500 	at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510)
      2015-10-12 11:00:01.181927500 	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
      2015-10-12 11:00:01.181927500 	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
      2015-10-12 11:00:01.181928500 	at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
      ...
      2015-10-12 11:00:01.182018500 	at com.sun.proxy.$Proxy2567.execute(Unknown Source)
      2015-10-12 11:00:01.182018500 	at com.atlassian.confluence.plugins.conversion.impl.runnable.cloud.CloudConversionRunnable.storeTicketId(CloudConversionRunnable.java:432)
      2015-10-12 11:00:01.182019500 	at com.atlassian.confluence.plugins.conversion.impl.runnable.cloud.CloudConversionRunnable.doCloudTicketConversion(CloudConversionRunnable.java:370)
      2015-10-12 11:00:01.182020500 	at com.atlassian.confluence.plugins.conversion.impl.runnable.cloud.CloudConversionRunnable.run(CloudConversionRunnable.java:147)
      2015-10-12 11:00:01.182021500 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2015-10-12 11:00:01.182021500 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2015-10-12 11:00:01.182023500 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2015-10-12 11:00:01.182023500 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      2015-10-12 11:00:01.182024500 	at java.lang.Thread.run(Thread.java:745)
      2015-10-12 11:00:01.183365500 2015-10-12 11:00:01,181 ERROR [conversion-thread-cloud-10-internal] [sf.hibernate.impl.SessionImpl] execute Could not synchronize database state with session
      2015-10-12 11:00:01.183366500  -- referer: https://*/wiki/pages/createpage.action?spaceKey=ds&fromPageId=327686 | url: /wiki/pages/docreatepage.action | userName: sysadmin | action: docreatepage
      2015-10-12 11:00:01.195288500 2015-10-12 11:00:01,192 ERROR [conversion-thread-cloud-10] [plugins.conversion.impl.TimeoutConversionRunnable] run Cannot convert. Execution error: 
      2015-10-12 11:00:01.195289500  -- referer: https://*/wiki/pages/createpage.action?spaceKey=ds&fromPageId=327686 | url: /wiki/pages/docreatepage.action | userName: sysadmin | action: docreatepage
      2015-10-12 11:00:01.195290500 org.springframework.orm.hibernate.HibernateSystemException: could not update: [com.atlassian.confluence.pages.Attachment#2621451]; nested exception is net.sf.hibernate.HibernateException: could not update: [com.atlassian.confluence.pages.Attachment#2621451]
      2015-10-12 11:00:01.195302500 	at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:597)
      2015-10-12 11:00:01.195302500 	at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:607)
      2015-10-12 11:00:01.195305500 	at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518)
      2015-10-12 11:00:01.195305500 	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
      2015-10-12 11:00:01.195309500 	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
      2015-10-12 11:00:01.195309500 	at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
      ...
      2015-10-12 11:00:01.195379500 Caused by: net.sf.hibernate.HibernateException: could not update: [com.atlassian.confluence.pages.Attachment#2621451]
      2015-10-12 11:00:01.195381500 	at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:693)
      2015-10-12 11:00:01.195382500 	at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:630)
      2015-10-12 11:00:01.195382500 	at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
      2015-10-12 11:00:01.195382500 	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2476)
      2015-10-12 11:00:01.195384500 	at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2462)
      2015-10-12 11:00:01.195388500 	at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2420)
      2015-10-12 11:00:01.195388500 	at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2288)
      2015-10-12 11:00:01.195389500 	at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
      2015-10-12 11:00:01.195389500 	at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510)
      2015-10-12 11:00:01.195393500 	... 49 more
      2015-10-12 11:00:01.195394500 Caused by: net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for com.atlassian.confluence.pages.Attachment instance with identifier: 2621451
      2015-10-12 11:00:01.195395500 	at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:513)
      2015-10-12 11:00:01.195396500 	at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:673)
      2015-10-12 11:00:01.195397500 	... 57 more
      

      In Network Inspector, upon failed load, you get *wiki/rest/documentConversion/0.1/conversion/convert/2621451/undefined?_=1444640445461

      On positive load you get *wiki/rest/documentConversion/0.1/conversion/convert/2621451/1

      Workaround

      Include thumbnail of attachment and load preview from that.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              smackie@atlassian.com Shannon S
              Votes:
              9 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: