创建项目时提示“此用户不是项目所有者”

  • Choerodon平台版本:0.18

  • 运行环境:自主搭建

  • 问题描述:

    创建了一个已启用状态的项目,并分配了项目所有者的权限,但创建应用时报“此用户不是项目所有者”错误,试了用admin用户创建,也报这个错误

  • 执行的操作:
    创建了一个新用户并给用户分配了项目所有者权限,使用该用户创建应用

看下平台层的事务实例,分配角色的saga实例 member-role相关的是否失败?


事务实例正常完成的,没有失败

另外,我看c7n-mysql数据库中 gitlab_service实例下没有表,是否正常?

点下input看下数据是不是空的

image

数据有值的

image

我看resourceType类型为组织,lables里面也是项目成员的lable,该saga实例是分配项目所有者那条吗?

如果是空的,请参考该issue

https://openforum.hand-china.com/t/topic/2382/24

我也碰到这个问题 iam-service升级到0.18.4 前端升级到0.18.5就解决了

事务实例中,member-role 相关的有三条,是关于两个用户的,第一条 roleLabels是空的,后面两条都是有值的,跟刚才截图一样

我升级下iam-service试试

记得choerodon-front前端也要升级到0.18.5

iam-service 升级到 0.18.4
choerodon-front 升级到0.18.5
然后创建新用户,并分配项目角色为项目所有者,事务实例执行失败

io.choerodon.core.exception.CommonException: io.choerodon.core.exception.CommonException: The user you want to assign a role to is not created successfully!
at io.choerodon.devops.app.service.impl.GitlabGroupMemberServiceImpl.lambda$createGitlabGroupMemberRole$1(GitlabGroupMemberServiceImpl.java:80)
at io.choerodon.devops.app.service.impl.GitlabGroupMemberServiceImpl$$Lambda$938.00000000C401D7F0.accept(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:496)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:486)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:241)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at io.choerodon.devops.app.service.impl.GitlabGroupMemberServiceImpl.createGitlabGroupMemberRole(GitlabGroupMemberServiceImpl.java:63)
at io.choerodon.devops.api.eventhandler.SagaHandler.handleGitlabGroupMemberEvent(SagaHandler.java:251)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.choerodon.asgard.saga.consumer.SagaConsumer.invoke(SagaConsumer.java:84)
at io.choerodon.asgard.saga.consumer.SagaConsumer.lambda$null$0(SagaConsumer.java:56)
at io.choerodon.asgard.saga.consumer.SagaConsumer$$Lambda$933.00000000380321D0.get(Unknown Source)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:813)
Caused by: io.choerodon.core.exception.CommonException: The user you want to assign a role to is not created successfully!
at io.choerodon.devops.app.service.impl.GitlabGroupMemberServiceImpl.operation(GitlabGroupMemberServiceImpl.java:188)
at io.choerodon.devops.app.service.impl.GitlabGroupMemberServiceImpl.lambda$createGitlabGroupMemberRole$1(GitlabGroupMemberServiceImpl.java:71)
… 23 more