Apigee 预配错误目录

此错误目录旨在帮助您排查和解决在预配 Apigee 资源时可能会遇到的常见错误。它提供了有关在预配期间可能在界面中或命令行返回的错误的详细信息。

目录包含以下信息:

  • 错误代码
  • 错误消息
  • 错误的可能原因
  • 解决错误的步骤

预配期间返回的错误

无论您是通过 Cloud 控制台中的 Apigee 界面还是命令行界面 (CLI) 预配 Apigee 资源,预配期间都会进行 API 调用。在预配期间进行的 API 调用或检查预配状态可能会在各种情况下返回错误,包括:

  • 项目未启用 Google Cloud 结算
  • 项目未启用所需的 API
  • 区域、对等互连范围或其他网络配置问题

通常,错误消息包含可用于更正任何问题、解决错误和恢复预配的信息。

错误格式

如果错误是此目录中列出的常见错误,则 Cloud 控制台的 Apigee 界面中将显示错误消息。例如:

  {
    "error": {
      "code": "FAILED_PRECONDITION",
      "message": "Error finding one or more network address ranges to use for the Instance. Verify
       the network configuration provided for the Instance and try again."
      }
  }

使用提供的消息来搜索此参考,以详细了解错误的可能原因以及可用于解决问题的步骤。

常见错误

位置没有足够的可用资源

错误消息

location "[loc]" does not have enough resources available to fulfill the request. Try again later
or choose a different location

可能的原因

如果发出请求以在有一个或多个资源不可用的可用区或区域中预配 Apigee 实例,则可能会发生此错误。此错误不是由实例配置问题导致的。

解决步骤

如需解决该错误,您可以选择在其他区域中预配实例,也可以等待问题解决(通常在几个小时内)。

服务网络验证失败

错误消息

您会看到一条初始网络验证错误消息,后面可能跟着以下一条或多条详细错误消息:

generic::failed_precondition: validation failed for service networking for network "[network]",
COMPUTE_API_NOT_ENABLED

generic::failed_precondition: validation failed for service networking for network "[network]",
RANGES_DELETED_LATER

generic::internal: error validating service networking consumer config for network "[network]":
This API method requires billing to be enabled. Please enable billing on project [project] by visiting
... then retry.

可能的原因

如果网络配置的预配置验证失败,可能会发生此错误。

解决步骤

下表列出了可以解决这些错误消息的操作:

message 解决步骤
COMPUTE_API_NOT_ENABLED 启用 Compute Engine API
RANGES_DELETED_LATER 确认提供的 IP 范围有效。
需要启用结算功能... 确认项目已启用结算功能

找不到可用的 /22 IP 地址空间

错误消息

couldn't find a free IP space of /22 to launch an instance. Verify the peering ranges are available
as per https://cloud.google.com/apigee/docs/api-platform/get-started/install-cli#service-networking
and try again

可能的原因

在创建子网时,如果在提供的范围内 /22 IP 地址空间不可用,可能会发生此错误。

解决步骤

如需解决此错误,请确认提供的 IP 对等互连范围满足在服务网络中创建子网的要求。然后重试操作。

分配 IP 时出错

错误消息

您可能会看到以下某条错误消息:

Error in allocating IPs to use for the Instance. Please verify the network configuration provided
for the Instance and try again.

Error in allocating IPs for ServiceAttachment.

Error finding one or more network address ranges to use for the Instance. Verify the network
configuration provided for the Instance and try again.

您可能还会收到来自网络客户端的详细错误消息。例如:

Invalid resource usage: 'The resource 'projects/xxx' is already linked to another shared VPC host 
'projects/yyy'.

可能的原因

在 Apigee 实例创建期间,当执行服务网络操作(例如创建子网或搜索网络范围)时可能会发生此错误。在某些情况下,服务网络可能会返回错误消息。

解决步骤

请按照服务网络返回的详细消息中的说明解决错误。您可能需要:

没有 KMS 密钥权限

错误消息

