[chef] Re: Re: Re: Re: Problem While Installing Linux Package with Chef


Chronological Thread 
  • From: Kandarp Desai < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Problem While Installing Linux Package with Chef
  • Date: Mon, 24 Oct 2011 15:37:39 -0700

I used 
package "foo" do
 provider Chef::Providers::Package::Yum
 action :upgrade
end
which solved the problem.

But, now I'm facing same error for iptables recipe. I'm have download iptables recipe from opscode site. 
Just like before, it's been running fine till now. Suddenly, it's throwing me following error:
=============================================================
Mon, 24 Oct 2011 15:14:47 +0000] DEBUG: Re-raising exception: Chef::Exceptions::Override - package[iptables] (iptables::default line 20) had an error: You must override load_current_resource in #<Chef::Provider::Package:0x7f7b8a1a0588>
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/provider.rb:51:in `load_current_resource'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource.rb:416:in `run_action'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:45:in `run_action'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in `converge'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in `each'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in `converge'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:76:in `converge'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:312:in `converge'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:160:in `run'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:192:in `run_application'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:in `loop'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:in `run_application'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application.rb:66:in `run'
  /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/chef-solo:25
  /usr/bin/chef-solo:19:in `load'
  /usr/bin/chef-solo:19
===================================================================

Recipe file is:
==================================================================

#

# Cookbook Name:: iptables

# Recipe:: default

#

# Copyright 2008-2009, Opscode, Inc.

#

# Licensed under the Apache License, Version 2.0 (the "License");

# you may not use this file except in compliance with the License.

# You may obtain a copy of the License at

#

#     http://www.apache.org/licenses/LICENSE-2.0

#

# Unless required by applicable law or agreed to in writing, software

# distributed under the License is distributed on an "AS IS" BASIS,

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

# See the License for the specific language governing permissions and

# limitations under the License.

#


package "iptables" 


execute "rebuild-iptables" do

  command "/usr/sbin/rebuild-iptables"

  action :nothing

end


directory "/etc/iptables.d" do

  action :create

end


cookbook_file "/usr/sbin/rebuild-iptables" do

  source "rebuild-iptables"

  mode 0755

end


iptables_rule "all_established"

iptables_rule "all_icmp"

==============================================

Can you please help ?

Cheers,
KD


On Mon, Oct 24, 2011 at 1:54 PM, Kandarp Desai < "> > wrote:
I'm expecting Chef to use "yum".

I have other machine which is using chef "0.10.0" and the same code works fine on that machine.
The machine which is having this problem is running chef "0.10.4".
Is there any major change between this two versions which could cause this issue?

I don't mind downgrading to 0.10.0 temporarily. Also, I don't want to use manual installation as I have many recipes using 50-60 packages installation.

-KD

On Mon, Oct 24, 2011 at 1:29 PM, AJ Christensen < " target="_blank"> > wrote:
On 25 October 2011 09:10, Kandarp Desai < " target="_blank"> > wrote:
> It's on Oracle Linux 6.1

I don't think anyone has used Chef on Oracle Linux.

What package manager are you expecting Chef to use?

There's no mapping for providers for Oracle linux in the platform hash [0]

You'll have to expliclity tell Chef which provider you'll want to use
for resources, or adjust the platform hash yourself. This is very
heavy stuff. I'd suggesting opening a ticket for Oracle support and
figuring out what you need to complete to make that happen?

https://github.com/opscode/chef/blob/master/chef/lib/chef/platform.rb

In the mean time, you can use something like:

gem_package
yum_package
dpkg_package

And so on. Conversely, you can specify the provider in the package
definition itself:

package "foo" do
 provider Chef::Providers::Package::Yum
 action :upgrade
end

–AJ

> My recipe Code Looks like this:
> =====================
> scope = self
> packages = value_for_platform(
>     ["centos","redhat","fedora"] =>
>         {"default" => ["gcc", "gcc-c++", "openssl-devel", "pcre-devel",
> "zlib-devel"]},
>     "default" => ["gcc", "gcc-c++", "openssl-devel", "pcre-devel",
> "zlib-devel"]
>   )
> packages.each do |dev_pkg|
>   package dev_pkg
> end
> =========================
> Here's the Debug Output:
> ==============================
> Mon, 24 Oct 2011 13:15:39 +0000] ERROR: package[gcc]
> (/opt/hylocal/conf/chef/solo/cookbooks/nginx/recipes/test.rb:10:in
> `from_file') had an error:
> package[gcc] (nginx::test line 10) had an error: You must override
> load_current_resource in #<Chef::Provider::Package:0x7f72880eec80>
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider.rb:51:in
> `load_current_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:436:in
> `run_action'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:45:in
> `run_action'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in
> `each'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection.rb:94:in
> `execute_each_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
> `call'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
> `call_iterator_block'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in
> `step'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in
> `iterate'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in
> `each_with_index'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection.rb:92:in
> `execute_each_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:76:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:312:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:160:in
> `run'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/solo.rb:192:in
> `run_application'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/solo.rb:183:in
> `loop'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/solo.rb:183:in
> `run_application'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application.rb:67:in
> `run'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/chef-solo:25
> /usr/bin/chef-solo:19:in `load'
> /usr/bin/chef-solo:19
> ==================================================
> Thanks.
> -KD
> On Mon, Oct 24, 2011 at 12:56 PM, AJ Christensen < " target="_blank"> > wrote:
>>
>> What platform?
>>
>> Post your recipe code + debug output from Chef.
>>
>> –AJ
>>
>> On 25 October 2011 08:54, Kandarp Desai < " target="_blank"> > wrote:
>> >
>> > Hello,
>> > I've been using chef for a couple of months now.
>> > It's been running fine since yesterday. Suddenly, it started giving me
>> > error
>> > when I Install any linux package.. e.g. when I install gcc package, chef
>> > throws exception: "Chef::Exceptions::Override - package[gcc], You must
>> > override load_current_resource
>> > in #<Chef::Provider::Package:0x7f3eb5e24fa0>"
>> > ..
>> > is this known issue ?
>> > Can someone please help me ?
>> > -KD
>> >
>
>





Archive powered by MHonArc 2.6.16.

§