Deleting an Organization gives "Unable to delete all users and userroles"

When trying to delete an org, noticing the following error.

**************************

{ "code" : "usersandroles.UnableToDeleteAllUsersAndRoles", "message" : "Unable to delete all users and userroles", "contexts" : [ ], "cause" : { "message" : "[LDAP: error code 66 - subordinate objects must be deleted first]", "contexts" : [ ] }

******************************************

Organization is not available on the UI but when we query using a curl call still it shows up.

Any ideas?

0 4 895
4 REPLIES 4

Not applicable

Organizations are owner or contain association with multiple entities. In order to delete an Org you must fist delete or disassociate multiple elements. Follow this procedure to delete the Org.

Thanks for quick reply. We were using the same link shared for our work and were able to delete the environment fine but when deleting the org, noticing the error with user/user roles.

These are the user roles the org is associated with:

[ "orgadmin", "businessuser", "opsadmin", "user" ]

I am unable to reproduce this, but the error code indicates there's an issue with removing the entries on the LDAP backend. You can try manually removing the organization's user roles first:

> curl -u <creds> http://<msip>:8080/v1/o/<org>/userroles/<role>; -X DELETE

If that fails it may require manually updating the LDAP backend to remove the affected organization.

Thanks Paul. We attempted to delete an org again after attempting to delete the user roles. Here are the details.

-- Listing of user roles associated with an Org. curl -u TeamT2SharedServicesDevelopment@internal.tdameritrade.com:PWD http://npectlvapigee03.iteclientsys.local:8080/v1/o/Institutional_STE2/userroles/ [ "orgadmin", "businessuser", "opsadmin", "user" ]

We were able to delete all the roles except org admin. curl -u TeamT2SharedServicesDevelopment@internal.tdameritrade.com:PWD http://npectlvapigee03.iteclientsys.local:8080/v1/o/Institutional_STE2/userroles/orgadmin -X DELETE

--Error when deleting orgadmin user role. ***************** { "code" : "usersandroles.OrgadminRoleCannotBeDeleted", "message" : "Orgadmin role cannot be deleted", "contexts" : [ ] }

******************************

Then we disassociated the POD: curl -H "Content-Type: application/x-www-form-urlencoded" -u TeamT2SharedServicesDevelopment@internal.tdameritrade.com:PWD -X POST "http://npectlvapigee03.iteclientsys.local:8080/v1/organizations/Institutional_STE2/pods" -d "action=remove&region=dc-1&pod=gateway"

When attempting to delete the org:

curl -u TeamT2SharedServicesDevelopment@internal.tdameritrade.com:PWD -X DELETE "http://npectlvapigee03.iteclientsys.local:8080/v1/organizations/InstitutionalE2" *********************** { "code" : "usersandroles.UnableToDeleteAllUsersAndRoles", "message" : "Unable to delete all users and userroles", "contexts" : [ ], "cause" : { "message" : "[LDAP: error code 66 - subordinate objects must be deleted first]", "contexts" : [ ] } ****************************************

The org is not avaialbel in the UI screen but when listing the orgs using a curl command it shows up.

Please help.

Version of OPDK:

Installed Current Version Apigee Enterprise 1.0.0.1078.fe7934c.1509010011 Apigee UI 4.15.07.00-75d1384-20150823-004603 Cassandra 2.0.15 Zookeeper 3.4.5