apigee service agent <email> cannot encrypt/decrypt with kms key <keyID>: PermissionDenied

可能的原因

在预配 Apigee 实例之前,系统会验证提供的 KMS 密钥。此错误表示 Apigee Service Agent 不具有所提供的密钥需要的 Cloud KMS CryptoKey Encrypter/Decrypter 角色的正确权限。

解决步骤

向 Apigee Service Agent 授予对提供的 KMS 密钥的访问权限。您可以在通过命令行预配付费组织的第 1(f) 步中找到授予访问权限的命令。

请求被组织的政策禁止

错误消息

The request is prohibited by organization's policy. Please refer to
https://cloud.google.com/vpc-service-controls/docs/troubleshooter
to review the org policy for VPC Service Control. vpcServiceControlsUniqueIdentifier:
<vpc-sc unique identifier>.

可能的原因

预配 Apigee 实例时可能会发生此错误。实例创建请求被 Google Cloud 组织的某一条 VPC Service Control 政策阻止。

解决步骤

如需解决此错误,请按照轻松交流、调试和解决 VPC Service Controls 问题中的步骤操作。这些步骤使用 vpcServiceControlsUniqueIdentifier 修复 VPC-SC 配置。

已达到对等互连数上限

错误消息

The maximum number of peerings for the network (7) has been reached. Please delete unused peerings
for the network and try again

可能的原因

预配 Apigee 实例时可能会发生此错误。在此例中,没有可用的网络对等互连。

解决步骤

如需解决该错误,请删除网络的任何未使用的对等互连,或为实例使用其他 VPC 网络。

已超过允许的路由器数量上限

错误消息

exceeded maximum allowed routers in same network and region. Please use a different network + same
region OR same network + different region

可能的原因

在预配期间,创建 Cloud NAT(网络地址转换)时可能会发生此错误。在此例中,选择的网络和区域无效。

解决步骤

如需解决该错误,您可以选择同一区域中的不同网络,也可以使用其他区域中的同一网络。

资源无效

错误消息

the resource 'projects/.../regions/.../serviceAttachments/...' was invalid. Must be either a valid
In-Project Forwarding Rule Target URL, a valid Service Attachment URL, or a supported Google API
bundle (global-only)

可能的原因

如果提供的服务连接网址无效,则可能会发生此错误。

解决步骤

如需解决此问题,请将实例配置中的服务连接网址更新为有效网址。

未找到资源

错误消息

the resource 'projects/.../regions/.../serviceAttachments/...' was not found

可能的原因

如果未找到提供的服务连接网址,则可能会发生此错误。

解决步骤

如需解决此错误,请将实例配置中的服务连接网址更新为有效的网址。

网络范围已删除,但仍被分配

错误消息

a network range was deleted but still assigned in network <network>. Please refer to this guide
to fix: https://cloud.google.com/sdk/gcloud/reference/services/vpc-peerings/update. Valid ranges can
be found at VPC networks -> Private service connection -> Allocated IP ranges for services

可能的原因

如果为 Apigee 实例分配的网络范围被删除、部分删除或不存在,则可能会发生此错误。

解决步骤

如需解决此错误,请运行以下命令以更新分配范围的 VPC 对等互连

gcloud services vpc-peerings update \
  --service=servicenetworking.googleapis.com \
  --ranges=$VALID_RANGES \
  --network=$NETWORK \
  --project=$PROJECT \
  --force

IP 地址范围重叠

错误消息

An IP range in the peer network (10.128.0.0/28) overlaps with an IP range (10.128.0.0/20) in an
active peer (peering-to-consumer) of the local network. Please use a different ipRange.
If you've recently deleted an ApigeeInstance and wanted to use the same ipRange, please wait
for some time and try again

可能的原因

预配 Apigee 实例时可能会发生此错误。在此例中,Apigee 实例创建操作失败,因为分配的 IP 地址范围无效,或者在删除之前创建的 Apigee 实例后分配的范围未完全释放。

