Bitbucket Server sync problem with Active directory

Deleted user November 2, 2015

Were facing a syncing problem on Bitbucket Server (v3.11.2)

The full sync fails on refreshing the cache. The relevant log entries  are here:

2015-11-03 07:44:14,480 INFO  [clusterScheduler_Worker-7]  c.a.s.i.user.HibernateStashUserDao Archiving user madh with slug madh to madh_ar/madh_ar

2015-11-03 07:44:14,495 WARN  [clusterScheduler_Worker-7]  o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: 2627, SQLState: 23000

2015-11-03 07:44:14,495 ERROR [clusterScheduler_Worker-7]  o.h.e.jdbc.spi.SqlExceptionHelper Violation of UNIQUE KEY constraint 'uk_mem_dir_parent_child'. Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (3309569, madh, z_gis_owa_2010, GROUP_USER).

2015-11-03 07:44:14,495 WARN  [clusterScheduler_Worker-7]  o.h.e.jdbc.spi.SqlExceptionHelper SQL Warning Code: 3621, SQLState: S0000

2015-11-03 07:44:14,495 WARN  [clusterScheduler_Worker-7]  o.h.e.jdbc.spi.SqlExceptionHelper The statement has been terminated.

2015-11-03 07:44:14,573 ERROR [clusterScheduler_Worker-7]  c.a.c.d.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory [ 3309569 ].

 

What can I do to remove the duplicate key error?

 

 

 

3 answers

1 accepted

0 votes
Answer accepted
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2018

Hi @[deleted],

Usually these issues are caused by a problem with the directory synchronization.

 

To resolve them, let's try to recreate the user directory by following these steps:

- Disable the existing external user directories

- Create new user directories with the same settings as the older ones

- If everything works fine, delete the older user directories to keep a clean configuration

 

Here the link to the External user directories configuration.

 

Cheers,

Caterina - Atlassian

0 votes
Idan Bidani August 31, 2016

We experience it too on 4.6.3 connecting to Active Directory

Any luck with this issue? Did you manage to identify the cause?

 

0 votes
matthew wood May 25, 2016

I have the exact same error running on Bitbucket v4.4

It appears this AD user was expired within AD at some point but then i expect the account was re-enabled.

Bitbucket LDAP config:  Filter out expired users was enabled.  

i've disabled this and attempted to re-sync again but still get the same error.



2016-05-26 18:30:59,290 INFO  [clusterScheduler_Worker-5]  c.a.s.i.user.HibernateStashUserDao Archiving user m041489 with slug m041489 to m041489_ar/m041489_ar

2016-05-26 18:30:59,314 WARN  [clusterScheduler_Worker-5]  o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: 2627, SQLState: 23000

2016-05-26 18:30:59,314 ERROR [clusterScheduler_Worker-5]  o.h.e.jdbc.spi.SqlExceptionHelper Violation of UNIQUE KEY constraint 'uk_mem_dir_parent_child'. Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (229377, m041489, wbc information technology-resource-all users, GROUP_USER).

2016-05-26 18:30:59,314 WARN  [clusterScheduler_Worker-5]  o.h.e.jdbc.spi.SqlExceptionHelper SQL Warning Code: 3621, SQLState: S0000

2016-05-26 18:30:59,314 WARN  [clusterScheduler_Worker-5]  o.h.e.jdbc.spi.SqlExceptionHelper The statement has been terminated.

2016-05-26 18:30:59,364 ERROR [clusterScheduler_Worker-5]  c.a.c.d.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory [ 229377 ].

org.hibernate.exception.ConstraintViolationException: could not execute statement

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'uk_mem_dir_parent_child'. Cannot insert duplicate key in object 'dbo.cwd_membership'. The duplicate key value is (229377, m041489, wbc information technology-resource-all users, GROUP_USER).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events