Editing a page fails with a 500 error
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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
users are unable to edit some pages with an exception.
Environment
- Confluence 8.5
- External Links on page
- PostgreSQL
Diagnosis
In the atlassian-confluence.log, the exception logs when editing the page:
2024-02-22 12:36:39,661 ERROR [https-jsse-nio2-8090-exec-90 url: /rest/tinymce/1/drafts; user:admin] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error :
-- url: /rest/tinymce/1/drafts | userName: | referer: https://localhost:8090/pages/resumedraft.action?draftId=10001&draftShareId= | traceId: 3309c94855b1b652
org.springframework.orm.hibernate5.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [XX002]; error code [0]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
Caused by: org.postgresql.util.PSQLException: ERROR: table tid from new index tuple (3902,10) overlaps with invalid duplicate tuple at offset 50 of block 95 in index "l_destpgtitle_idx"
Error points to a database side:
JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [XX002]; error code [0]
index for l_destpgtitle_idx
Caused by: org.postgresql.util.PSQLException: ERROR: table tid from new index tuple (3902,10) overlaps with invalid duplicate tuple at offset 50 of block 95 in index "l_destpgtitle_idx"
links table is associated to the l_destpgtitle_idx
conf854=# \d+ links
Table "public.links"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
------------------{}+{}-------------------------{}{}-------{}{}------{}{}-----{}{}------{}{}----------{}{}-----------
linkid | bigint | | not null | | plain | |
destpagetitle | character varying(255) | | | | extended | |
lowerdestpagetitle | character varying(255) | | | | extended | |
destspacekey | character varying(255) | | not null | | extended | |
lowerdestspacekey | character varying(255) | | | | extended | |
contentid | bigint | | not null | | plain | |
creator | character varying(255) | | | | extended | |
creationdate | timestamp without time zone | | | | plain | |
lastmodifier | character varying(255) | | | | extended | |
lastmoddate | timestamp without time zone | | | | plain | |
Indexes:
"links_pkey" PRIMARY KEY, btree (linkid)
"l_contentid_idx" btree (contentid)
"l_destspacekey_idx" btree (destspacekey)
"l_ldestpgtitle_idx" btree (lowerdestpagetitle)
"l_ldestspacekey_idx" btree (lowerdestspacekey)
"links_creator_idx" btree (creator)
"links_lastmodifier_idx" btree (lastmodifier)
Remove the links from the affected page and attempt to edit the page.
If the page publishes the content, proceed to solution.
Cause
Database base error is caused by a corrupt index. SQL state [XX002]; error code [0]
XX002 | index_corrupted |
Index highlights l_destpgtitle_idx in the links table.
Solution
Please contact the DBA or database export to index the links table or database.
Before making changes to the database, please back up your DB. Also, the admin will need to stop Confluence.
If the problem persists, contact Atlassian support.