解决步骤

如需解决该错误,请使用其他 IP 范围,或稍后使用完全释放的 IP 地址范围重试。

无法连接到专用 Google API 范围

错误消息

couldn't connect to the private Google APIs ranges. This is likely a DNS mis-configuration if you've
set up peered-dns-domains. Please check
https://cloud.google.com/vpc/docs/configure-private-google-access#config-domain

可能的原因

预配 Apigee 实例时可能会发生此错误。在这种情况下,Apigee 实例无法连接到专用 Google API 范围。

解决步骤

如需解决此问题,请确认专用 Google API 范围的 DNS 配置正确无误,并且可从 VPC 网络内访问该专用 Google API 范围。

已触发项目删除操作

错误消息

deletion had been triggered for project <project>

可能的原因

如果用于创建实例的项目的删除过程已开始,则可能会发生此错误。此验证检查会在预配操作的每个步骤之间执行。

解决步骤

如果项目是意外删除的,您可以使用以下命令恢复项目:

gcloud projects undelete PROJECT_ID

如需了解详情,请参阅恢复项目

KMS 密钥的参数无效

错误消息

apigee service agent <p4sa email> cannot encrypt/decrypt with kms key <kms key>: Invalid Argument

可能的原因

在预配期间,验证提供的 KMS 密钥时可能会发生此错误。在此例中,Cloud KMS 密钥字段中的一个或多个值无效。

解决步骤

如需解决此错误,请确认 Cloud KMS 密钥的正确值,并更新实例配置中的字段。

未启用 Google Cloud KMS API

错误消息

Google Cloud KMS API has not been used in project <project> before or it is disabled. Enable it by
visiting https://console.developers.google.com/apis/api/cloudkms.googleapis.com/overview?project=<project> then retry.
If you enabled this API recently, wait a few minutes for the action to propagate to our systems
and retry.

可能的原因

如果用于 Apigee 预配的项目未启用 Cloud KMS API,则可能会发生此错误。

解决步骤

如需解决此错误,请启用 Cloud KMS API

未启用 Apigee API

错误消息

Apigee API has not been used in project <project> before or it is disabled. Enable it by visiting
https://console.developers.google.com/apis/api/apigee.googleapis.com/overview?project=<project> then retry.
If you enabled this API recently, wait a few minutes for the action to propagate to our systems
and retry.

可能的原因

如果用于 Apigee 预配的项目未启用 Apigee API,则可能会发生此错误。

解决步骤

如需解决此错误,请启用 Apigee API

未启用 Google Cloud 结算功能

错误消息

This API method requires billing to be enabled. Please enable billing on project <project number>
by visiting https://console.developers.google.com/billing/enable?project=<project number> then
retry. If you enabled billing for this project recently, wait a few minutes for the action to
propagate to our systems and retry.

可能的原因

如果用于 Apigee 预配的 Google Cloud 项目未启用结算功能,则可能会发生此错误。

解决步骤

如需解决此错误,请为您的 Google Cloud 项目启用结算功能

再次创建服务网络连接

错误消息

please create Service Networking connection with service 'servicenetworking.googleapis.com' from
consumer project <project number> network <network> again

可能的原因

如果在检索服务网络宿主项目编号时,Google Cloud 项目中的服务网络连接失败,则可能会发生此错误。

解决步骤

如需解决此问题,请按照第 2 步:设置网络中的说明创建服务网络连接。

没有 IAM 权限

错误消息

IAM permission denied for service account  
service-<project number>@gcp-sa-apigee.iam.gserviceaccount.com. Ensure that Apigee service
account has Apigee service agent role to your consumer project.

可能的原因

如果尝试与 Google Cloud 使用方项目交互的 Apigee 服务账号的 IAM 权限不正确,则可能会发生此错误。

解决步骤

如需解决此问题,请向发起此操作的服务账号授予 Apigee service agent 角色。您可以在 Google Cloud 控制台中的 IAM 页面上授予权限。