Recently visited doesn't load for particular user after an upgrade
Platform Notice: Server and Data Center Only. This article only applies to Atlassian products on the server and data center platforms.
Recently visited page keeps spinning without loading anything.
The following appears in the
atlassian-confluence.log when clicking on
[http-nio-8090-exec-25] [service.content.factory.DefaultContentMetadataFactory] makeMetadata API metadata provider module threw an exception attempting to expand metadata. Class : com.atlassian.confluence.plugins.recentlyviewed.cql.metadata.CurrentUserMetadataProvider provides properties [currentuser]. Exception java.lang.IllegalArgumentException: duplicate key: 93946027
Run the following database query to make sure there's no duplicated record in the database :
SELECT * FROM AO_92296B_AORECENTLY_VIEWED WHERE USER_KEY = (SELECT USER_KEY FROM user_mapping where lower_username = '<affected-user>') and CONTENT_ID=<duplicated key shown in the logs>;
Insert affected user's
user_key and duplicated key that shown in the logs into the query (example: "93946027" based on the sample error message above). If the query return more than one query, then you may proceed with resolution.
The reason that causes Confluence to have duplicated row of records in the table
AO_92296B_AORECENTLY_VIEWED remains unknown.
The duplicated row of records in the mentioned table will not affect the
Recently visited page in version 5.8.x, however it will affect in the version 5.9.x.
Run the following query to remove duplicated records in the table.
your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Alwaysyour data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
DELETE FROM AO_92296B_AORECENTLY_VIEWED WHERE ID='<ID shown in query output above>';