错误消息
了解如何解决 Document AI 引发的一些错误。本主题讨论解决方法需要多个步骤且无法在错误消息中说明的错误。
如需了解有关错误处理的最佳实践,请参阅 Cloud API 文档。
权限
解决此问题需要执行一些步骤,如错误消息中所述。
应用默认凭据不可用
如果收到此消息:
The Application Default Credentials are not available. They are available if running in Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
Document AI 使用应用默认凭据进行身份验证。
您必须拥有项目的服务账号,并将服务账号的密钥(JSON 文件)下载到开发环境,然后将该 JSON 文件的位置设置成名为 GOOGLE_APPLICATION_CREDENTIALS
的环境变量。
此外,GOOGLE_APPLICATION_CREDENTIALS
环境变量必须在您调用 Document AI API 的上下文中可用。例如,如果您在终端会话中设置变量但在 IDE 的调试程序中运行代码,则代码的执行上下文可能无法访问该变量。在这种情况下,对 Document AI 发出的请求可能因未经过适当的身份验证而失败。
如需详细了解如何设置 GOOGLE_APPLICATION_CREDENTIALS
环境变量,请参阅 Document AI 快速入门或有关使用应用默认凭据的文档。
权限遭拒
如果收到此消息:
ERROR: (gcloud.auth.application-default.print-access-token) File (pointed by GOOGLE_APPLICATION_CREDENTIALS environment variable) does not exist! { "error": { "code": 403, "message": "The request is missing a valid API key.", "status": "PERMISSION_DENIED" } }
确认 GOOGLE_APPLICATION_CREDENTIALS
环境变量中存储的位置中包含有效的服务账号密钥 JSON 文件,并且该变量指向正确的位置。
如需诊断此错误,请尝试从您尝试调用 Document AI API 的文件夹中打开服务账号密钥文件。
cat $GOOGLE_APPLICATION_CREDENTIALS
Forbidden: 403 POST API has not been used or is disabled
如果您收到此消息,则表示:
Forbidden: 403 POST Document AI API has not been used in project # before or it is disabled. Enable it by visiting [url], then retry. If you enabled this API recently, wait a few minutes for the action to propagate and retry.
- 访问错误消息中指定的链接,并启用 Document AI API。 等待几分钟,然后重试。
- 验证您是否在
GOOGLE_APPLICATION_CREDENTIALS
环境变量中存储了有效的服务账号密钥 JSON 文件。如需诊断此错误,请尝试从您尝试调用 Document AI API 的文件夹中打开服务账号密钥文件。cat $GOOGLE_APPLICATION_CREDENTIALS
写入最终输出时出错
如果您在接收批量处理请求的结果时收到类似以下内容的消息:
{ "name": "projects/project-name/operations/operation-id", "metadata": { "@type": "type.googleapis.com/google.cloud.document.v1beta1.OperationMetadata", "state": "SUCCEEDED", "createTime": "2019-09-19T02:02:15.885267760Z", "updateTime": "2019-09-19T02:02:31.896425001Z" }, "done": true, "error": { "code": 5, "message": "Error writing final output to: gs://bucket-name/filename.json" } }
您的服务账号可能没有在 Cloud Storage 存储桶中创建对象的正确权限。请务必按照快速入门中的说明,为您的服务账号分配正确的权限。
您可能还拼错了 Cloud Storage 存储桶的名称。验证您尝试访问的存储桶是否存在。
P4SA 无权访问 Cloud Storage
当 Document AI 产品专属服务账号 (P4SA) 无权访问某些 Cloud Storage 资源时。
message: "Cloud DocumentAI P4SA doesn't have access to this Cloud Storage resource:"
服务账号无法在 Cloud Storage 中创建对象
当 Document AI 产品专属服务账号 (P4SA) 无权在 Cloud Storage 中创建对象时。
message: "Service account service-123@gcp-sa-prod-dai-core.iam.gserviceaccount.com
does not have permission storage.objects.create to create
Google Cloud Storage object in bucket gs://foo."
Document AI 服务账号可能没有在您的 Cloud Storage 存储桶中创建对象的正确权限。请务必按照跨项目文件访问设置中的说明,为 Document AI 服务账号分配正确的权限。
您可能还拼错了 Cloud Storage 存储桶的名称。验证您尝试访问的存储桶是否存在。
调用方无法获取 Cloud Storage 中的对象
当 Document AI API 的调用者无权获取 Cloud Storage 中的对象时。
message: "The caller does not have permission storage.objects.get to get Google
Cloud Storage objects in bucket gs://foo."
API 的调用者可能没有获取 Cloud Storage 存储桶中对象的正确权限。请确保您已为调用方分配正确的权限。
您可能还拼错了 Cloud Storage 存储桶的名称。验证您尝试访问的存储桶是否存在。
实参无效
解决此问题需要执行一些步骤,如错误消息中所述。
API 版本不受支持
当向不支持相应操作的 API 版本发出请求时。
message: "The requested operation is unsupported for the API version."
处理器类型不受支持
当向不支持给定处理器类型的 API 方法发出请求时。
message: "The requested operation is unsupported for the processor type: ${PROCESSOR_TYPE}."
Bad Request
发出 API 请求,但请求字段存在一项或多项违规情况。
每项违规行为都会在 google.rpc.BadRequest
详细信息中以 field_violations
的形式捕获。
message: "Request contains an invalid argument."
details {
[type.googleapis.com/google.rpc.BadRequest] {
field_violations { field: "foo" description: "bar" }
}
}
批处理所有文档失败
当批处理请求中的每个文档都无法处理时。
message: "Failed to process all documents."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "FAILED_TO_PROCESS_ALL_DOCUMENTS"
domain: "documentai.googleapis.com"
}
}
没有文档
需要或预期提供文档,但未提供任何文档,例如通过 Cloud Storage URI 导入文档时。
message: "No valid documents found in ${training|test} directory. Ensure files are in a supported MIME type. For details, see https://cloud.google.com/document-ai/docs/file-types."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "NO_DOCUMENTS"
domain: "documentai.googleapis.com"
}
}
gcsUriPrefix
和 gcsOutputConfig.gcsUri
参数需要以 gs://
开头,并以反斜杠字符 (/
) 结尾。请检查存储桶 URI 的配置。
示例:gs://bucket/directory/
不支持训练
在不支持训练的处理器类型上发出训练处理器版本请求时。
message: "Training is not supported on processor type: ${DOCUMENT_TYPE}_PROCESSOR."
未选择任何文档
当需要文档,但数据集中未选择任何文档时,例如在创建数据标签作业时。
message: No documents selected. Please select at least one document."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "NO_DOCUMENTS_SELECTED"
domain: "documentai.googleapis.com"
}
}
未找到文档类型
当文档的类别(例如许可、护照或账单)与处理器类型所需的分类不匹配时。例如,W2 解析器中的分类器步骤未从账单中找到元素。
在 Google Cloud 控制台中,此内容也可能会显示为 Couldn't preview the document: Unable to find a document of type: 'foo'
。
此错误消息适用于旧版处理器。
message: "Unable to find a document of type: 'foo'"
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DOCUMENT_OF_TYPE_NOT_FOUND"
domain: "documentai.googleapis.com"
}
}
文档大小超出上限
在导入数据集或运行预测时,如果文档的文件大小超出了上限,则会发生此错误。
message: "Document size (2) exceeds limit: 1 (bytes)."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DOCUMENT_SIZE_LIMIT_EXCEEDED"
domain: "documentai.googleapis.com"
metadata { key: "limit" value: "1" }
metadata { key: "size" value: "2" }
}
}
已超出文档数量上限
当文档数量的上限被超出时。
message: "Document count exceed the limit: 5 got 6"
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DOCUMENT_LIMIT_EXCEEDED"
domain: "documentai.googleapis.com"
metadata { key: "document_limit" value: "5" }
metadata { key: "documents" value: "6" }
}
}
不支持的 MIME 类型
如果提供了不受支持的 MIME 类型,则会引发该错误。当您导入数据集或发出预测调用时,系统会验证文件格式(MIME 类型)。前往支持的文件(以及布局解析器)查看可用的文件类型。如果文件格式不受支持,您会看到以下错误消息:
message: "INVALID_ARGUMENT: Unsupported MIME type: 'foo'."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "UNSUPPORTED_MIME_TYPE"
domain: "documentai.googleapis.com"
metadata { key: "mime_type" value: "foo" }
}
}
没有页面
当提供的文档没有页面,但需要一个或多个页面时。
message: "No pages were found in the document."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "NO_PAGES"
domain: "documentai.googleapis.com"
}
}
负页码
当文档列出的某个页码为负值时。
message: "Page number cannot be negative."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "NEGATIVE_PAGE_NUMBER"
domain: "documentai.googleapis.com"
}
}
重复的页码
当文档中列出了一个或多个相同的页码时。
message: "Duplicate page number detected (page numbers to indices): [{1, [1, 2]}, {4, [4, 5]}]."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DUPLICATE_PAGE_NUMBERS"
domain: "documentai.googleapis.com"
metadata {
key: "page_number_to_indices"
value: "[{1, [1, 2]}, {4, [4, 5]}]"
}
}
}
超出页面数量上限
当文档的总页数超过上限时。当数据集中的某个文档包含的页数过多,超出处理器的限制时,您会在数据集导入或预测期间遇到此错误。
message: "Document pages exceed the limit: 5 got 6"
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PAGE_LIMIT_EXCEEDED"
domain: "documentai.googleapis.com"
metadata { key: "page_limit" value: "5" }
metadata { key: "pages" value: "6" }
}
}
在无图片模式下,已超出网页数量限制
在数据集导入或预测期间,如果数据集中的某个文档包含的页数过多,超出处理器的限制,您就会遇到此错误。您可以请求将项目添加到许可名单,以启用无图片模式,这样可将页面数量上限提高到 30。
message: "Document pages in non-imageless mode exceed the limit: 15 got 16. Try using imageless mode to increase the limit to 30."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PAGE_LIMIT_EXCEEDED_IN_IMAGELESS_MODE"
domain: "documentai.googleapis.com"
metadata { key: "page_limit" value: "15" }
metadata { key: "pages" value: "16" }
metadata { key: "imageless_page_limit" value: "30" }
}
}
预训练处理器版本状态更改
何时发出更改预训练处理器版本状态的请求。 您在尝试删除预训练处理器版本时遇到此错误。
message: "ProcessorVersion with id 'xyz' is pretrained by Google and cannot change states."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PRETRAINED_PROCESSOR_VERSION_STATE_CHANGE"
domain: "documentai.googleapis.com"
metadata { key: "processor_id" value: "abc" }
metadata { key: "target_state" value: "DELETING" }
metadata { key: "version_id" value: "xyz" }
}
}
数据集验证
当数据集未能满足验证条件时,例如由于缺少网页锚点、数据不正确或文档 proto 对象的部分属性中的详细信息不完整。
message: "Invalid dataset. See operation metadata for specific errors."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "INVALID_DATASET"
domain: "documentai.googleapis.com"
}
}
人机协同非内嵌文档以供审核
当针对未内联定义的文档启动人工审核时。
message: "The document for review must be provided inline."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "HUMAN_REVIEW_NON_INLINED_DOCUMENT"
domain: "documentai.googleapis.com"
}
}
证件类型无效
当文档类型无效或不受处理器支持时。文档类型是指文档的类别(例如,W2),而不是其文件格式或 MIME 类型(例如 PDF 或 JPEG)。
message: "Invalid document type: 'foo'."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "INVALID_DOCUMENT_TYPE"
domain: "documentai.googleapis.com"
metadata { key: "type" value: "foo" }
}
}
文档范围超出界限
message: "Text span [1, 5) is out of bounds: [1, 3)."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DOCUMENT_SPAN_OUT_OF_BOUNDS"
domain: "documentai.googleapis.com"
metadata { key: "bounds" value: "[1, 3)" }
metadata { key: "span" value: "[1, 5)" }
metadata { key: "type" value: "Text" }
}
}
文档跨度无效
当提供无效的文档跨度(例如开始时间晚于结束时间)时。
message: "Character span is invalid. Ensure the max is greater than the min."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DOCUMENT_SPAN_INVALID"
domain: "documentai.googleapis.com"
metadata { key: "span" value: "Character" }
}
}
UTF-8 文档无效
当提供包含无效 UTF-8 的文档时。
message: "Document contains invalid UTF-8 text."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DOCUMENT_INVALID_UTF_8"
domain: "documentai.googleapis.com"
metadata { key: "bytes" value: "[2, 3)" }
}
}
数据集架构无效
message: "The processor has an empty or invalid schema: "
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "INVALID_SCHEMA_ERROR"
domain: "documentai.googleapis.com"
}
}
OcrConfig 不受支持
为不支持 OcrConfig 的处理器发出处理请求时。
message: "OcrConfig is not supported for processor type: 'foo'."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "OCR_CONFIG_UNSUPPORTED"
domain: "documentai.googleapis.com"
}
}
导入配置无效
当导入配置无效时。
message: "The import config is invalid: foo"
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "INVALID_IMPORT_CONFIG"
domain: "documentai.googleapis.com"
}
}
源处理器版本无效
尝试导入处理器版本时,源处理器版本不符合导入条件。
message: "The source processor version is invalid in import processor version."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "INVALID_SOURCE_PROCESSOR_VERSION_ERROR"
domain: "documentai.googleapis.com"
}
}
块大小无效
当块大小配置无效时。
message: "Invalid chunk size. Requested chunk size (${CHUNK_SIZE}) must be in the range of [${MIN_CHUNK_SIZE}, ${MAX_CHUNK_SIZE}]."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "INVALID_ARGUMENT"
domain: "documentai.googleapis.com"
}
}
Failed precondition
解决此问题需要执行一些步骤,如错误消息中所述。
KMS 密钥无效
如果提供的密钥无效(例如已停用),则会引发该错误。
message: "KMS key 'projects/1/keys/abc' is invalid (KEY_DISABLED)."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "KMS_KEY_INVALID"
domain: "documentai.googleapis.com"
metadata { key: "details" value: "KEY_DISABLED" }
metadata { key: "kms_key_name" value: "projects/1/keys/abc" }
}
}
处理器状态更改
当发出更改处理器状态的无效请求时。
message: "Processor state cannot be changed to 'DISABLED' since it is 'DISABLED'."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_STATE_CHANGE_INVALID"
domain: "documentai.googleapis.com"
metadata { key: "current_state" value: "DISABLED" }
metadata { key: "processor_id" value: "xyz" }
metadata { key: "target_state" value: "DISABLED" }
}
}
处理器版本状态更改
当发出更改处理器版本状态的无效请求时。
message: "ProcessorVersion state cannot be changed to 'DEPLOYING' since it is 'DEPLOYED'."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_VERSION_STATE_CHANGE_INVALID"
domain: "documentai.googleapis.com"
metadata { key: "current_state" value: "DEPLOYED" }
metadata { key: "processor_id" value: "abc" }
metadata { key: "target_state" value: "DEPLOYING" }
metadata { key: "version_id" value: "xyz" }
}
}
处理器未启用
当发出依赖于特定处理器的请求,但该处理器未启用时。
message: "Processor 'xyz' is not enabled."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_NOT_ENABLED"
domain: "documentai.googleapis.com"
metadata { key: "processor_id" value: "xyz" }
metadata { key: "state" value: "DISABLED" }
}
}
处理器版本未部署
当发出依赖于已部署的特定处理器版本的请求,但该处理器未部署时。
message: "ProcessorVersion 'abc' is not deployed."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_VERSION_NOT_DEPLOYED"
domain: "documentai.googleapis.com"
metadata { key: "processor_id" value: "xyz" }
metadata { key: "state" value: "TRAINING" }
metadata { key: "version_id" value: "abc" }
}
}
处理器的默认版本
当发出依赖于已配置的默认版本的请求,但未配置任何默认版本时。
message: "Processor 'xyz' does not have a default version configured."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_DEFAULT_VERSION_UNSET"
domain: "documentai.googleapis.com"
metadata { key: "processor_id" value: "xyz" }
}
}
处理器移除默认版本
当发出取消部署或删除处理器版本的请求,但该版本被配置为默认版本时。
message: "ProcessorVersion 'xyz' cannot be undeployed or deleted as it is the default version."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_REMOVE_DEFAULT_VERSION"
domain: "documentai.googleapis.com"
metadata { key: "processor_id" value: "abc" }
metadata { key: "version_id" value: "xyz" }
}
}
数据集未初始化
当发出需要初始化数据集的请求,但数据集未初始化时。
message: "Dataset is not initialized."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DATASET_NOT_INITIALIZED"
domain: "documentai.googleapis.com"
}
}
数据集已初始化或正在初始化
当发出需要取消初始化数据集的请求,但数据集已初始化或正在初始化时。
message: "Dataset is already initialized or is initializing."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DATASET_INITIALIZED_OR_INITIALIZING"
domain: "documentai.googleapis.com"
}
}
数据集位置不为空错误
当请求要求数据集存储位置为空,但相应文件夹包含对象时。
message: "Given dataset location is not empty. Please select an empty folder."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DATASET_LOCATION_NOT_EMPTY"
domain: "documentai.googleapis.com"
}
}
存在阻塞性操作错误
当有其他正在运行的操作会阻止所需的操作时。
message: "The operation cannot be performed due to an ongoing 'EXAMPLE_OPERATION_TYPE' blocking operation. Try again after the operation finishes."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "HAS_BLOCKING_OPERATION_ERROR"
domain: "documentai.googleapis.com"
}
}
“不支持的页范围”错误
当某些操作(例如批处理)不支持 page_range
字段时。
message: "Page range is not supported."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PAGE_RANGE_UNSUPPORTED"
domain: "documentai.googleapis.com"
}
}
Cloud Storage 文件夹包含数据集错误
当 Cloud Storage 文件夹已包含数据集时。
message: "The folder 'folder_uri' already has dataset 'dataset-id' under it."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "GCS_FOLDER_CONTAINS_DATASET_ERROR"
domain: "documentai.googleapis.com"
}
}
缩略图缺失错误
未能提取数据集文档缩略图。
message: "Failed to get dataset document thumbnail, consider running re-sync on the dataset."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "THUMBNAIL_MISSING"
domain: "documentai.googleapis.com"
}
}
已超出数据集页面数量上限
当数据集的总页面数超出上限时。
message: "Dataset page count exceeds the limit of 5. Got 6."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DATASET_PAGE_LIMIT_EXCEEDED"
domain: "documentai.googleapis.com"
}
}
不支持同步处理的处理器
当请求的处理器版本不再支持同步处理时。
message: "Processor ${PROCESSOR_ID} version ${VERSION_ID} of type ${TYPE_NAME} is no longer supported for sync processing. Please upgrade to a newer version: https://cloud.google.com/document-ai/docs/manage-processor-versions."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "UNSUPPORTED_PROCESSOR"
domain: "documentai.googleapis.com"
}
}
未找到
解决此问题需要执行一些步骤,如错误消息中所述。
未找到评估
找不到处理器版本的评估结果时。
message: "Evaluation with ID 'qrs' not found."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "EVALUATION_NOT_FOUND"
domain: "documentai.googleapis.com"
metadata { key: "evaluation_id" value: "qrs" }
metadata { key: "processor_id" value: "xyz" }
metadata { key: "version_id" value: "abc" }
}
}
找不到文档
当找不到操作所需的文档时。
message: "Document not found: 'gs://foo'."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "DOCUMENT_NOT_FOUND"
domain: "documentai.googleapis.com"
metadata { key: "document" value: "gs://foo" }
}
}
找不到处理器
找不到操作所需的处理器。
message: "Processor with id 'xyz' not found."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_NOT_FOUND"
domain: "documentai.googleapis.com"
metadata { key: "processor_id" value: "xyz" }
}
}
找不到处理器版本
找不到操作所需的处理器版本。
message: "ProcessorVersion with id 'abc' not found."
details {
[type.googleapis.com/google.rpc.ErrorInfo] {
reason: "PROCESSOR_VERSION_NOT_FOUND"
domain: "documentai.googleapis.com"
metadata { key: "processor_id" value: "xyz" }
metadata { key: "version_id" value: "abc" }
}
}
找不到数据加标签作业
找不到数据标签作业时。
message: "Data labeling job with id 'EXAMPLE_DATA_LABELING_JOB' not found in processor EXAMPLE_PROCESSOR."
未找到架构版本
找不到架构版本时。
message: "Schema version with id 'EXAMPLE_SCHEMA_VERSION' not found."
未找到架构
找不到架构时。
message: "Schema with id 'EXAMPLE_SCHEMA' not found."
已存在
解决此问题需要执行一些步骤,如错误消息中所述。
人机协同标注者已存在
创建已存在的标签添加者池时。
message: "The labeler pool already exists."
架构版本显示名称已存在
创建具有已存在的显示名称的架构版本时。
message: "A schema version with the name 'EXAMPLE_SCHEMA_VERSION' already exists."
架构显示名称已存在
创建具有已存在的显示名称的架构时。
message: "A schema with the name 'EXAMPLE_SCHEMA' already exists."
配额和限制
解决此问题需要执行一些步骤,如错误消息中所述。
已超出配额
如果收到此消息:
RESOURCE_EXHAUSTED: Quota exceeded.
您已达到每分钟或每日配额的上限。查看使用 Document AI 的配额和限制。
您可以通过 Google Cloud 控制台申请增加配额。
中断和延迟时间
解决此问题需要执行一些步骤,如错误消息中所述。
超时
操作未在指定超时时间内完成。
如果您在轮询长时间运行的操作 (LRO) 时收到以下(或类似)错误消息:
google.api_core.future.polling._OperationNotComplete
...
google.api_core.exceptions.RetryError: Deadline of 0.0s exceeded while calling target function, last exception:
...
concurrent.futures._base.TimeoutError: Operation did not complete within the designated timeout.
然后,用户为完成操作设置的超时值对于正在处理的文档而言过低。此错误不表示批处理操作失败,无论用户设置的超时值是多少,该操作都会继续执行。
安全过滤条件错误
由于请求或回答被大语言模型 (LLM) 安全过滤条件屏蔽,因此发生了内部服务器端错误。此错误无法重试。
message: "Safety filter error."
内部错误
发生了内部服务器端错误。重试连接。
message: "Internal error encountered."