Skip to content

provider: include error details in failed long-running operation errors - #20009

Open
yifanyang wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
yifanyang:fix/common-op-error-details
Open

yifanyang wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
yifanyang:fix/common-op-error-details

Conversation

@yifanyang

Copy link
Copy Markdown

When a long-running operation fails, the provider prints only the code and message of the returned google.rpc.Status (Error code 3, message: ...). The status details are already decoded into tpgresource.CommonOpError but never printed, so users miss the error reason (google.rpc.ErrorInfo) and troubleshooting links (google.rpc.Help) that APIs following AIP-193 return. For example, Vertex AI Agent Engine is starting to report failed deployments with a reason such as REASONING_ENGINE_BUILD_FAILED, a link to the build logs, and a link to the matching troubleshooting page; Terraform users currently see none of them.

CommonOpError.Error() now appends the details as indented JSON, the same format googleapi.Error already uses for failed synchronous requests. Errors without details print exactly as before. The change applies to every resource whose operation waiter uses CommonOperationWaiter.Error(), including all generated *_operation.go waiters. The first line is unchanged, so retry predicates that match on error text keep matching.

Example (google_vertex_ai_reasoning_engine, values shortened):

Error: Error waiting to create ReasoningEngine: Error waiting for Creating ReasoningEngine: Error code 3, message: The Reasoning Engine could not be deployed because its container image failed to build. ...
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "aiplatform.googleapis.com",
    "metadata": {
      "logs_url": "https://console.cloud.google.com/logs/query..."
    },
    "reason": "REASONING_ENGINE_BUILD_FAILED"
  },
  {
    "@type": "type.googleapis.com/google.rpc.Help",
    "links": [
      {
        "url": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/troubleshooting/agent-deployment#build-failed"
      }
    ]
  }
]

Before this change, the output stopped after the first line.

provider: added API error details, such as the error reason and troubleshooting links, to error messages for failed long-running operations

@github-actions
github-actions Bot requested a review from slevenick November 4, 2026 23:53
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician

modular-magician commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 91bd911:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 84 insertions(+), 1 deletion(-)
google-beta provider View Diff 2 files changed, 84 insertions(+), 1 deletion(-)

Test report

Analytics

Total Tests Passed Skipped Affected
7243 6520 718 5
Affected Service Packages
  • All service packages are affected

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccApigeeSyncAuthorization_update
  • TestAccManagedKafkaCluster_managedkafkaClusterPublicExample
  • TestAccOracleDatabaseDbSystem_oracledatabaseDbSystemFullExample
  • TestAccOracleDatabaseExadbVmCluster_oracledatabaseExadbVmClusterBasicExample
  • TestAccOracleDatabaseExadbVmCluster_oracledatabaseExadbVmClusterFullExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Findings Test Name
✅ Log - TestAccApigeeSyncAuthorization_update
❌ Error · Log ⚪ Nightly fails 100% of 30 TestAccManagedKafkaCluster_managedkafkaClusterPublicExample
❌ Error · Log ⚪ Nightly fails 100% of 30 TestAccOracleDatabaseDbSystem_oracledatabaseDbSystemFullExample
❌ Error · Log ⚪ Nightly fails 73% of 30 TestAccOracleDatabaseExadbVmCluster_oracledatabaseExadbVmClusterBasicExample
❌ Error · Log ⚪ Nightly fails 73% of 30 TestAccOracleDatabaseExadbVmCluster_oracledatabaseExadbVmClusterFullExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

🟡 Known Nightly Failures: 4 of the tests that failed in recording also fail or are flaky in the last 30 days of nightly runs, so they may be unrelated to this PR. In nightly findings, ⚪ means the test already fails in nightly, 🟡 that it is flaky there, and 🔴 that it is healthy in nightly and so more likely broken by this PR.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@yifanyang, @slevenick VCR tests complete for 91bd911!

@yifanyang

yifanyang commented Nov 5, 2026 •

Copy link
Copy Markdown
Author

@xiangwa Can you help perform a local review for this change per http://go/terraform-contribution-guide? This fixes the error detail dropping at the Terraform layer.

Context: http://go/orcas-rfc-997 (http://b/510762188)

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

@slevenick This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@yifanyang

Copy link
Copy Markdown
Author

Hello @slevenick, quick context for review:

  1. Local service-team review (@xiangwa) is complete, so this PR is ready for maintainer review (per http://go/terraform-contribution-guide).

  2. On the 4 VCR-test failures, I checked the replay and recording logs and didn't see any failed LROs. Since this PR only changes CommonOpError.Error(), they look unrelated to this change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants