WSO2 IS 迁移错误显示“系统中已存在管理员。请选择其他角色名称。”

huangapple go评论65阅读模式
英文:

WSO2 IS Migration error showing "admin exists in the system. Please pick another role name."

问题

我正在使用JDBC用户存储作为我的主用户存储(MySQL),当我尝试从WSO2 IS 5.10.0迁移到6.0.0时,使用迁移客户端,我可以在wso2carbon.log文件中看到以下错误。

[2023-05-27 12:58:27,773] [] ERROR {org.wso2.carbon.is.migration.MigrationClientImpl} - 迁移过程已停止。org.wso2.carbon.identity.core.migrate.MigrationClientException:WSO2产品迁移服务任务:迁移外部角色权限时出错。
	at org.wso2.carbon.is.migration.service.v5110.migrator.GroupsAndRolesMigrator.migrate(GroupsAndRolesMigrator.java:146)
	at org.wso2.carbon.is.migration.VersionMigration.migrate(VersionMigration.java:52)
	at org.wso2.carbon.is.migration.MigrationClientImpl.execute(MigrationClientImpl.java:85)
	at org.wso2.carbon.identity.core.internal.IdentityCoreServiceComponent.activate(IdentityCoreServiceComponent.java:151)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	...
Caused by: org.wso2.carbon.user.core.UserStoreException: 30012 - RoleExistingRole名称:admin在系统中已存在。请选择另一个角色名称。
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.handleRoleAlreadyExistException(AbstractUserStoreManager.java:7956)
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.doAddInternalRole(AbstractUserStoreManager.java:7923)
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addRole(AbstractUserStoreManager.java:6954)
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addRole(AbstractUserStoreManager.java:9489)
	at org.wso2.carbon.is.migration.service.v5110.migrator.GroupsAndRolesMigrator.migrateSuperTenantData(GroupsAndRolesMigrator.java:168)
	at org.wso2.carbon.is.migration.service.v5110.migrator.GroupsAndRolesMigrator.migrate(GroupsAndRolesMigrator.java:136)
	... 30 more

如何解决此问题并继续进行迁移?

英文:

I am using a JDBC user store for my primary user store(MySQL) and, when I tried to migrate from WSO2 IS 5.10.0 to 6.0.0 using the migration client, I can see the following error in the wso2carbon.log file.

[2023-05-27 12:58:27,773] [] ERROR {org.wso2.carbon.is.migration.MigrationClientImpl} - Migration process was stopped. org.wso2.carbon.identity.core.migrate.MigrationClientException:  WSO2 Product Migration Service Task : Error while migrating external role permissions.
	at org.wso2.carbon.is.migration.service.v5110.migrator.GroupsAndRolesMigrator.migrate(GroupsAndRolesMigrator.java:146)
	at org.wso2.carbon.is.migration.VersionMigration.migrate(VersionMigration.java:52)
	at org.wso2.carbon.is.migration.MigrationClientImpl.execute(MigrationClientImpl.java:85)
	at org.wso2.carbon.identity.core.internal.IdentityCoreServiceComponent.activate(IdentityCoreServiceComponent.java:151)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
	at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
	at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
	at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
	at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:113)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:985)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:866)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:804)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:228)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:525)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:544)
	at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:529)
	at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(CarbonServerManager.java:305)
	at org.wso2.carbon.core.init.PreAxis2ConfigItemListener.bundleChanged(PreAxis2ConfigItemListener.java:118)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:973)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
Caused by: org.wso2.carbon.user.core.UserStoreException: 30012 - RoleExistingRole name: admin exists in the system. Please pick another role name.
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.handleRoleAlreadyExistException(AbstractUserStoreManager.java:7956)
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.doAddInternalRole(AbstractUserStoreManager.java:7923)
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addRole(AbstractUserStoreManager.java:6954)
	at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addRole(AbstractUserStoreManager.java:9489)
	at org.wso2.carbon.is.migration.service.v5110.migrator.GroupsAndRolesMigrator.migrateSuperTenantData(GroupsAndRolesMigrator.java:168)
	at org.wso2.carbon.is.migration.service.v5110.migrator.GroupsAndRolesMigrator.migrate(GroupsAndRolesMigrator.java:136)
	... 30 more

How can I resolve this and proceed with the migration?

答案1

得分: 0

  • 首先,对5.10.0数据库进行数据库备份。

  • 然后连接到该数据库备份并将“admin”角色更改为“admin-test”。您可以使用以下查询来更新admin角色。

    SELECT * FROM UM_HYBRID_ROLE WHERE UM_ROLE_NAME='admin'

  • 如果从上述选择查询中观察到记录,请使用以下更新SQL查询来更新记录。

    UPDATE UM_HYBRID_ROLE SET UM_ROLE_NAME = 'admin-test' where UM_ROLE_NAME = 'admin'

  • 之后,请确保您已将以下配置添加到“deployment.toml”文件中。

    [super_admin]
    username = "<username>"
    password = "<password>"
    create_admin_account = false
    admin_role = "Domain Users"
    
    [authorization_manager.properties]
    GroupAndRoleSeparationEnabled = false
    
  • 最后,再次进行数据迁移,您将注意到上述错误已消失。

英文:
  • First, take a DB dump of the 5.10.0 database.

  • Then connect to that DB dump(database) and change the admin role to admin-test. You can use the below query to update the admin role.

    SELECT * FROM UM_HYBRID_ROLE WHERE UM_ROLE_NAME=&#39;admin&#39;

  • If a record is observed from the above select query update the record using the following update SQL query.

    UPDATE UM_HYBRID_ROLE SET UM_ROLE_NAME = &#39;admin-test&#39; where UM_ROLE_NAME = &#39;admin&#39;

  • After that, make sure that you have added the following configuration to the deployment.toml file.

    [super_admin]
    username = &quot;&lt;username&gt;&quot;
    password = &quot;&lt;password&gt;&quot;
    create_admin_account = false
    admin_role = &quot;Domain Users&quot;
    
    [authorization_manager.properties]
    GroupAndRoleSeparationEnabled = false
    
  • Finally, do the data migration again and you will notice that the above error is gone.

huangapple
  • 本文由 发表于 2023年5月29日 14:34:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76355134.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定