-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
6.6.7, 6.13.8
-
None
-
7
-
Severity 2 - Major
-
1
-
Issue Summary
Customer wants to change a previously Read Only User Directory (LDAP Connector) to Read Only, with Local Groups and set a Default Group Memberships , but is unable to proceed and save due to an error Oops - an error has occurred.
Environment
Issue reproduced in Confluence Server and Data Center 6.6.7 and 6.13.8 with Oracle database with Active Directory LDAP Connector.
Steps to Reproduce
- Setup Confluence DC with Oracle
- Create a new User Directory as Active Directory LDAP Connector, Read Only
- Check on the database that the following line was created:
> select * from cwd_directory_attribute where attribute_name='autoAddGroups'; DIRECTORY_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE ------------ -------------- ---------------- 294914 autoAddGroups NULL
- Edit the Directory, change it to Read Only with Local Groups, input a group name in Default Group Membership
- Try to save
Expected Results
Save Succesful
Actual Results
When clicking Save and Test, gets the following error message:
Oops - an error has occurred
System Error
Cause
Stack Trace:[hide]
Referer URL
http://<base-URL>/plugins/servlet/embedded-crowd/configure/ldap/?directoryId=294914&xsrfTokenName=atl_token&xsrfTokenValue=01a6c92ddc7fa94142217ecb29a43faf0602002c
In the application logs we can observe the following:
2019-10-17 11:57:13,829 ERROR [http-nio-2667-exec-2] [atlassian.plugin.servlet.ServletModuleContainerServlet] service Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not execute statement; sql=n/a; SQL []; ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
-- referer: http://localhost:2667/c667/plugins/servlet/embedded-crowd/configure/ldap/?directoryId=294914&xsrfTokenName=atl_token&xsrfTokenValue=01a6c92ddc7fa94142217ecb29a43faf0602002c | url: /c667/plugins/servlet/embedded-crowd/configure/ldap/ | traceId: 263aca2e6ddf60e2 | userName: admin
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not execute statement; sql=n/a; SQL []; ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:980)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:870)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:37)
...
Caused by: org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not execute statement; sql=n/a; SQL []; ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
...
Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
...
Caused by: Error : 1, Position : 0, Sql = insert into cwd_directory_attribute (directory_id, attribute_name, attribute_value) values (:1 , :2 , :3 ), OriginalSql = insert into cwd_directory_attribute (directory_id, attribute_name, attribute_value) values (?, ?, ?), Error Msg = ORA-00001: unique constraint (CONFLUENCE667.SYS_C0013078) violated
Workaround
- Get the ID of the Directory you are trying to edit in the Directory Configuration Summary:
http://<confluence-base-URL>/plugins/servlet/embedded-crowd/support/directories
It would look like this:Directory ID: 294914 Name: Active Directory server Active: true Type: CONNECTOR
- Run the following query on the database (replace 294914 by the Directory ID you found, and confluence-users with the group of your choice):
update cwd_directory_attribute set attribute_value='confluence-users' where directory_id=294914 and attribute_name='autoAddGroups';
- Try to Edit the Directory, perform the change to Read Only with Local Groups, and Save again.