Unable to import XML backup with the error message "Couldn't replicate the entire batch using the BatchProcessor"
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
問題
Importing a manual or automated XML backup to another Crowd instance failed with the error message: "Couldn't replicate the entire batch using the BatchProcessor"
The following appears in the atlassian-crowd.log
2015-06-03 18:06:09,370 http-bio-8095-exec-11 ERROR [atlassian.crowd.migration.MembershipMapper] Couldn't add com .atlassian.crowd.model.user.InternalUser@731b3bc9 [id=13306451,name=U_060MX, with reatedDate=Wed Jun 03 18:05:56 YEKT 2015, updatedDate=Wed Jun 03 18:05:56 YEKT 2015, active=true, emailAddress = <null>, firstName = <null>, lastName = <null>, displayName = <null>, credential=com.atlassian.crowd.embedded.api.PasswordCredential@aa29210 [credential=X, encryptedCredential=true], lowerName=u_060mx, lowerEmailAddress = <null>, lowerFirstName = <null>, lowerLastName = <null>, lowerDisplayName = <null>, directoryId=10682370, externalId = <null>]
2015-06-03 18:06:09,370 http-bio-8095-exec-11 ERROR [console.action.setup.Import] of Error importing XML data org.hibernate.HibernateException: Couldn't replicate the entire batch using the BatchProcessor.
at com.atlassian.crowd.migration.GenericMapper.addEntities (GenericMapper.java:155)
at com.atlassian.crowd.migration.MembershipMapper.importXml (MembershipMapper.java:173)
at com.atlassian.crowd.migration.XmlMigrator.importXml (XmlMigrator.java:50)
at com.atlassian.crowd.migration.XmlMigrationManagerImpl.importXml (XmlMigrationManagerI
mpl.java:200)
診断
Diagnostic Steps
- Check if there are invalid memberships in your database,
Run the following SQL query, to see if you are affected:
SELECT * FROM cwd_membership WHERE child_id NOT IN (SELECT DISTINCT(ID) FROM cwd_user) AND MEMBERSHIP_TYPE = 'GROUP_USER';
If the SQL query returns with some value, proceed with the workaround
原因
Invalid memberships are caused by a bug in Crowd which does not remove user membership for a deleted user: - CWD-3138Getting issue details... STATUS
回避策
Run the following SQL query in the database in order to remove all invalid, dangling memberships, for users that no longer exists:
DELETE FROM cwd_membership WHERE child_id NOT IN (SELECT DISTINCT(ID) FROM cwd_user) AND MEMBERSHIP_TYPE = 'GROUP_USER';
データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。