Skip to content

Cloud Run Service Level Scaling returns 409 #14259

@hfurkanvural

Description

@hfurkanvural

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

Context
I wanna manage my cloud run function's service level scaling from python client. however i get 409 error even though it should not trigger a new version according to the behaviour on UI.

Here is the example code:

        # Get the current service
        service = client.get_service(name=service_name)
        
        service.scaling.min_instance_count = min_instances

        update_mask = field_mask_pb2.FieldMask(
            paths=["scaling.minInstanceCount"]
        )

        update_request = run_v2.UpdateServiceRequest(
            service=service,
            update_mask=update_mask,
            allow_missing=False
        )
        
        # Update the service
        operation = client.update_service(request=update_request)
        

Expected Behavior:
The Scaling value is updated without an error message

Image

Actual Behavior:
Update operation returns the following error message:
409 Revision named '' with different configuration already exists.

API client name and version

google-cloud-run 0.10.9

Reproduction steps: code

file: main.py

        # Get the current service
        service = client.get_service(name=service_name)
        
        service.scaling.min_instance_count = min_instances

        update_mask = field_mask_pb2.FieldMask(
            paths=["scaling.minInstanceCount"] ## also tried scaling.min_instance_count
        )

        update_request = run_v2.UpdateServiceRequest(
            service=service,
            update_mask=update_mask,
            allow_missing=False
        )
        
        # Update the service
        operation = client.update_service(request=update_request)

Reproduction steps: supporting files

Reproduction steps: actual results

409 Revision named '' with different configuration already exists.

Reproduction steps: expected results

HTTP 200

OS & version + platform

MacOS Sequoia

Python environment

3.11.9

Python dependencies

google-api-core 2.25.1
google-auth 2.40.3
google-cloud-run 0.10.9
googleapis-common-protos 1.70.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions