Cloud Run v2 validateOnly PATCH returns HTTP 200, but operations.get returns 404

Hello Google Cloud community,

We’re experiencing a reproducible issue with the Cloud Run Admin API v2 while validating a configuration change for a Firebase 2nd generation Function.

Environment

  • Product: Cloud Run

  • Region: us-central1

  • Service type: Firebase Functions Gen 2

  • Service generation: 22

Problem

We submit a PATCH request using projects.locations.services.patch with:

  • validateOnly=true

  • updateMask=template,traffic

The API responds with HTTP 200 and returns an Operation with done=false.

However, the first subsequent projects.locations.operations.get request returns HTTP 404 NOT_FOUND, using the exact operation resource name returned by the PATCH response.

This behavior occurred twice with separate operations.

Checks performed

  • Verified the endpoints against the official Cloud Run Admin API v2 documentation.

  • Used the returned operation name without modifying it.

  • Confirmed no concurrent Cloud Run or Cloud Functions operations.

  • Confirmed no new revision was created.

  • Confirmed the service generation remained unchanged.

  • Confirmed IAM and production traffic were not modified.

Questions

  1. Is this expected or known behavior for validateOnly operations?

  2. Should a validate-only Operation be retrievable through operations.get?

  3. Is there a documented alternative to obtain a conclusive validation result?

  4. What is the recommended approach to create a no-traffic revision when changing only the runtime service account of a Firebase Gen 2 Function?

  5. How should we avoid configuration drift between Firebase Functions and direct Cloud Run API updates?

We have deliberately avoided executing the real PATCH until we understand this behavior.

Any guidance would be greatly appreciated. Thank you!

We have encountered a very similar Cloud Run Admin API v2 validateOnly behavior in a different environment.

Our environment:

  • Product: Cloud Run Service (not Firebase Functions Gen 2)

  • Region: europe-west3

  • API: projects.locations.services.patch

  • validateOnly=true

  • updateMask=labels

  • allowMissing=false

  • forceNewRevision=false

The API client entered its successful HTTP response path and returned an operation with the following resource name:

projects/(PII Removed by Staff)/locations/europe-west3/operations/94b4a9d6-c3ba-4167-8b8c-18207a8c5e32

The first projects.locations.operations.get call using this exact resource name returned 404 NOT_FOUND.

Important limitations of our evidence:

  • The initial exact numeric HTTP status was not preserved.

  • The operation response excerpt did not contain a done field.

  • The complete raw operation response was not retained.

  • Therefore, we cannot conclusively establish whether validation succeeded or failed.

We independently verified that the project, region, operation name, and GET endpoint were correct.

No persistent PATCH was executed. The service configuration, revision list, generation, and traffic remained unchanged.

Our service also has a separate, unresolved RoutesReady=CONDITION_RECONCILING condition following a previous rollback timeout. We do not have evidence that the two phenomena share a root cause.

Questions:

  1. Is an operation returned by a validateOnly=true PATCH expected to be retrievable through operations.get?

  2. Can validation operations legitimately return an operation resource that is not subsequently retrievable?

  3. Is there a documented way to obtain conclusive validation results without executing the persistent PATCH?

  4. Could an existing service reconciliation condition affect the behavior of validate-only operations?

We would appreciate clarification of the expected API behavior.

Documentation: AIP-151: Long-running operations

Thank you!

We are experiencing what appears to be the same issue with Cloud Run Admin API v2 in the asia-northeast1 region.

Our environment is a regular Cloud Run service, not Firebase Functions.

We call projects.locations.services.patch with:

  • validateOnly=true

  • updateMask=template

  • The current service ETag

The initial response returns an Operation containing name and metadata, but no done, response, or error fields.

Calling operations.get approximately 3 seconds later returns 404 NOT_FOUND. Subsequent get and wait requests also return 404, and the Operation is absent from operations.list.

