PermissionDenied:403 资源项目 XXXXXXX 的权限被拒绝

问题描述 投票:0回答:1

我正在尝试使用 Google 的文档 AI 处理文档。但我面临着一些问题。我已创建服务帐户,并授予所有必要的访问权限,但仍然无法处理文档。以下是我的服务帐户拥有的访问权限: 文档人工智能管理员 文档AI API用户 文档人工智能编辑器 存储管理员

以下是我在 jupyter 笔记本上遇到的错误。我正在使用谷歌文档中的代码来处理文档。

`_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.PERMISSION_DENIED
    details = "Permission denied on resource project XXXXXXXX."
    debug_error_string = "UNKNOWN:Error received from peer ipv6:XXXXXXX {created_time:"2023-11-02T01:26:08.259379+05:30", grpc_status:7, grpc_message:"Permission denied on resource project XXXXXXXX."}"
>

The above exception was the direct cause of the following exception:`

`PermissionDenied: 403 Permission denied on resource project XXXXXXXX. [links {
    description: "Google developer console API key"
    url: "https://console.developers.google.com/project/XXXXXXX/apiui/credential"
}, 
reason: "CONSUMER_INVALID"
domain: "googleapis.com"
metadata {
    key: "service"
    value: "documentai.googleapis.com"
}
metadata {
    key: "consumer"
    value: "projects/XXXXXXXX"
}`
google-cloud-platform artificial-intelligence document cloud-document-ai
1个回答
0
投票

您是否下载了服务帐户密钥并在您的环境中使用该密钥?

我建议按照快速入门:设置 Document AI API 中列出的步骤,从环境身份验证步骤开始。

如果您使用Colab,您可以通过运行以下代码根据您的用户帐户进行身份验证:

from google.colab import auth
auth.authenticate_user()
© www.soinside.com 2019 - 2024. All rights reserved.