Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
japerry911 opened this issue Sep 30, 2023 · 1 comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@japerry911
Copy link

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!

@japerry911
Copy link
Author

@ohmayr ohmayr added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants