4

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'

Afaq
  • 1,146
  • 1
  • 13
  • 25

1 Answers1

5

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.

Dagang
  • 24,586
  • 26
  • 88
  • 133