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

When you create a user via chef-server-ctl add-user with --filename pointed at invalid path, the user is created, but the key is not put on the filesystem. #17

Closed
tylercloke opened this issue Nov 5, 2014 · 4 comments · Fixed by chef-boneyard/opscode-omnibus#722
Assignees

Comments

@tylercloke
Copy link
Contributor

root@vagrant:~# chef-server-ctl user-create test test test test@test.com testtest --filename /<invalid_folder>/file.key
ERROR: Errno::ENOENT: No such file or directory - /path/to/file.key
root@vagrant:~# chef-server-ctl user-create test test test test@test.com testtest --filename /<valid_folder>/file.key
ERROR: Conflict
Response: User 'wtf' already exists

So it creates the user just fine, and you get a conflict when you try to re-create it (valid), but you won't have the key on your filesystem. There are other ways to get the key, but that's annoying.

@stevendanna
Copy link
Contributor

Thanks @tylercloke. With the newest changes to knife-opc, you can get the key with the user-edit command and adding

"private_key": true

to the user data. I agree this is annoying, I think we should probably do something like:

  1. Check if we can write into the directory before issuing the API request, fail with an error if we cannot.
  2. Write the key to STDERR if the write to the file fails.

We'll probably want to follow whatever best-practices chef-client uses when writing credentials as well.

@jmink
Copy link
Contributor

jmink commented Dec 1, 2014

This has been addressed in the linked PR

@marcparadise
Copy link
Member

This is fixed in current knife-opc, so bumping the rev in omnibus should resolve it

@Abhsubba
Copy link

Abhsubba commented Mar 22, 2018

you may created the org or user my mistake, but every problem has some solution.its simple

sudo -s
chef-server-ctl org-delete learndevops

learndevops is my org-name you may have different.

this will delete the old one so you can create new user or org name.

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

Successfully merging a pull request may close this issue.

5 participants