Creating pubsub subscription to topic failed with error: User not authorized to perform this action
Creating pubsub subscription to topic failed with error: User not authorized to perform this action
当我尝试使用服务帐户部署数据流作业时,失败并出现以下错误:
Workflow failed. Causes: Step
"setup_resource_XXXXXX.subscription-1210256155950706891639" failed.,
Step setup_resource_XXXXXX.subscription-1210256155950706891639: Set up
of resource XXXXXX.subscription-12102561559507068916 failed, Creating
pubsub subscription
projects/XXXXXX/subscriptions/XXXXXX.subscription-12102561559507068916
to topic projects/XXXXXX/topics/XXXXXX failed with error: User not
authorized to perform this action.
我已授予该主题的服务帐户 "Pub/Sub Subscriber" 权限。
Dataflow 似乎正在尝试在此处创建订阅:
Creating pubsub subscription projects/XXXXXX/subscriptions/XXXXXX.subscription-12102561559507068916
但是,角色 roles/pubsub.subscriber
不足以创建订阅,因为它没有 pubsub.subscriptions.create
权限。
您可能需要为您的服务帐户授予 roles/pubsub.editor
角色(pubsub.subscriptions.create
权限已分配给该角色)。
当我使用 PubSub 到数据流作业的云存储(文本)模板时,我遇到了类似的问题,我不得不给 pub/sub 订阅者 和 pub/sub viewer 角色到我的 pubsub 主题上的数据流控制器服务帐户和 Storage Object Admin 角色到数据流的同一控制器服务帐户的存储桶。
它解决了我的问题。
根据 norbjb(2019 年 6 月 3 日在 12:56)的建议,我发现您的服务帐户需要被授予:
云数据流服务代理
这解决了我的问题。
当我尝试使用服务帐户部署数据流作业时,失败并出现以下错误:
Workflow failed. Causes: Step "setup_resource_XXXXXX.subscription-1210256155950706891639" failed., Step setup_resource_XXXXXX.subscription-1210256155950706891639: Set up of resource XXXXXX.subscription-12102561559507068916 failed, Creating pubsub subscription projects/XXXXXX/subscriptions/XXXXXX.subscription-12102561559507068916 to topic projects/XXXXXX/topics/XXXXXX failed with error: User not authorized to perform this action.
我已授予该主题的服务帐户 "Pub/Sub Subscriber" 权限。
Dataflow 似乎正在尝试在此处创建订阅:
Creating pubsub subscription projects/XXXXXX/subscriptions/XXXXXX.subscription-12102561559507068916
但是,角色 roles/pubsub.subscriber
不足以创建订阅,因为它没有 pubsub.subscriptions.create
权限。
您可能需要为您的服务帐户授予 roles/pubsub.editor
角色(pubsub.subscriptions.create
权限已分配给该角色)。
当我使用 PubSub 到数据流作业的云存储(文本)模板时,我遇到了类似的问题,我不得不给 pub/sub 订阅者 和 pub/sub viewer 角色到我的 pubsub 主题上的数据流控制器服务帐户和 Storage Object Admin 角色到数据流的同一控制器服务帐户的存储桶。 它解决了我的问题。
根据 norbjb(2019 年 6 月 3 日在 12:56)的建议,我发现您的服务帐户需要被授予:
云数据流服务代理
这解决了我的问题。