# Provider not found after chef-client 12.5.1 for custom resource

**URL:** <https://discourse.chef.io/t/provider-not-found-after-chef-client-12-5-1-for-custom-resource/9624>\
**Category:** Chef Infra (archive)\
**Created:** [October 10, 2016, 6:43pm UTC](https://discourse.chef.io/t/provider-not-found-after-chef-client-12-5-1-for-custom-resource/9624 "2016-10-10T18:43:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![markgibbons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/markgibbons/32/1633_2.png) [@markgibbons](https://discourse.chef.io/u/markgibbons)\
**Post date:** [October 10, 2016, 6:43pm UTC](https://discourse.chef.io/t/provider-not-found-after-chef-client-12-5-1-for-custom-resource/9624/1 "2016-10-10T18:43:35Z")

</div>

I’ve got an older cookbook, ips, that provides a resource. The resource definition is in the libraries directory.

require 'chef/resource’  
class Chef  
class Resource  
class IpsPublisher \< Chef::Resource  
def initialize(name, run\_context = nil)  
etc.

The provider definition is in the provider directory in file publisher.rb. It defines load\_current\_resource and a couple actions, nothing special about it.

When I use the ips\_publisher resource, along with chef-client \>= 12.5.1, in a recipe I get

```
       Chef::Exceptions::ProviderNotFound
       ----------------------------------
       Cannot find a provider for ips_publisher[Solaris default with proxy] on solaris2 version 5.11

```

Undocumented breaking change in 12.5.1 maybe? Is there anyway to get the publisher recognized?

Thanks,  
Mark

---

<div class="post-metadata">

**Author:** ![Lamont\_Granquist](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@Lamont\_Granquist](https://discourse.chef.io/u/Lamont_Granquist)\
**Post date:** [October 12, 2016, 10:56pm UTC](https://discourse.chef.io/t/provider-not-found-after-chef-client-12-5-1-for-custom-resource/9624/2 "2016-10-12T22:56:15Z")

</div>

so the error is about not being able to find the provider, but you’ve copypasta’d the resource code.

you should be using `provides :ips_publisher` in both the provider and resource code. in the provider code you can protect that with a `if responds_to?(:provides)` check if you really still need chef-11 compat.

in general library resources and providers are officially discouraged:

[https://docs.chef.io/custom\_resources\_notes.html](https://docs.chef.io/custom_resources_notes.html)

---

<div class="post-metadata">

**Author:** ![markgibbons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/markgibbons/32/1633_2.png) [@markgibbons](https://discourse.chef.io/u/markgibbons)\
**Post date:** [October 19, 2016, 2:21pm UTC](https://discourse.chef.io/t/provider-not-found-after-chef-client-12-5-1-for-custom-resource/9624/3 "2016-10-19T14:21:36Z")

</div>

Thanks. I rewrote the library resource code as a lwrp resource. The rspec tests that depended on the library resource was the only reason for using library code. Rewrote the tests too.
