添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
豁达的跑步鞋  ·  javax.print.attribute_ ...·  4 月前    · 
独立的红豆  ·  4.1. Input Validation ...·  9 月前    · 

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms .

Support for Server* products ended on February 15th 2024 . If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

You imported a space from another confluence site and you're seeing an error message when trying to load it:

Environment

This problem was identified in Confluence server and datacenter version 7.4.3. It could also affect other versions of Confluence.


Diagnosis

The error in the UI can be found in the atlassian-confluence.log file:

2021-03-31 15:25:27,793 ERROR [http-nio-8090-exec-368] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
 -- url: /confluence/display/TEST | traceId: 7e862b028a2118fa | userName: testuser
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not execute statement; sql=n/a; ORA-00001: unique constraint (database) violated
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (database) violated
Caused by: Error : 1, Position : 0, Sql = insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (:1 , :2 , :3 , :4 ), OriginalSql = insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (?, ?, ?, ?), Error Msg = ORA-00001: unique constraint (database) violated

The relevant part of the error is that it tells us the query that hit the constraint error:

insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (:1 , :2 , :3 , :4 ), OriginalSql = insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (?, ?, ?, ?)

On some occasions, the variables binding didn't happen so we won't know the actual duplicated entry.


Cause

A duplicated entry either in the entities.xml file or database.

Solution

select im.attachmentid, c.contenttype, c.title, s.spacename 
from IMAGEDETAILS im
join CONTENT c ON im.ATTACHMENTID=c.CONTENTID
join SPACES s ON c.SPACEID=s.SPACEID
where SPACENAME = '<spacename>';
  • Change the <spacename> value to the actual space name you imported to list the attachments.
  • Get the ATTACHMENTID values and update the following query before running it:

  •