Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for insufficient permissions to create new user #1238

Closed
brittag opened this issue Oct 4, 2017 · 5 comments
Closed

Comments

@brittag
Copy link

brittag commented Oct 4, 2017

Command

Using a normal CF account that doesn't have Admin permissions, I ran a create user command: cf create-user test test

What occurred

I received an error message that says "Insufficient scope for this resource", which is technical/jargony language that the reader may not understand if they aren't familiar with CF internals.

Creating user test...
Error creating user test.
Insufficient scope for this resource
FAILED

What you expected to occur

I suggest returning a plain-language error message. For example, other actions that I can't do because I'm not an admin (such as cf create-org test) give me "You are not authorized to perform the requested action". So here's what I expected to occur:

Creating user test...
Error creating user test.
Server error, status code: 403, error code: 10003, message: You are not authorized to perform the requested action
FAILED

CLI Version

cf version 6.32.0+0191c33d9.2017-09-26

CC API Endpoint Version

api version: 2.96.0

Thanks!

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/151666616

The labels on this github issue will be updated when the story is started.

@dkoper
Copy link

dkoper commented Oct 4, 2017

Hi @brittag

Thanks for taking the time to bring this up.

The server error message you proposed is used by a lot of commands that talk to the CC API. I'm not sure if that format is really better and would like to consider phasing it out.

Here, how about just changing it to something like the following?

d:\Users\koperd\Downloads\bin>cf create-user a b
Creating user a...
FAILED
Error creating user a.
You are not authorized to perform the requested action.

@brittag
Copy link
Author

brittag commented Oct 4, 2017

Sure, that would work for me! I agree that the existing error message format used by other commands could be better. :)

@dkoper
Copy link

dkoper commented Nov 21, 2017

Addressed in cf CLI 6.33.0.

@brittag
Copy link
Author

brittag commented Nov 21, 2017

Awesome! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants