Skip to content

Cloud Run Job v2 API does not include the force query parameter for Jobs.Delete #2250

Open
@japerry911

Description

@japerry911

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • Python version: python --version - 3.10.12
  • pip version: pip --version - 23.0.1
  • google-api-python-client version: pip show google-api-python-client - 2.101.0

Steps to reproduce

  1. Try to add force=True query parameter to client.jobs().delete(name=..., force=True) and it will not work

Code example

# Example 1:
        request = cr_client.jobs().delete(
            name=f"projects/{project}/locations/{location}/jobs/{job_name}",
            force=True,
        )
  
        request.execute()

# Example 2:
      request = cr_client.jobs().delete(
            name=f"projects/{project}/locations/{location}/jobs/{job_name}",
        )

        # True so Execution is deleted too when job is deleted
        request.uri += "&force=true"

        request.execute()

Stack trace

# example
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://run.googleapis.com/v2/projects/REDACTED/locations/us-central1/jobs/prefect-cautious-rat?alt=json&force=true returned "Invalid JSON payload received. Unknown name "force": Cannot bind 'true'. Field 'force' could not be found in request message.". Details: "[{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'description': 'Invalid JSON payload received. Unknown name "force": Cannot bind \'true\'. Field \'force\' could not be found in request message.'}]}]">

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.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