Skip to main content

Check your knife configuration and network settings, unable to upload cookbooks

While uploading cookbook to chef 11 server (OEL), I was getting the below errors

C:\Users\Administrator>knife cookbook upload testcookbook
Uploading testcookbook [0.1.0]
ERROR: Network Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2)
Check your knife configuration and network settings

C:\Users\Administrator>knife cookbook upload testcookbook
Uploading testcookbook1 [0.1.0]
ERROR: Network Error: getaddrinfo: No such host is known.
Check your knife configuration and network settings

To find what is causing this issue, I ran knife cookbook upload in debug mode

C:\Users\Administrator>knife cookbook upload testcookbook -s https://192.168.56.11 -V
Uploading testcookbook [0.1.0]
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Saving testcookbook
INFO: Uploading files
INFO: Uploading C:/chef/cookbooks/testcookbook/README.md (checksum hex = 866c66fbbeeed75645878322325a0ad3) to https://chef11server:443/bookshelf/organization-00000000000000000000000000000000/checksum-866c66fbbeeed75645878322325a0ad3?AWSAccessKeyId=46f5b52c94c12edb1e063949584cb104e33621d6&Expires=1369293107&Signature=T7CcJ8j4AfbL%2Bj9MW3VYaiOreAE%3D
INFO: Uploading C:/chef/cookbooks/testcookbook/metadata.rb (checksum hex = 898c2324db952165a2d1c5ccbe001e31) to https://chef11server:443/bookshelf/organization-00000000000000000000000000000000/checksum-898c2324db952165a2d1c5ccbe001e31?AWSAccessKeyId=46f5b52c94c12edb1e063949584cb104e33621d6&Expires=1369293107&Signature=bawORybiM1qEAcZg57fU05f09Ko%3D
INFO: Uploading C:/chef/cookbooks/testcookbook/recipes/default.rb (checksum hex = b1f1a0eb70815f2d9c4b037f42e5270d) to https://chef11server:443/bookshelf/organization-00000000000000000000000000000000/checksum-b1f1a0eb70815f2d9c4b037f42e5270d?AWSAccessKeyId=46f5b52c94c12edb1e063949584cb104e33621d6&Expires=1369293107&Signature=4np1gJX3OXt/nimyxkF5xuu6beQ%3D
INFO: Uploading C:/chef/cookbooks/testcookbook/CHANGELOG.md (checksum hex = c867cc5c2b8b26452dd4ea392008f334) to https://chef11server:443/bookshelf/organization-00000000000000000000000000000000/checksum-c867cc5c2b8b26452dd4ea392008f334?AWSAccessKeyId=46f5b52c94c12edb1e063949584cb104e33621d6&Expires=1369293107&Signature=RubHVNWnZyf9Np3/gZVGdX9owJE%3D
ERROR: Network Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2)
Check your knife configuration and network settings

Solution

Chef server uses FQDN for the redirection between the different components in this case was bookshelf and erchef. While install time the chef server we configure valid FQDN then we will face this issue..

So I created file called /etc/chef-server/chef-server.rb, and added below lines... 
server_name = "192.168.56.11"
api_fqdn server_name
nginx['url'] = "https://#{server_name}"
nginx['server_name'] = server_name
lb['fqdn'] = server_name
bookshelf['vip'] = server_name

Next I run chef-server-ctl reconfigure.

...I was able upload the cookbook to chef server now.





Comments

  1. Thanks for Blogging this troubleshoot. It was useful for me coz was facing the same Issue.

    ReplyDelete
  2. Great!!
    You saved me
    Thanks a lot

    ReplyDelete
  3. For me it didn't make any difference... knife cookbook upload --all gave me this error, and upload worked fine. Weird

    ReplyDelete
  4. This was a pain to figure out ... your solution was the only one that worked.

    ReplyDelete
  5. You just saved me a headache. THANK YOU :) Is there someplace where I can read-up on this fqdn mess? Does this require an internal dns? :)

    ReplyDelete
  6. it also solved problem related to server_name not found type of err messages when uploading cookbooks to hosted chef-server running on vigrant/virtual box VMs.

    Thanks for the tip!

    ReplyDelete
  7. Thanks for posting this..

    ReplyDelete
  8. Thanks a lot! It works! =)
    -m

    ReplyDelete
  9. I just took off the burned parts where it was cut too thin to cook properly. It probably would have looked nicer and would not have had the burned spots had I used a filet knife.Me Knives

    ReplyDelete
  10. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more home cleaning new york https://www.lesmeilleursvpn.com/

    ReplyDelete
  11. I know your aptitude on this. I should say we ought to have an online discourse on this. Composing just remarks will close the talk straight away! What's more, will confine the advantages from this data.  diebestenvpn.ch

    ReplyDelete
  12. Victorinox - Nature Adventure - Classic SD Swiss Army Multi-Tool - 0.6223.L1505 ... I do my best to accurately describe and show any issues with best knife for camping and hiking

    ReplyDelete
  13. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. http://pickbestproduct.com

    ReplyDelete
  14. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for.
    https://zartash.pk

    ReplyDelete
  15. The 10 Best EDC Pocket Knives Under $50. Mikey Bautista. June 27, 2016. 120 Likes 43 Comments ... A good EDC knife saves you that time, effort, and headache. Its usefulness doesn't stop there, but the best way to find out how a knife can be helpful to you is by simply carrying one. ... Leave a comment with the best knife you've bought under $50 . best stiletto knife

    ReplyDelete
  16. outsourcingall.com "Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it.
    This paragraph gives clear idea for the new viewers of blogging, Thanks you. You’re doing a great job Man, Keep it up.
    outsourcing training

    ReplyDelete

Post a Comment

Popular posts from this blog

Setup little kitchen using Chef 11 server on CentOS 6

To setup little kitchen (development environment), I created 2 win2k8 R2 VMs one for workstation and another for node. For chef server I downloaded the CentOS 6.4 and installed on my box using virtualbox. To configure network between CentOS VM and the 2 windows VMs; I selected adapter 1 as Host-only Adapter and Adapter 2 as NAT for each of VMs network settings in VirtualBox. Steps I followed to install Chef 11 server 1. Download the relevant platform package from the opscode site; you can use curl/wget. If you don't have wget then you can install by running #yum install -y wget" #wget https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chef-server-11.0.4-1.el6.x86_64.rpm 2. Install the downloaded package using rpm or yum #rpm -Uvh chef-server-11.0.4-1.el6.x86_64.rpm 3. Please add the hostname and the ip address of your chef server to the /etc/hosts file, to know your hostname run the #hostname. 4. After installation configure the

Connection failed - user: chef - (Bunny::ProtocolError)

I was trying to setup chef server on my local box using Oracle Enterprise Linux 6.4. After sucessfully installing all the required serivces chef-server was not running, so when I tried to start the service below error was displayed. Chef-server dead but pid file exists I tried to find the cause of this issue in logs but no clues in the logs as well. Then I run the chef server in foreground using the below command, to debug the issue #chef-server -C /etc/chef/server.rb -L /var/log/chef/server.log -p 4000 -e production -a thin -P /var/run/chef/server.pid -u chef -G chef Below stack trace was displayed merb : chef-server (api) : worker (port 4000) ~ Connection failed - user: chef - (Bunny::ProtocolError) This issue was becuase chef server was unable to connect to rabbitmq using bunny protocal as user chef. I had already run the below rabbitmq server configuration which is recommended in opscode site, but still it was failing to connect to rabbitmq # rab