Invalid signature for user or client 'adam'


#1

My knife.rb has

chef_org    = ENV['CHEF_ORG']     || 'abc'
chef_user   = ENV['OPSCODE_USER'] || 'xyz

I created a user and an org like this

chef-server-ctl user-create adam Adam Chris adam@xyz.com 'root123' --filename /tmp/adam.pem
chef-server-ctl org-create terraform 'Terraform Chef Inc' --association_user adam --filename terraform-validator.pem'

Set CHEF_ORG=terraform and OPSCODE_USER=adam. But when I run chef show-policy I keep getting

Error: Failed to list policyfile data from the server
Reason: (Net::HTTPServerException) HTTP 401 Unauthorized: Invalid signature for user or client 'adam'

Any help why I keep getting this error?


#2

Did you create any user before?


#3

Yes many times. Am I missing anything?


#4

From chef-manage reset the user key and download the same user key and then replace the current user key in adam.pem file in your workstation with the downloaded one.