了解如何解决 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" }
}
}
文档 span 超出范围
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" }
}
}
文档 span 无效
当提供的文档 span 无效(例如开始位置在结束位置之后)时。
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"
}
}
文档提示大小超出限制
当文档提示符号数量大于上限时。
message: "Document prompt must be at most ${MAX_DOCUMENT_PROMPT_LENGTH} characters."
文档提示不适用于处理器类型
架构中的文档提示不为空,但该架构被分配给不符合条件的处理器类型。
message: "Document prompt is not supported for processor type: ${PROCESSOR_TYPE}"
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."
SchemaGenerationError
表示在生成架构期间发生了故障。
message: "Schema generation failed."
内部错误
发生内部服务器端错误。重试连接。
message: "Internal error encountered."