Solved

Chef error when uploading cookbooks from workstation

Posted on 2015-01-08
1
456 Views
Last Modified: 2015-01-26
Hi all, I'm currently trying to do something that should be very simple, but is turning out not to be. I have tried this from both a Windows and an Ubuntu workstation and so far, am getting the same error.

I'm using chef 12.0.3 (Latest) on both the server and the workstation. Pretty much everything else I've tried works, including bootstrapping a new node to the server, etc. but this is getting in the way, for obvious reasons. A chef-server I can't upload cookbooks to, is pretty useless.

As you can see in the output below, the communication with the server is fine, it is sending HTTP headers and getting appropriate responses, the conversation gets past the point of uploading the files, but then spits out an error relating to https, when trying to 'initialize'.

When issuing the 'knife upload cookbook learn_chef_apache2' command, using the -VV option to get more output, the output is as follows:

vagrant@precise32:~/chef-repo$ knife cookbook upload --server-url "https://not.the-real-domain.com:443" learn_chef_apach
e2 -VV
INFO: Using configuration from /home/vagrant/chef-repo/.chef/knife.rb
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as vagrant
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to https://not.the-real-domain.com/cookbooks?num_versions=all
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: vagrant
DEBUG: X-OPS-TIMESTAMP: 2015-01-07T11:35:53Z
DEBUG: X-OPS-CONTENT-HASH: 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
DEBUG: X-OPS-AUTHORIZATION-1: WNa3RvVKzoCvc5lSIPk2viXh2SbQfESyJ6T02QG7nyU039uIlbk/rU8yqFtI
DEBUG: X-OPS-AUTHORIZATION-2: NFfxhEzKOp0xvD1rRlteucmQgAhW0oXpYLvZceecJXOJlWnfQBPAkW8F+sbZ
DEBUG: X-OPS-AUTHORIZATION-3: H6l3J6No8q6OaobGOObbZuWlNcLWAJlQ8Hs01ruS7JqqWVu72CZkyzO/sean
DEBUG: X-OPS-AUTHORIZATION-4: abKNA3HTZP4hmqOk7GMOGQdcqje9bHRHvj6DsciFGSNPlOfQV9WyhD7sOspQ
DEBUG: X-OPS-AUTHORIZATION-5: XHjmqjPlTdvSScXTjDb/zn9Tzrbg6+DIS3aIcOI2IHJOadA8gLh0sokUvffA
DEBUG: X-OPS-AUTHORIZATION-6: i8B2PtFgu3KaTgFhkL2YY9JvhaAAZoZIKHylMi4ZYg==
DEBUG: HOST: not.the-real-domain.com:443
DEBUG: X-REMOTE-REQUEST-ID: ed61a6b3-5f25-478e-b0c6-fb333aa8935b
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: nginx/1.4.4
DEBUG: date: Wed, 07 Jan 2015 11:35:54 GMT
DEBUG: content-type: application/json
DEBUG: content-length: 2
DEBUG: connection: close
DEBUG: x-ops-api-info: flavor=osc;version=11.0.2;erchef=1.2.6
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: Content-Length validated correctly.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
Uploading learn_chef_apache2 [0.1.0]
INFO: Validating ruby files
DEBUG: Ruby file /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/recipes/default.rb is unchanged, skipping syntax c
heck
DEBUG: Ruby file /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/metadata.rb is unchanged, skipping syntax check
INFO: Validating templates
DEBUG: Template /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/templates/default/index.html.erb is unchanged, skip
ping syntax check
INFO: Syntax OK
INFO: Saving learn_chef_apache2
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as vagrant
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating POST to https://not.the-real-domain.com/sandboxes
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Content-Type: application/json
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: vagrant
DEBUG: X-OPS-TIMESTAMP: 2015-01-07T11:35:53Z
DEBUG: X-OPS-CONTENT-HASH: xYjaWi34AWDo6gXYO1a65njwNcw=
DEBUG: X-OPS-AUTHORIZATION-1: BFq50xm6OxukaZZSPlF5sxlrpXI6G7yC4E1FS/OsPH69taMF/BRjeVNsrStK
DEBUG: X-OPS-AUTHORIZATION-2: xEWNVUN5d5N4htEqH6R/7f/t8eaM9P+iHynQq9HpyOdUuWmgIRe8G2qApiTq
DEBUG: X-OPS-AUTHORIZATION-3: J0e43vAstqWvsJP7I4PeL9GZMI+pkOUAepatKqAP97tDIBQq0ZHCo8yvvzSA
DEBUG: X-OPS-AUTHORIZATION-4: Wte1a271kOhN68IR0tsULLKW0KGbY1gCzfEgSrEOrB4Ss9ZdrO7DSfIcqG5j
DEBUG: X-OPS-AUTHORIZATION-5: QZB4T9xmO0jWclmczn15wKxEUv+6WMPrEw1bTfkZn/0/ppB4O7k8ufG8HSyS
DEBUG: X-OPS-AUTHORIZATION-6: ycogugMx/SuuUp7jCzvFiCC+HFggoMLjdG6SnITxLw==
DEBUG: HOST: not.the-real-domain.com:443
DEBUG: X-REMOTE-REQUEST-ID: ed61a6b3-5f25-478e-b0c6-fb333aa8935b
DEBUG: Content-Length: 335
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 201 Created
DEBUG: server: nginx/1.4.4
DEBUG: date: Wed, 07 Jan 2015 11:35:55 GMT
DEBUG: content-type: application/json
DEBUG: content-length: 2531
DEBUG: connection: close
DEBUG: x-ops-api-info: flavor=osc;version=11.0.2;erchef=1.2.6
DEBUG: location: http://com.dyn-o-saur.intamac:443/sandboxes/0000000000001f65339fd2db4b269962
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: Content-Length validated correctly.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
INFO: Uploading files
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/recipes/default.rb (checksum hex = 7150339bc6d47a03
6e887cd4080b766c) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-7150339bc6d47a036e887
cd4080b766c?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=kMYn1b7CgD3m1wITmhAF7FZ
yr0k%3D
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/templates/default/index.html.erb (checksum hex = 2d
60ab375367b3e2996c7c1803009d55) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-2d60ab3
75367b3e2996c7c1803009d55?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=%2B3AdeCw
YIyuqNW9M8HWS2EIEXtI%3D
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/chefignore (checksum hex = 03485640b005eb1083c76518
764053dd) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-03485640b005eb1083c7651876405
3dd?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=54SOxbd3a0rRJR6FUZCtNc8H3KE%3D
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/README.md (checksum hex = 56f91cb3cc0dc24849e13b4f1
46b8ef1) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-56f91cb3cc0dc24849e13b4f146b8e
f1?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=XFxgWGbGIpn8AqZ81g08c4G%2B%2BXQ%
3D
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/.kitchen.yml (checksum hex = 21af8a09efc20c46755128
6edbc820e0) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-21af8a09efc20c467551286edbc
820e0?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=GW8SfDxyOmipfstkJMKum7AiMjE%3
D
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/Berksfile (checksum hex = a668a1df3121f22875e754466
f535d8a) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-a668a1df3121f22875e754466f535d
8a?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=TBjNUFmzFctRBoqttRdV8jDT5hE%3D
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/metadata.json (checksum hex = 87588008073a5c6362fd8
c90a54523a3) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-87588008073a5c6362fd8c90a5
4523a3?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=7K9u5aUKovKfx6aGZZRcvHat4vc%
3D
INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/metadata.rb (checksum hex = a19f9227a9f5e0eac3885e1
e7d73631d) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-a19f9227a9f5e0eac3885e1e7d73
631d?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=vHBVxiDx4ZUSBpRYHJ6HCIKAUlo%3D

