# Problems with removing namspace. Error in apiserver

**URL:** <https://forums.suse.com/t/problems-with-removing-namspace-error-in-apiserver/10991>\
**Category:** SUSE Rancher Prime\
**Created:** [July 3, 2018, 7:44am UTC](https://forums.suse.com/t/problems-with-removing-namspace-error-in-apiserver/10991 "2018-07-03T07:44:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmiskiew](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@mmiskiew](https://forums.suse.com/u/mmiskiew)\
**Post date:** [July 3, 2018, 7:44am UTC](https://forums.suse.com/t/problems-with-removing-namspace-error-in-apiserver/10991/1 "2018-07-03T07:44:56Z")

</div>

Hello,

I recently deployed Rancher 2.0.3 and created 3 node k8s cluster (10.1 k8s, 17.03 docker ce). I started playing with Longhorn but after some fun i tried to remove it. All pods were deleted, catalog app also but namespace still persists. Api-Server give me logs:

E0702 20:01:07.365387 1 crd\_finalizer.go:131] Operation cannot be fulfilled on [customresourcedefinitions.apiextensions.k8s.io](http://customresourcedefinitions.apiextensions.k8s.io) “[replicas.longhorn.rancher.io](http://replicas.longhorn.rancher.io)”: the object has been modified; please apply your changes to the latest version and try again

I tried to remove resource “manually” and play with local kubectl (found on stackoverflow trying removal of “finalizers” in namespace definitions - but editing namespace didn’y “apply”).

Currently we are on dev machine so it’s not “a big deal” but does anybody have an idea how to remove these “zombie namespace”? I tried --force, --grace-period but api response was always “the resource is currently removing etc…”. On kubernetes cluster state of namespace is “Terminating” (for few hours now).

---

<div class="post-metadata">

**Author:** ![sra](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sra/32/1514_2.png) [@sra](https://forums.suse.com/u/sra)\
**Post date:** [July 3, 2018, 12:58pm UTC](https://forums.suse.com/t/problems-with-removing-namspace-error-in-apiserver/10991/2 "2018-07-03T12:58:27Z")

</div>

Try removing the finalizer by patching:

`kubectl patch ns FOONS --type merge -p '{"metadata":{"finalizers": null}}'`

---

<div class="post-metadata">

**Author:** ![Amit\_J\_damitj](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/amit_j_damitj/32/5341_2.png) [@Amit\_J\_damitj](https://forums.suse.com/u/Amit_J_damitj)\
**Post date:** [July 10, 2018, 7:24am UTC](https://forums.suse.com/t/problems-with-removing-namspace-error-in-apiserver/10991/3 "2018-07-10T07:24:56Z")

</div>

Doesnt work … It says -  
namespace “zombie1” not patched

---

<div class="post-metadata">

**Author:** ![yeti](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@yeti](https://forums.suse.com/u/yeti)\
**Post date:** [November 15, 2018, 11:06pm UTC](https://forums.suse.com/t/problems-with-removing-namspace-error-in-apiserver/10991/4 "2018-11-15T23:06:24Z")

</div>

It’s almost always the existence of CRD’s that prevents the Longhorn directory from deleting properly. List your Custom Resource Definitions, and delete the ones that have longhorn in their name. The namespace will then delete.

Then use nfs-client-provisioner instead of longhorn…
