Cannot Edit Restrictions on Confluence Tools > Restrictions, Stack Trace 'execute User with name '[User]' not found, but page permissions still exist on: page: [PageName]' due to nonexistent user
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
Problem
When trying to modify an existing Restriction, under Tools > Restrictions, the following error is thrown:
1
2
2013-08-06 11:44:12,876 WARN [http-8090-2] [confluence.pages.actions.GetPagePermissionsAction] execute User with name 'RemovedUser' not found, but page permissions still exist on: page: Test Page (106702962)
-- space: 44269570 | url: /pages/getpagepermissions.action | page: 106702962 | userName: admin | referer: http://192.168.10.101:8090/pages/viewpage.action?pageId=106702962 | action: getpagepermissions
Cause
There is a user entry in CONTENT PERM table that does not exist on the confluence user base. That will cause the above stack trace to appear.
Diagnosis:
To find those users that belong to restrictions that are no longer in Confluence Users run below one of the below queries:
1
2
3
4
5
6
7
-- From Confluence 5.2.3 to latest
SELECT * FROM CONTENT_PERM cp inner join CONTENT_PERM_SET cps on cp.CPS_ID=cps.ID
WHERE USERNAME NOT IN (SELECT user_key FROM user_mapping);
-- Prior Confluence 5.2.3
SELECT * FROM CONTENT_PERM cp inner join CONTENT_PERM_SET cps on cp.CPS_ID=cps.ID
WHERE USERNAME NOT IN (SELECT user_name FROM cwd_user);
Resolution
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Shutdown Confluence
Go to your Database and Run the following queries:
1 2 3 4 5 6 7
-- From Confluence 5.2.3 to latest delete from CONTENT_PERM where USERNAME NOT IN (SELECT user_key FROM user_mapping); delete from CONTENT_PERM_SET where ID NOT IN (select CPS_ID from CONTENT_PERM); -- Prior Confluence 5.2.3 delete from CONTENT_PERM where USERNAME NOT IN (SELECT user_name FROM cwd_user); delete from CONTENT_PERM_SET where ID NOT IN (select CPS_ID from CONTENT_PERM);
Restart Confluence
Check if the error messages are gone.
Was this helpful?