[chef] Re: Re: Re: What is Chef::HTTP?


Chronological Thread 
  • From: Douglas Garstang < >
  • To: Lamont Granquist < >,
  • Subject: [chef] Re: Re: Re: What is Chef::HTTP?
  • Date: Mon, 10 Mar 2014 12:12:21 -0700

Lamont,

Well, that's strange. I added it, and now I get this...

LoadError
---------
cannot load such file -- chef/http


Cookbook Trace:
---------------
  /tmp/vagrant-chef-1/chef-solo-1/cookbooks/citadel/libraries/s3_file.rb:30:in `<top (required)>'

Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/citadel/libraries/s3_file.rb:

 23:  # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 24:  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 25:  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 26:
 27:  require 'time'
 28:  require 'openssl'
 29:  require 'base64'
 30>> require 'chef/http'
 31:
 32:  class Citadel
 33:    class CitadelError < Exception; end
 34:
 35:    module S3
 36:      extend self
 37:
 38:      def get(bucket, path, aws_access_key_id, aws_secret_access_key, token=nil)
 39:        path = path[1..-1] if path[0] == '/'

Doug.



On Mon, Mar 10, 2014 at 11:52 AM, Lamont Granquist < " target="_blank"> > wrote:

try throwing:

require 'chef/http'

at the top of the library/s3_file.rb file

Otherwise

On Mon Mar 10 11:45:00 2014, Douglas Garstang wrote:
Lamont,

Well, here's my error output from the chef run.

================================================================================
Recipe Compile Error in
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/bc-testbook/recipes/default.rb
================================================================================


NameError
---------
uninitialized constant Chef::HTTP


Cookbook Trace:
---------------

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/citadel/libraries/s3_file.rb:55:in
`get'

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/citadel/libraries/default.rb:44:in
`[]'

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/bc-testbook/recipes/default.rb:19:in
`block in from_file'

/tmp/vagrant-chef-1/chef-solo-1/cookbooks/bc-testbook/recipes/default.rb:15:in
`from_file'


Relevant File Content:
----------------------
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/citadel/libraries/s3_file.rb:

 48:        headers = {
 49:          'date' => now,
 50:          'authorization' => "AWS
#{aws_access_key_id}:#{signed_base64}",
 51:        }
 52:        headers['x-amz-security-token'] = token if token
 53:        puts "BUCKET = #{bucket}"
 54:        begin
 55>>         Chef::HTTP.new("https://#{bucket}.s3.amazonaws.com
<http://s3.amazonaws.com>").get(path, headers)

 56:        rescue Net::HTTPServerException => e
 57:          raise CitadelError, "Unable to download #{path}: #{e}"
 58:        end
 59:      end
 60:
 61:    end
 62:  end
 63:


[2014-03-07T23:56:46+00:00] ERROR: Running exception handlers
[2014-03-07T23:56:46+00:00] ERROR: Exception handlers complete
[2014-03-07T23:56:46+00:00] FATAL: Stacktrace dumped to
/var/chef/cache/chef-stacktrace.out
[2014-03-07T23:56:46+00:00] FATAL:
Chef::Exceptions::ChildConvergeError: Chef run process exited
unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the

It seems that Chef just isn't aware of Chef::HTTP

(prod) dhcp-244-167:~ chef-client --version
Chef: 11.10.4



On Mon, Mar 10, 2014 at 11:40 AM, Lamont Granquist < " target="_blank">
<mailto: " target="_blank"> >> wrote:

    On Mon Mar 10 11:31:27 2014, Douglas Garstang wrote:

        Noah,

        I upgraded to a later (latest) version of Chef.

        (bitcasa-prod) dhcp-244-167:~ chef-client --version
        Chef: 11.10.4

        The problem persisted. I explain to you in IRC that I was
        still seeing
        the error, and I don't believe I saw a reply. If I did, sorry.


    Chef::HTTP is an internal Chef class.  It is definitely present in
    Chef 11.10.4.  Without posting the full text of the error, though,
    there's no way to guess what cookbook you're using or what could
    possibly be wrong.




--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: " target="_blank"> <mailto: " target="_blank"> com>
Cell: +1-805-340-5627





--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: ">
Cell: +1-805-340-5627



Archive powered by MHonArc 2.6.16.

§