During experiments i found the following "deadlock" when deleting an application.
I have an application which provisions an appproject a namespace and a new application (which is in the new project and deloys services in the new namespace)

Doing a cascading delete on test-app yields the following result:
the local-joe application stays behind with the error message:
InvalidSpecError
Application referencing project local-joe which does not exist
Application test-app stays behind with the error:
DeletionError
Operation cannot be fulfilled on namespaces "local-joe": The system is ensuring all content is removed from this namespace. Upon completion, this namespace will automatically be purged by the system.
What inspecting the cluster shows is that all the resources from app local joe are gone.
The namespace is deleted
A way to fix this behavior is to manually issue:
kubectl delete apps local-joe
application.argoproj.io "local-joe" deleted
which removes the local-joe app and allows test-app to delete.
Also attached the application controller log.
delete.log
for some reason, kubectl delete apps <app_name> -n <namespace> did not work for me.
The response application.argoproj.io "<app_name>" deleted looks like it worked, but if I
kubectl get apps -n <namespace>, the app still remains.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
for some reason,
kubectl delete apps <app_name> -n <namespace>did not work for me.
The responseapplication.argoproj.io "<app_name>" deletedlooks like it worked, but if I
kubectl get apps -n <namespace>, the app still remains.
I had a finalizer in the app, going in and editing that to - finalizer: [] allowed it to delete.
Hi, I have the same problem with v1.3.0, until I delete the finalizer the Application object could not be deleted.
Any suggestion or information on this?
Regards
We could do with clear repro steps for this one.
I just had this with the latest argo. I'll see if I can reliably reproduce this.
I created the application by kubectl apply -f the manifest into the cluster. This had a finalizer specified in the metadata.
If I removed the app with kubectl delete it would move the state to deleting, but not delete anything, not the app, nor any of the resources.
I then edited the manifest and removed the finalizer. This caused argo to remove the app, but did not remove any of the resources.
If I removed through the UI, the resources would be removed, but the app itself would not be removed.
Again: once I removed the finalizer from the manifest using kubectl edit, the app would be removed as well.
This was on a clean ArgoCD install, no other apps in the k8s cluster. The only modifications I had done was load a custom tool using an init container and an update to the configmap to enable it.
Most helpful comment
I had a finalizer in the app, going in and editing that to - finalizer: [] allowed it to delete.