Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
2.4.15
-
2
-
Severity 2 - Major
-
0
-
Description
NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.
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).
Steps to Reproduce
- Ask a question in Questions for Confluence
- Add an image attachment in the question
- Add a “Popular topic”
- Click Save
Expected Results
The question is saved and posted.
Actual Results
The below exception is thrown in the Confluence Log file:
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"
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.
Workaround
Add image attachment as a comment to the question instead of directly in the question.
Attachments
Issue Links
- relates to
-
CONFCLOUD-47189 Cannot save/edit question with image attachment
- Closed
- mentioned in
-
Page Loading...