Duplicate NOTIFICATIONID When Creating/Editing a Content (Page, Comments, etc.)
Symptoms
All types of content cannot be created or edited.
The following appears in the atlassian-confluence.log
:
Cause
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: com.atlassian.confluence.mail.notification.Notification#35946524;
SQL []; ERROR: duplicate key value violates unique constraint
"notifications_pkey" Detail: Key (notificationid)=(35946524) already
exists.; nested exception is org.postgresql.util.PSQLException: ERROR:
duplicate key value violates unique constraint "notifications_pkey"
Detail: Key (notificationid)=(35946524) already exists.
Diagnosis
Try to disable Autowatch in your user profile. If that allows you to create a page in a fresh space, then this KB is applicable to you.
Cause
There is a rogue notification row in the NOTIFICATIONS table in the Confluence Database, highlighted in the log (in this example, 35946524).
Resolution
- Shutdown Confluence
Take a backup of the Confluence Database, then run the following query to remove those rogue notifications rows.
DELETE FROM notifications WHERE NOTIFICATIONID = <ID>;
Replace <ID> with the ID highlighted in the logs. In the log snippet above, the ID equals to 35946524
- Startup Confluence