5

I am running a pyspark dataproc serverless batch. It has been running for too long so I decided to delete it. But neither the GCP console nor the CLI allow me to delete the batch.

The command I tried is

gcloud dataproc batches delete <Batch ID> --region=us-central1

I get the following error:

ERROR: (gcloud.dataproc.batches.delete) FAILED_PRECONDITION: Cannot delete non terminal batch 'Batch(<project-id/batch-id>)'; current state: 'RUNNING'

2
  • 1
    I think you want to try gcloud dataproc batches cancel
    – Dagang Wei
    Commented Aug 26, 2022 at 16:46
  • Perfect, this cancelled the batch immediately. Thanks @Dagang!
    – Afaq
    Commented Aug 26, 2022 at 16:47

1 Answer 1

6

gcloud dataproc batches cancel is used to cancel a running batch, while gcloud dataproc batches delete is used to delete the batch resource. In this case, you want to use cancel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.