Hello,
I recently tried to detach an environment from an Apigee instance using Terraform, and encountered the following error:
Error when reading or editing InstanceAttachment: googleapi: Error 400: the resource is locked by another operation where instance [RUNTIME_NAME] is currently under maintenance by operation: [OPERATION_UUID_1]
Upon checking the long-running operations in Apigee, I found two operations in progress:
$ gcloud alpha apigee operations list --organization="[ORG_NAME]" --filter="STATE=IN_PROGRESS"
UUID: [OPERATION_UUID_1]
ORGANIZATION: [ORG_NAME]
STATE: IN_PROGRESS
UUID: [OPERATION_UUID_2]
ORGANIZATION: [ORG_NAME]
STATE: IN_PROGRESS
$ gcloud alpha apigee operations describe --organization="[ORG_NAME]" [OPERATION_UUID_1]
metadata:
'@type': type.googleapis.com/google.cloud.apigee.v1.OperationMetadata
operationType: INSERT
progress:
description: Evaluating Deployment with Canary Analysis
percentDone: 10
state: IN_PROGRESS
targetResourceName: organizations/[ORG_NAME]/instances/[RUNTIME_NAME]/canaryevaluations/[OPERATION_TARGETED_RESOURCE_UUID_1]
name: organizations/[ORG_NAME]/operations/[OPERATION_UUID_1]
organization: [ORG_NAME]
uuid: [OPERATION_UUID_1]
$ gcloud alpha apigee operations describe --organization="[ORG_NAME]" [OPERATION_UUID_2]
metadata:
'@type': type.googleapis.com/google.cloud.apigee.v1.OperationMetadata
operationType: INSERT
progress:
description: Evaluating Deployment with Canary Analysis
percentDone: 10
state: IN_PROGRESS
targetResourceName: organizations/[ORG_NAME]/instances/[RUNTIME_NAME]/canaryevaluations/[OPERATION_TARGETED_RESOURCE_UUID_2]
name: organizations/[ORG_NAME]/operations/[OPERATION_UUID_2]
organization: [ORG_NAME]
uuid: [OPERATION_UUID_2]
After some research, I found the following document which seems somewhat related:
GoogleCloudApigeeV1CanaryEvaluation: CanaryEvaluation represents the canary analysis between two versions of the runtime that is serving requests.
https://pkg.go.dev/google.golang.org/api/apigee/v1
So, I would like to ask two questions:
- Does Canary Evaluation occur randomly on a timeline different from user requests? Is it possible to control this, similar to Cloud SQL maintenance windows?
- On average, how long does a Canary Evaluation take to complete?