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)

Atlassian JIRA | Shannon Mackie [Atlassian] | 1 year ago
  1. 0

    h3. Summary When attempting to preview an attachment in Attachments list macro, (in this case a .docx file), you receive error: {quote}We can't preview this file. You'll have to download the file to view it.{quote} !Screen Shot 2015-10-12 at 11.06.53.jpg|thumbnail! 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. h3. Environment * Confluence Cloud 5.9.1-OD-2015.40.1-0001 h3. Steps to Reproduce # Create page in Confluence # Upload {{.docx}} test file # Insert {{Attachments}} macro (remove any previews added by uploading document. # On the next line, click *Insert > Files and Images*, select the document, insert. # Save page. # Expand attachments list and click *Preview* button. Preview will not load and you'll receive an error asking you to download. # Click thumbnail you added below, preview will load. Sometimes you'll need to try this twice. # Exit out of preview, and now try to load the preview from the Attachments list, and it will load. h3. Expected Results Preview should load on the first try. h3. Actual Results The only error from the logs appears when initially saving the page. {noformat} 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 {noformat} 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}} h3.Workaround Include thumbnail of attachment and load preview from that.

    Atlassian JIRA | 1 year ago | Shannon Mackie [Atlassian]
    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)
  2. 0

    h3. Summary When attempting to preview an attachment in Attachments list macro, (in this case a .docx file), you receive error: {quote}We can't preview this file. You'll have to download the file to view it.{quote} !Screen Shot 2015-10-12 at 11.06.53.jpg|thumbnail! 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. h3. Environment * Confluence Cloud 5.9.1-OD-2015.40.1-0001 h3. Steps to Reproduce # Create page in Confluence # Upload {{.docx}} test file # Insert {{Attachments}} macro (remove any previews added by uploading document. # On the next line, click *Insert > Files and Images*, select the document, insert. # Save page. # Expand attachments list and click *Preview* button. Preview will not load and you'll receive an error asking you to download. # Click thumbnail you added below, preview will load. Sometimes you'll need to try this twice. # Exit out of preview, and now try to load the preview from the Attachments list, and it will load. h3. Expected Results Preview should load on the first try. h3. Actual Results The only error from the logs appears when initially saving the page. {noformat} 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 {noformat} 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}} h3.Workaround Include thumbnail of attachment and load preview from that.

    Atlassian JIRA | 1 year ago | Shannon Mackie [Atlassian]
    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)
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    recompilation & deploiment

    runawfe | 1 decade ago | *anonymous
    net.sf.hibernate.HibernateException: Could not find datasource

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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)

      at net.sf.hibernate.persister.EntityPersister.update()
    2. net.sf.hibernate
      SessionImpl.execute
      1. net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:630)
      2. net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
      3. net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2476)
      3 frames