java.sql.BatchUpdateException: Batch entry 0 insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (482, 630, 'image/jpeg', 17137749) was aborted. Call getNextException to see the cause.

Atlassian JIRA | Rachel Fuerst [Atlassian] | 6 months ago
  1. 0

    h3. Summary When trying to save or edit a question with an image attachment, an error is thrown, and the question cannot be saved. This also applies to questions with attachments that are edited after the fact (i.e. questions with attachments cannot be edited). h3. Steps to Reproduce # Ask a question in Questions for Confluence # Add an image attachment in the question # Add a “Popular topic” # Click *Save* h3. Expected Results The question is saved and posted. h3. Actual Results The below exception is thrown in the Confluence Log file: {noformat} org.springframework.dao.DataIntegrityViolationException: Hibernate operation: Could not execute JDBC batch update; SQL []; Batch entry 0 insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (482, 630, 'image/jpeg', 17137749) was aborted. Call getNextException to see the cause.; nested exception is java.sql.BatchUpdateException: Batch entry 0 insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (482, 630, 'image/jpeg', 17137749) was aborted. Call getNextException to see the cause. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:102) caused by: java.sql.BatchUpdateException: Batch entry 0 insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (482, 630, 'image/jpeg', 17137749) was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746) Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (482, 630, 'image/jpeg', 17137749) was aborted. Call getNextException to see the cause. at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1887) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:405) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2893) at sun.reflect.GeneratedMethodAccessor621.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.github.gquintana.metrics.proxy.MethodInvocation.proceed(MethodInvocation.java:75) at com.github.gquintana.metrics.sql.AbstractStatementProxyHandler.invoke(AbstractStatementProxyHandler.java:64) at com.github.gquintana.metrics.proxy.ProxyHandler.invoke(ProxyHandler.java:73) at com.sun.proxy.$Proxy525.executeBatch(Unknown Source) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54) at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:128) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2465) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2419) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2288) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510) ... 400 more caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "imagedetails_pkey" {noformat} h3. Notes This occurs with or without assigning a question to a space. It has been reproduced in Confluence Cloud version 1000.122.0 and Questions for Confluence version 2.4.14-D20160504T221817. h3.Workaround Add image attachment as a comment to the question instead of directly in the question.

    Atlassian JIRA | 6 months ago | Rachel Fuerst [Atlassian]
    java.sql.BatchUpdateException: Batch entry 0 insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (482, 630, 'image/jpeg', 17137749) was aborted. Call getNextException to see the cause.
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Openfire SSO on Windows - Spiceworks

    spiceworks.com | 1 year ago
    java.sql.BatchUpdateException: Batch entry 0 DELETE ofPubsubItem FROM ofPubsubItem LEFT JOIN (SELECT id FROM ofPubsubItem WHERE serviceID=username@im.domain.org AND nodeID=urn:xmpp:microblog:0 ORDER BY creationDate DESC LIMIT 1000000) AS noDelete ON ofPubsubItem.id = noDelete.id WHERE noDelete.id IS NULL AND ofPubsubItem.serviceID = username@domain.org AND nodeID = urn:xmpp:microblog:0 was aborted. Call getNextException to see the cause.

    10 unregistered visitors
    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. java.sql.BatchUpdateException

      Batch entry 0 insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (482, 630, 'image/jpeg', 17137749) was aborted. Call getNextException to see the cause.

      at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError()
    2. PostgreSQL JDBC Driver
      AbstractJdbc2Statement.executeBatch
      1. org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746)
      2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1887)
      3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:405)
      4. org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2893)
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor621.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:498)
      3 frames
    4. com.github.gquintana
      ProxyHandler.invoke
      1. com.github.gquintana.metrics.proxy.MethodInvocation.proceed(MethodInvocation.java:75)
      2. com.github.gquintana.metrics.sql.AbstractStatementProxyHandler.invoke(AbstractStatementProxyHandler.java:64)
      3. com.github.gquintana.metrics.proxy.ProxyHandler.invoke(ProxyHandler.java:73)
      3 frames
    5. com.sun.proxy
      $Proxy525.executeBatch
      1. com.sun.proxy.$Proxy525.executeBatch(Unknown Source)
      1 frame
    6. org.apache.tomcat
      DelegatingStatement.executeBatch
      1. org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
      2. org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
      3. org.apache.tomcat.dbcp.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
      3 frames
    7. net.sf.hibernate
      JDBCTransaction.commit
      1. net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
      2. net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:128)
      3. net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2465)
      4. net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2419)
      5. net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2288)
      6. net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
      6 frames
    8. Hibernate
      HibernateTransactionManager.doCommit
      1. org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510)
      1 frame
    9. PostgreSQL JDBC Driver
      AbstractJdbc2Statement$BatchResultHandler.handleError
      1. org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2746)
      1 frame