ECS: Error 40019 (http: 409): Namespace not empty. Namespace cannot be deleted as its not empty
Summary: This knowledge article explains why a user is unable to delete a namespace.
Symptoms
While deleting the namespace from the UI, this alert is seen:Error 40019 (http: 409): Namespace not empty. Namespace cannot be deleted as its not empty. Please make sure all users and buckets are deleted from the namespace.
Cause
User is using legacy object users and is not using Identity and Access Management (IAM) and did not delete all users and buckets associated with the namespace.
Scenario 2
User is using IAM entities along with legacy object users and did not delete all the IAM entities associated with the namespace (IAM users, roles, groups, policies).
Resolution
Scenario 1
1: Use command svc_bucket list | grep <namespace name> to see no bucket is associated to this namespace.
2: Use command svc_user list | grep <namespace name> to see no users are still associated to this namespace.
3: Once all legacy object users and buckets have been removed from the namespace, proceed with deleting it on the UI.
Scenario 2
1: Use command svc_bucket list | grep <namespace name> to see no bucket is associated to this namespace.
2: Use command svc_user list | grep <namespace name> to see no users are still associated to this namespace.
3: Search in the logs for the below ERROR to see that the user is using IAM entities:# svc_log -f "Error 40019" -sr all -n all -sf -start "1 day ago"
169.254.1.1 ecsportalsvc.log.20221209-123634.gz 2022-12-27 09:32:59,779 [play-thread-11] ERROR Logger.java (line 608) Error 40019 (http: 409): Namespace not empty. Namespace cannot be deleted as its not empty. Please make sure all users and buckets are deleted from the namespace com.emc.ecs.client.exceptions.ServiceErrorException: Error 40019 (http: 409): Namespace not empty. Namespace cannot be deleted as its not empty. Please make sure all users and buckets are deleted from the namespace
# svc_log -f "namespace1" -sr objcontrolsvc -n all -sf | grep ERROR -A5 -B5
169.254.1.1 objcontrolsvc.log 2022-12-27T12:33:18,628 [qtp483722291-1018448-d4714582:17dcfd4591d:76a8b:1b1] ERROR ResourceClient.java (line 331) request id d4714582:17dcfd4591d:76a8b:1bc, command type REQUEST_NAMESPACE_DELETE failed with error code ERROR_NAMESPACE_NOT_EMPTY and message 'Namespace schemaType NAMESPACE_KEY namespaceId namespace1 has iam entities associated with it'
4: Once you have found this error then the user is using IAM entities with this namespace. The user must remove any IAM entities associated to this namespace using the root user on the UI (Users, roles, groups and user-defined policies).
5: Once all legacy object users, buckets and IAM entities have been removed from the namespace, proceed with deleting it on the UI.