ripevik
ripevik

Reputation: 53

Chef workstation error

I have set up the chef server and workstation before, configured nodes to it, run recipes and worked on chef. But recently i have been facing this issue, that has been troubling me from the past few days.

When i run the command for setting up workstation,

knife configure -i

the prompt asks us to enter the details of location of pem files and server FQDN and etc.

Below is the error:

[root@chef-server .chef]# knife configure -i
Overwrite /root/.chef/knife.rb? (Y/N) Y
Please enter the chef server URL: [https://myserver.example.com:443]
Please enter a name for the new user: [root] anyuser
Please enter the existing admin name: [admin]
Please enter the location of the existing admin's private key: [/etc/chef-server/admin.pem] ~/.chef/admin.pem
Please enter the validation clientname: [chef-validator]
Please enter the location of the validation key: [/etc/chef-server/chef-validator.pem] ~/.chef/chef-validator.pem
Please enter the path to a chef repository (or leave blank):
Creating initial API user...
Please enter a password for the new user:
ERROR: Service temporarily unavailable
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError)
        from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:199:in `read_body'
        from /opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:226:in `body'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:502:in `rescue in format_rest_error'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:500:in `format_rest_error'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:480:in `humanize_http_exception'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:430:in `humanize_exception'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:421:in `rescue in run_with_pretty_exceptions'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:412:in `run_with_pretty_exceptions'
        from /opt/chef/embedded/apps/chef/lib/chef/knife.rb:213:in `run'
        from /opt/chef/embedded/apps/chef/lib/chef/application/knife.rb:139:in `run'
        from /opt/chef/embedded/apps/chef/bin/knife:25:in `<top (required)>'
        from /usr/bin/knife:40:in `load'
        from /usr/bin/knife:40:in `<main>'

This is the trace. Thanks.

Upvotes: 2

Views: 2521

Answers (2)

Harsha Biyani
Harsha Biyani

Reputation: 7268

Sometimes this error occurs because of proxies.
Simply unset the proxies:

unset http_proxy
unset https_proxy 

Upvotes: 5

Mark O&#39;Connor
Mark O&#39;Connor

Reputation: 77961

What version of chef are you using? I wonder if you are experiencing CHEF-4010 which is a problem registering a new user. (The "-i" parameter to knife command).

As a work-around for Chef Server 11 I can suggest using the pre-configured "admin" user on your chef server. See:

Upvotes: 0

Related Questions