Overview
When CircleCI jobs are queued or otherwise won't run, it is sometimes necessary to manually clear out the Nomad job queue as part of regular troubleshooting—refer to our Introduction to Nomad Cluster Operation article for a basic overview.
CircleCI Server 3.x/4.x
To cancel a single job:
- Make sure you are connected to the Kubernetes Cluster
-
kubectl exec $(kubectl get pods -l app=nomad-server -o jsonpath='{.items[0].metadata.name}' -n <namespace>) -n <namespace> -- nomad status
-
kubectl exec $(kubectl get pods -l app=nomad-server -o jsonpath='{.items[0].metadata.name}' -n <namespace>) -n <namespace> -- nomad stop $ID
To force cancel all jobs in the queue:
- Make sure you are connected to the Kubernetes Cluster
-
kubectl get pods -l layer=execution -n <namespace>
-
kubectl exec $(kubectl get pods -l app=nomad-server -o jsonpath='{.items[0].metadata.name}' -n <namespace>) -n <namespace> -- sh -c "nomad status | cut -d' ' -f1 | grep -v 'ID' | xargs -n1 nomad stop"
Comments
Article is closed for comments.