"Server Error, Error Code- 1002, Error Message "cannot set space role because user is not part of the org" is seen when Using CF set-space-role
search cancel

"Server Error, Error Code- 1002, Error Message "cannot set space role because user is not part of the org" is seen when Using CF set-space-role

book

Article ID: 297690

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Symptoms:

When a user is trying to set a space-role using, cf set-space-role they get the following error:

FAILED
Server error, error code: 1002, message: cannot set space role because user is not part of the org

 

Environment


Cause

This happens because the admin user is trying to set a space-role for a specific user without setting an org-role. For the user to belong to particular space (by getting a space-role), the user must be part of the organizations (that space resides in) first (by getting an org-role).

 

Resolution

Resolving this issue is quite easy. Simply issue the following command:

$ cf set-org-role USERNAME ORG (OrgManager/BillingManager/OrgAuditor)

After the user has an org-role set for them, any org or space admin should be able to use the cf set-space-role to set a space-role for the user.