Cannot Add or Edit Permissions after Installing or Upgrading to Confluence 3.5.2 or Later

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

For each content object (page, blog post, etc.) only one user or group can have view or edit permissions. I.e. if a page if viewable by user A and the restrictions are then edited to make it also viewable by user B, Confluence fails to save the new permission. This only affects instances where all of the following are true:

  • Your instance is a fresh 3.5.2 installation or was at some point in the past upgraded to Confluence 3.5.2
  • You are using Oracle or Microsoft SQL Server as your database.

Cause

This is caused by a known bug, CONF-22374, where the same unique constraint is interpreted differently by different databases.

Workaround

  1. Drop the following constraints on the CONTENT_PERM table:

    alter table CONTENT_PERM drop constraint cp_unique_user;
    alter table CONTENT_PERM drop constraint cp_unique_group;
  2. For Oracle only, you might need to remove the indexes:

    DROP INDEX CP_UNIQUE_USER;
    DROP INDEX CP_UNIQUE_GROUP;
  3. Add the following constraint instead:

    alter table CONTENT_PERM add constraint cp_unique_user_groups unique (cps_id, cp_type, username, groupname)

(warning) If you experience that after upgrading to 4.2.x you still unable to manage page restrictions and in your atlassian_confluence.log you find error messages while trying to do so like the following, please try to apply the steps below as a workaround.

javax.servlet.error.exception: org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not insert: [com.atlassian.confluence.security.ContentPermission#11337731]; SQL [
]; Violation of UNIQUE KEY constraint 'cp_unique_user_groups'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.; nested exception is java.sql.SQLException: Violation of UNIQUE KEY constra
int 'cp_unique_user_groups'. Cannot insert duplicate key in object 'dbo.CONTENT_PERM'.

As a workaround, follow these steps:

  1. Rebuild your indices from scratch.
  2. Remove all restrictions from the problematic page/space.
  3. Re-apply all permissions.

In some cases, there seems to be a problem while upgrading when you previously faced problems with managing page restrictions, however the steps above seem to fix the issue.

Resolution

There is currently no resolution. Please apply the workaround if you are affected. The issue will be fixed in 3.5.3, but affected users will still need to apply the workaround.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Last modified on Feb 23, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.