Crowd Synchronization Fails with Integrity Constraint Violation in Bitbucket Server

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

After making some changes to the Bitbucket Server user directory in Crowd and re-syncing with Crowd via Bitbucket Server, the following exception is reported in the Bitbucket Server logs:

2012-12-29 22:30:08,664 WARN  [scheduler_Worker-6]  o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: -104, SQLState: 23505
2012-12-29 22:30:08,664 ERROR [scheduler_Worker-6]  o.h.e.jdbc.spi.SqlExceptionHelper integrity constraint violation: unique constraint or index violation: SYS_IDX_SYS_CT_10168_10170
2012-12-29 22:30:08,666 ERROR [scheduler_Worker-6]  o.h.e.j.batch.internal.BatchingBatch HHH000315: Exception executing batch [integrity constraint violation: unique constraint or index violation: SYS_IDX_SYS_CT_10168_10170]
2012-12-29 22:30:08,678 ERROR [scheduler_Worker-6]  c.a.c.d.DbCachingDirectoryPoller Error occurred while refreshing the cache for directory [ <Directory ID> ].
org.springframework.dao.DataIntegrityViolationException: integrity constraint violation: unique constraint or index violation: SYS_IDX_SYS_CT_10168_10170; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: integrity constraint violation: unique constraint or index violation: SYS_IDX_SYS_CT_10168_10170


This issue can also be seen under Bitbucket UI → Administration (Gear Icon) → Troubleshooting and support tools -> Log Analyzer with the error message "Duplicate key value errors in logs in Bitbucket Server using PostgreSQL". With this message, in Bitbucket Server Logs - the above errors can be seen.

原因

The Bitbucket Server user directory cache could not be refreshed after having changed the user and group configuration within it.

ソリューション

There are two possible resolutions:

  1. Restart Bitbucket Server as it will flush out the directory cache in Bitbucket Server.
  2. Recreate the LDAP Directory configuration. To do the same:
    a. Copy the content of existing User or LDAP directory configuration in Bitbucket.
    b. Disable existing user directory in Bitbucket.
    c. Create a new user directory (with a new name than existing disabled directory) by clicking on Add Directory option. Fill all the details which we copied and kept with us.
    d. Click 'Test'. If the test is successful, please click 'Test and save'
    e. If everything works fine and the users are synchronised, delete the older user directories to keep a clean configuration. These steps should recreate the Crowd cache and recreate the records that currently cause a unique constraint violation.
  3. If issue still remains (for specific users based on errors in logs), it is advisable to check with Active Directory Admin Team if duplicate entries are present in Active Directory.
最終更新日 2023 年 9 月 29 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.