/opt/chef/embedded/lib/ruby/2.1.0/uri/generic.rb:214:in `initialize': the scheme https does not accept registry part: :4
43 (or bad hostname?) (URI::InvalidURIError)
        from /opt/chef/embedded/lib/ruby/2.1.0/uri/http.rb:84:in `initialize'
        from /opt/chef/embedded/lib/ruby/2.1.0/uri/common.rb:214:in `new'
        from /opt/chef/embedded/lib/ruby/2.1.0/uri/common.rb:214:in `parse'
        from /opt/chef/embedded/lib/ruby/2.1.0/uri/common.rb:747:in `parse'
        from /opt/chef/embedded/apps/chef/lib/chef/http.rb:208:in `create_url'
        from /opt/chef/embedded/apps/chef/lib/chef/http.rb:140:in `request'
        from /opt/chef/embedded/apps/chef/lib/chef/http.rb:118:in `put'
        from /opt/chef/embedded/apps/chef/lib/chef/cookbook_uploader.rb:123:in `block in uploader_function_for'
        from /opt/chef/embedded/apps/chef/lib/chef/util/threaded_job_queue.rb:52:in `call'
        from /opt/chef/embedded/apps/chef/lib/chef/util/threaded_job_queue.rb:52:in `block (3 levels) in process'
        from /opt/chef/embedded/apps/chef/lib/chef/util/threaded_job_queue.rb:50:in `loop'
        from /opt/chef/embedded/apps/chef/lib/chef/util/threaded_job_queue.rb:50:in `block (2 levels) in process'
vagrant@precise32:~/chef-repo$ knife -v
Chef: 12.0.3
vagrant@precise32:~/chef-repo$
0
Comment
Question by:ccfcfc
1 Comment
 
LVL 32

Accepted Solution

by:
shalomc earned 500 total points
ID: 40540053
The host name is missing on the last command.
Here is the line causing the error:

INFO: Uploading /home/vagrant/chef-repo/cookbooks/learn_chef_apache2/metadata.rb (checksum hex = a19f9227a9f5e0eac3885e1
e7d73631d) to https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-a19f9227a9f5e0eac3885e1e7d73
631d?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=vHBVxiDx4ZUSBpRYHJ6HCIKAUlo%3D


Specifically, it is trying to upload to this url
 https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-a19f9227a9f5e0eac3885e1e7d73
631d?AWSAccessKeyId=eae6a876cdabef370080a31febade0f0bfaafcb7&Expires=1420631455&Signature=vHBVxiDx4ZUSBpRYHJ6HCIKAUlo%3D

And the url path is
 https://:443/bookshelf/organization-00000000000000000000000000000000/checksum-a19f9227a9f5e0eac3885e1e7d73
631d

As is obvious from the url, the hostname is empty
 https://:443/bookshelf/organizatio............  

I don't know enough chef to say where the misconfiguration is, but I hope that this helps you pin down the error.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When the confidentiality and security of your data is a must, trust the highly encrypted cloud fax portfolio used by 12 million businesses worldwide, including nearly half of the Fortune 500.
Big data transfers via information superhighways require special attention and protection. Learn more about the IT-regulations of the country where your server is located. Analyze cloud providers and their encryption systems for safe data transit. S…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now