We verified that:

  • The same credentials can list Operations and retrieve other completed Operations successfully.

  • The required IAM permissions are present.

  • The production service configuration and traffic remain unchanged.

  • No persistent update PATCH was executed.

Could Google clarify the following?

  1. Is this a known issue or expected behavior for validateOnly Operations?

  2. Are these Operations supposed to remain accessible through operations.get?

  3. What is the officially supported way to confirm successful validation when the returned Operation cannot be retrieved?

  4. Is there a recommended workaround that does not bypass validation?

We need a reliable validation result before safely applying a production configuration change.

Thank you for your assistance.

Example Code Implementation Guide

Install dependencies: Ensure you have installed the required Google Cloud libraries. In your terminal, run ’ pip install google-cloud-run’

Adapt to your programming language: If you are using another language (such as Node.js or Go) or directly using the REST API/cURL, the principle remains the same. Do not call the endpoint /v2/projects/…/operations/… Instead, simply check whether the initial response from the endpoint /v2/projects/…/services/…:patch is 200 or 400 more

ETag Handling: Since you mentioned using ETag in your question, ensure you also include the etag field (if using REST) or configure concurrency checks on the Service object if necessary to prevent race conditions.

Code Implementation (Python)

Here is an example implementation using the official Google Cloud Run client library in Python (google-cloud-run_v2).

from google.cloud import run_v2

from google.api_core.exceptions import InvalidArgument, GoogleAPICallError

def validate_cloud_run_service(project_id: str, location: str, service_id: str, new_template) → bool:

“”

Melakukan validasi perubahan konfigurasi layanan Cloud Run tanpa menerapkannya.

Parameter:

  • project_id (str): ID project Google Cloud your.

  • location (str): Region Cloud Run (contoh: ‘asia-northeast1’).

  • service_id (str): Nama layanan Cloud Run you.

  • new_template: Objek template konfigurasi you want

Return:

  • bool: True jika validasi sukses, False jika gagal.

“”"

  1. Inisialisasi klien Cloud Run v2

client = run_v2. ServicesClient()

  1. Make path all services

service_path = client.service_path(project_id, location, service_id)

  1. request validate_only=True

request = run_v2. UpdateServiceRequest(

service=run_v2. Service(

name=service_path,

template=new_template

),

update_mask

update_mask={“paths”: [“template”]},

validate_only=True

)

print validasi (dry-run)…"

try:

  1. Lakukan panggilan PATCH

Proses validasi real-time. We are no chek operations.get()

response = client.update_service(request=request)

  1. Konfirmasion Sukses

If the code reaches this point (no Exception), then HTTP 200 is OK.

Successful validation and safe configuration for production.

print(“Validation Successful! Configuration is safe to implement.”)

return True

except InvalidArgument as e:

If the configuration is incorrect, the API will immediately reply with HTTP 400

print(f" Validation Failed (Invalid configuration): {e.message}")

return False

except GoogleAPICallError as e:

Catch network errors, IAM permissions, or ETag mismatches

print(f" API error: {e.message}" occurred)

return False

– How to Use the Above Code —

new_template_data = run_v2. RevisionTemplate(…) (Fill in with your template configuration)

is_valid = validate_cloud_run_service(“my-project”, “asia-northeast1”, “my-service”, new_template_data)

if is_valid:

Run the update logic to production (validate_only=False) here

To apply changes to production, we will combine the previous validation logic with the actual update command.

Here is the workflow:

Initial Validation: The code first calls validate_only=True to ensure there are no configuration errors.

Production Update: If validation succeeds (returns True), we create a new request with validate_only=False.

Wait for Completion: Unlike the instant validation process, a production update takes time (downloading container images, configuring network routes, etc.). Therefore, the Cloud Run API returns a valid Operation object. We call .result() on this object. This function makes our program wait patiently until the deployment process is fully complete before proceeding to the next line of code.

Pada Kam, 12 Nov 2026, 00.00, BITT Company <no-reply@discuss.google.dev> menulis: