sous-chefs / nginx

Development repository for the nginx cookbook
https://supermarket.chef.io/cookbooks/nginx
Apache License 2.0
553 stars 806 forks source link

zypper_repo is overriding the resource from the client #470

Closed nkovacne closed 5 years ago

nkovacne commented 6 years ago

Cookbook version

8.1.6

Chef-client version

14.5.33

Platform Details

CentOS 7, Ubuntu 14, Ubuntu 16

Scenario:

Trying to converge a cookbook that includes nginx::package, the following deprecation warning is shown:

Resource zypper_repo from a cookbook is overriding the resource from the client. Please upgrade your cookbook or remove the cookbook from your run_list before the next major release of Chef. at 1 location:
 - /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.5.33/lib/chef/log.rb:51:in `caller_location'
 See https://docs.chef.io/deprecations_map_collision.html for further details.

Steps to Reproduce:

  1. Create a platform of any of the above specified operating systems, and include a run list that includes at least the nginx::package recipe.
  2. Converge it in kitchen.

Expected Result:

No warning should be shown

Actual Result:

The deprecation warning is shown. Not sure, but maybe now zypper_repo is a core resource and that's the reason why it warns about the override?

welcomebot commented 6 years ago

Hey There It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you. Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.

If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.

fernandoaleman commented 6 years ago

I am getting the same deprecation warning in a wrapper cookbook.

kpmueller commented 5 years ago

Getting the same deprecation warning here in a wrapper cookbook:

 Resource zypper_repo has been loaded from a cookbook. The resource zypper_repo is now included in Chef and will take precedence over the existing cookbook resource in the next major release of Chef (15.0, April 2019). You may be able to remove this cookbook dependency from your runlist if you do not use other recipes/resources/libraries from the cookbook. Alternatively there may be a newer version of this cookbook without the zypper_repo resource. at 1 location:
    - /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.4.56/lib/chef/log.rb:51:in `caller_location'

nginx is the only thing loading a zypper cookbook according to my Berksfile.lock:

  nginx (8.1.6)
    build-essential (>= 5.0)
    ohai (>= 4.1.0)
    yum-epel (>= 0.0.0)
    zypper (>= 0.0.0)
sabinthomas commented 5 years ago

running into the same issue. zypper is the package repo for SuSe, so if you're not using this (since you're only using CentOS, Ubuntu for platforms), you can comment out the dependency in metadata.rb to get past this issue.

change this

depends 'zypper'

to

# depends 'zypper'

A long term fix would be ideal.

tas50 commented 5 years ago

I've released a new version of this cookbook (9.0), which no longer depends on the zypper cookbook. This does increase the required version of Chef to 13.3, but since that came out Aug 2017 I think it's a fair assumption to make.

kpmueller commented 5 years ago

@tas50 - can confirm this fixes this issue - thank you!

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.