排查 Data Portability API 问题
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页面面向应用开发者介绍了如何解决 Data Portability API 的问题。
此范围不允许使用增量身份验证
如果您使用 include_granted_scopes=true
为 Data Portability API 范围请求 OAuth 流程,并且最终用户已向项目授予某些范围,或者用户已授予部分请求的范围,则会出现以下问题。
Incremental auth is not allowed for the requested scopes.
If you are a developer of APP_NAME, see error details.
Error 400: invalid_request
如需解决此问题,请从请求中移除 include_granted_scopes
或将其设为 false,并仅请求用户未授予的范围。如需了解详情,请参阅之前授予的范围。
无续订选项
当最终用户向发布状态为测试的项目授予访问权限时,会出现以下问题。只有发布状态为正式版的项目才能续订。最终用户在“我的账号”>“关联”页面上不会看到续订选项。
如需解决此问题,请将项目的发布状态更改为正式版。如需了解详情,请参阅设置 OAuth 工作流。
请求的资源未获授权
如果您向 Data Portability API 发出请求,以便为未在所附 OAuth 访问令牌中授予范围的资源组启动作业,则会出现以下问题。
HttpError 403 when requesting https://dataportability.googleapis.com/v1/portabilityArchive:initiate?alt=json returned "The requested resources are not authorized by the OAuth token.". Details: "[{'@type': 'type.googleapis.com/google.rpc.DebugInfo', 'detail': '[ORIGINAL ERROR] generic::permission_denied: com.google.dataliberation.portability.boq.thirdparty.utils.PortabilityApiException: The requested resources are not authorized by the OAuth token. Code: PERMISSION_DENIED [google.rpc.error_details_ext] { message: "The requested resources are not authorized by the OAuth token." }'}]"
如需解决此问题,请跟踪哪些 OAuth 令牌授予了哪些镜重。如果同一用户通过多个流程授予了不同的范围,您可能需要为其存储多个不同的令牌。另请注意,用户可能只授予了 OAuth 流程中请求的部分范围。如需查看示例,请参阅 Python 快速入门。
请求多个作用域时,https://takeout.google.com/dpinfo 出现 400 错误
如果网址长度因请求中的范围数量而超出支持范围,https://takeout.google.com/dpinfo 会抛出 400 错误。如需解决此问题,请将您对镜的请求拆分为多个较小的批次。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Troubleshoot issues with Data Portability API\n\nThis page shows you app developers how to resolve issues with the\nData Portability API.\n\nIncremental auth isn't allowed for this scope\n---------------------------------------------\n\nThe following issue occurs when you request an OAuth flow for Data Portability API\nscopes with `include_granted_scopes=true` and the end user has already granted\nsome scopes to the project, or the user has already granted some of the\nrequested scopes. \n\n```\nIncremental auth is not allowed for the requested scopes.\nIf you are a developer of APP_NAME, see error details.\nError 400: invalid_request\n```\n\nTo resolve this issue remove `include_granted_scopes` from your request or set\nit to false and only request scopes that the user hasn't granted. For details,\nsee [Previously granted scopes](/data-portability/user-guide/configure-oauth#previously_granted_scopes).\n\nNo renewal option\n-----------------\n\nThe following issue occurs when an end user grants access to a project with a\n**Testing** publishing status. Renewal is only available to projects with a\n**Production** publishing status. The end user won't see a renewal option on\ntheir myaccount connections page.\n\nTo resolve this issue change the project's publishing status to **Production** .\nFor details, see [Set up an OAuth workflow](/data-portability/user-guide/configure-oauth#set_up_an_oauth_workflow).\n\nThe requested resources are not authorized\n------------------------------------------\n\nThe following issue occurs when the you make a request to the Data Portability API\nto initiate a job for resource groups whose scopes are not granted in the\nattached OAuth access token. \n\n HttpError 403 when requesting https://dataportability.googleapis.com/v1/portabilityArchive:initiate?alt=json returned \"The requested resources are not authorized by the OAuth token.\". Details: \"[{'@type': 'type.googleapis.com/google.rpc.DebugInfo', 'detail': '[ORIGINAL ERROR] generic::permission_denied: com.google.dataliberation.portability.boq.thirdparty.utils.PortabilityApiException: The requested resources are not authorized by the OAuth token. Code: PERMISSION_DENIED [google.rpc.error_details_ext] { message: \"The requested resources are not authorized by the OAuth token.\" }'}]\"\n\nTo resolve this issue, keep track of which scopes are granted by which OAuth\ntokens. You may need to store multiple different tokens for the same user if\nthey granted different scopes through multiple flows. Also note that a user\nmight have granted only a subset of the scopes requested in an OAuth flow. For\nexamples, see the [Python quickstart](/data-portability/user-guide/python-quickstart).\n\n400 error at https://takeout.google.com/dpinfo when requesting many scopes\n--------------------------------------------------------------------------\n\nhttps://takeout.google.com/dpinfo throws a 400 error when the URL length grows\nbeyond what is supported due to the number of scopes in your request. To\nresolve, split your requests for scopes into multiple smaller batches."]]