ArgoCD - Resolve "no new finalizers can be added if the object is being deleted"

by
Jeremy Canfield |
Updated: January 13 2025
| ArgoCD articles
Let's say something like this is being returned when attempting to delete an application from ArgoCD.
~]$ argocd app delete openshift-gitops/hello-world
Are you sure you want to delete 'openshift-gitops/hello-world' and all its resources? [y/n] y
FATA[0002] rpc error: code = InvalidArgument desc = error patching application with finalizers: Application.argoproj.io "hello-world" is invalid: metadata.finalizers: Forbidden: no new finalizers can be added if the object is being deleted, found new finalizers []string{"resources-finalizer.argocd.argoproj.io"}
Assuming ArgoCD is running on Kubernetes or OpenShift, the kubectl (Kubernetes) or oc (OpenShift) get application.argoproj.io command can be used to display the applications finalizers. Notice in this example that the application has the "argocd.argoproj.io/foreground" finalizer.
~]$ oc get application.argoproj.io/hello-world --namespace openshift-gitops --output jsonpath="{.metadata.finalizers}"
["resources-finalizer.argocd.argoproj.io/foreground"]
The kubectl (Kubernetes) or oc (OpenShift) patch application.argoproj.io command can be used to remove the finalizers from the application.
oc patch application.argoproj.io/hello-world --type json --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]' --namespace openshift-gitops
Did you find this article helpful?
If so, consider buying me a coffee over at