# Err in apt cookbook

**URL:** <https://discourse.chef.io/t/err-in-apt-cookbook/4079>\
**Category:** Chef Infra (archive)\
**Created:** [June 12, 2013, 10:19am UTC](https://discourse.chef.io/t/err-in-apt-cookbook/4079 "2013-06-12T10:19:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haynes\_Davis](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@Haynes\_Davis](https://discourse.chef.io/u/Haynes_Davis)\
**Post date:** [June 12, 2013, 10:19am UTC](https://discourse.chef.io/t/err-in-apt-cookbook/4079/1 "2013-06-12T10:19:33Z")

</div>

Hi,

I am trying Zenoss cookbook. But while I run chef-client I see below error. Any help appreciated.

[Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/README.md in the cache.  
[Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/CHANGELOG.md in the cache.  
[Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/LICENSE in the cache.

# ================================================================================ Recipe Compile Error in /var/cache/chef/cookbooks/apt/providers/repository.rb

## NameError

undefined local variable or method `use\_inline\_resources’ for #Class:0x7f4f6c94e6d0

## Cookbook Trace:

/var/cache/chef/cookbooks/apt/providers/repository.rb:20:in `class\_from\_file’

## Relevant File Content:

/var/cache/chef/cookbooks/apt/providers/repository.rb:

13: # Unless required by applicable law or agreed to in writing, software  
14: # distributed under the License is distributed on an “AS IS” BASIS,  
15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
16: # See the License for the specific language governing permissions and  
17: # limitations under the License.  
18: #  
19:  
20\>\> use\_inline\_resources  
21:  
22: def whyrun\_supported?  
23: true  
24: end  
25:  
26: # install apt key from keyserver  
27: def install\_key\_from\_keyserver(key, keyserver)  
28: execute “install-key #{key}” do  
29: if !node[‘apt’][‘key\_proxy’].empty?

[Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Running exception handlers  
[Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json  
[Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Exception handlers complete  
[Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out  
[Wed, 12 Jun 2013 10:16:08 +0000] FATAL: NameError: undefined local variable or method `use\_inline\_resources’ for #Class:0x7f4f6c94e6d0

regards,  
Haynes Davis

* * *

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

* * *

[www.accenture.com](http://www.accenture.com)

---

<div class="post-metadata">

**Author:** ![Alex\_Kiernan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/alex_kiernan/32/473_2.png) [@Alex\_Kiernan](https://discourse.chef.io/u/Alex_Kiernan)\
**Post date:** [June 12, 2013, 10:28am UTC](https://discourse.chef.io/t/err-in-apt-cookbook/4079/2 "2013-06-12T10:28:16Z")

</div>

At a guess you're using Chef 10 but the apt cookbook which has been updated  
to use use\_inline\_resources which is new in Chef 11:

[http://docs.opscode.com/breaking\_changes\_chef\_11.html#with-inline-compilation](http://docs.opscode.com/breaking_changes_chef_11.html#with-inline-compilation)

On Wed, Jun 12, 2013 at 11:19 AM, [haynes.davis@accenture.com](mailto:haynes.davis@accenture.com) wrote:

> Hi,\*\*\*\*
> 
> * * *
> 
> * * *
> 
> I am trying Zenoss cookbook. But while I run chef-client I see below  
> error. Any help appreciated.\*\*\*\*
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> cookbooks/openssh/README.md in the cache.\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> cookbooks/openssh/CHANGELOG.md in the cache.\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> cookbooks/openssh/LICENSE in the cache.\*\*\*\*
> 
> * * *
> 
> ================================================================================
> 
> * * *
> 
> Recipe Compile Error in  
> /var/cache/chef/cookbooks/apt/providers/repository.rb\*\*\*\*
> 
> ================================================================================
> 
> * * *
> 
> * * *
> 
> NameError\*\*\*\*
> 
> ---------\*\*\*\*
> 
> undefined local variable or method `use\_inline\_resources' for  
> #Class:0x7f4f6c94e6d0\*\*\*\*
> 
> * * *
> 
> Cookbook Trace:\*\*\*\*
> 
> ---------------\*\*\*\*
> 
> /var/cache/chef/cookbooks/apt/providers/repository.rb:20:in  
> `class\_from\_file'\*\*\*\*
> 
> * * *
> 
> Relevant File Content:\*\*\*\*
> 
> ----------------------\*\*\*\*
> 
> /var/cache/chef/cookbooks/apt/providers/repository.rb:\*\*\*\*
> 
> * * *
> 
> 13: # Unless required by applicable law or agreed to in writing, software
> 
> * * *
> 
> 14: # distributed under the License is distributed on an "AS IS" BASIS,\*\*  
> \*\*
> 
> 15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
> implied.\*\*\*\*
> 
> 16: # See the License for the specific language governing permissions and
> 
> * * *
> 
> 17: # limitations under the License.\*\*\*\*
> 
> 18: #\*\*\*\*
> 
> 19:\*\*\*\*
> 
> 20\>\> use\_inline\_resources\*\*\*\*
> 
> 21:\*\*\*\*
> 
> 22: def whyrun\_supported?\*\*\*\*
> 
> 23: true\*\*\*\*
> 
> 24: end\*\*\*\*
> 
> 25:\*\*\*\*
> 
> 26: # install apt key from keyserver\*\*\*\*
> 
> 27: def install\_key\_from\_keyserver(key, keyserver)\*\*\*\*
> 
> 28: execute "install-key #{key}" do\*\*\*\*
> 
> 29: if !node['apt']['key\_proxy'].empty?\*\*\*\*
> 
> * * *
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Running exception handlers\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Saving node information to  
> /var/cache/chef/failed-run-data.json\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Exception handlers complete\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Stacktrace dumped to  
> /var/cache/chef/chef-stacktrace.out\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: NameError: undefined local  
> variable or method `use\_inline\_resources' for #Class:0x7f4f6c94e6d0\*\*\*\*
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> regards,\*\*\*\*
> 
> Haynes Davis\*\*\*\*
> 
> * * *
> 
> * * *
> 
> This message is for the designated recipient only and may contain  
> privileged, proprietary, or otherwise confidential information. If you have  
> received it in error, please notify the sender immediately and delete the  
> original. Any other use of the e-mail by you is prohibited.
> 
> Where allowed by local law, electronic communications with Accenture and  
> its affiliates, including e-mail and instant messaging (including content),  
> may be scanned by our systems for the purposes of information security and  
> assessment of internal compliance with Accenture policy.
> 
> * * *
> 
> [www.accenture.com](http://www.accenture.com)

--  
Alex Kiernan

---

<div class="post-metadata">

**Author:** ![Sam](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/sam/32/518_2.png) [@Sam](https://discourse.chef.io/u/Sam)\
**Post date:** [June 12, 2013, 10:30am UTC](https://discourse.chef.io/t/err-in-apt-cookbook/4079/3 "2013-06-12T10:30:07Z")

</div>

This happened to me too, I'm now pinning it my environments:

cookbook 'apt', '= 1.9.0'

On 12 June 2013 11:28, Alex Kiernan [alex.kiernan@gmail.com](mailto:alex.kiernan@gmail.com) wrote:

> At a guess you're using Chef 10 but the apt cookbook which has been  
> updated to use use\_inline\_resources which is new in Chef 11:
> 
> [http://docs.opscode.com/breaking\_changes\_chef\_11.html#with-inline-compilation](http://docs.opscode.com/breaking_changes_chef_11.html#with-inline-compilation)
> 
> On Wed, Jun 12, 2013 at 11:19 AM, [haynes.davis@accenture.com](mailto:haynes.davis@accenture.com) wrote:
> 
> > Hi,\*\*\*\*
> > 
> > * * *
> > 
> > * * *
> > 
> > I am trying Zenoss cookbook. But while I run chef-client I see below  
> > error. Any help appreciated.\*\*\*\*
> > 
> > * * *
> > 
> > * * *
> > 
> > * * *
> > 
> > * * *
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> > cookbooks/openssh/README.md in the cache.\*\*\*\*
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> > cookbooks/openssh/CHANGELOG.md in the cache.\*\*\*\*
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> > cookbooks/openssh/LICENSE in the cache.\*\*\*\*
> > 
> > * * *
> > 
> > ================================================================================
> > 
> > * * *
> > 
> > Recipe Compile Error in  
> > /var/cache/chef/cookbooks/apt/providers/repository.rb\*\*\*\*
> > 
> > ================================================================================
> > 
> > * * *
> > 
> > * * *
> > 
> > NameError\*\*\*\*
> > 
> > ---------\*\*\*\*
> > 
> > undefined local variable or method `use\_inline\_resources' for  
> > #Class:0x7f4f6c94e6d0\*\*\*\*
> > 
> > * * *
> > 
> > Cookbook Trace:\*\*\*\*
> > 
> > ---------------\*\*\*\*
> > 
> > /var/cache/chef/cookbooks/apt/providers/repository.rb:20:in  
> > `class\_from\_file'\*\*\*\*
> > 
> > * * *
> > 
> > Relevant File Content:\*\*\*\*
> > 
> > ----------------------\*\*\*\*
> > 
> > /var/cache/chef/cookbooks/apt/providers/repository.rb:\*\*\*\*
> > 
> > * * *
> > 
> > 13: # Unless required by applicable law or agreed to in writing, software
> > 
> > * * *
> > 
> > 14: # distributed under the License is distributed on an "AS IS" BASIS,\*
> > 
> > * * *
> > 
> > 15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
> > implied.\*\*\*\*
> > 
> > 16: # See the License for the specific language governing permissions and
> > 
> > * * *
> > 
> > 17: # limitations under the License.\*\*\*\*
> > 
> > 18: #\*\*\*\*
> > 
> > 19:\*\*\*\*
> > 
> > 20\>\> use\_inline\_resources\*\*\*\*
> > 
> > 21:\*\*\*\*
> > 
> > 22: def whyrun\_supported?\*\*\*\*
> > 
> > 23: true\*\*\*\*
> > 
> > 24: end\*\*\*\*
> > 
> > 25:\*\*\*\*
> > 
> > 26: # install apt key from keyserver\*\*\*\*
> > 
> > 27: def install\_key\_from\_keyserver(key, keyserver)\*\*\*\*
> > 
> > 28: execute "install-key #{key}" do\*\*\*\*
> > 
> > 29: if !node['apt']['key\_proxy'].empty?\*\*\*\*
> > 
> > * * *
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Running exception handlers\*\*\*\*
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Saving node information to  
> > /var/cache/chef/failed-run-data.json\*\*\*\*
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Exception handlers complete\*\*\*\*
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Stacktrace dumped to  
> > /var/cache/chef/chef-stacktrace.out\*\*\*\*
> > 
> > [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: NameError: undefined local  
> > variable or method `use\_inline\_resources' for #Class:0x7f4f6c94e6d0\*\*\*\*
> > 
> > * * *
> > 
> > * * *
> > 
> > * * *
> > 
> > * * *
> > 
> > * * *
> > 
> > * * *
> > 
> > regards,\*\*\*\*
> > 
> > Haynes Davis\*\*\*\*
> > 
> > * * *
> > 
> > * * *
> > 
> > This message is for the designated recipient only and may contain  
> > privileged, proprietary, or otherwise confidential information. If you have  
> > received it in error, please notify the sender immediately and delete the  
> > original. Any other use of the e-mail by you is prohibited.
> > 
> > Where allowed by local law, electronic communications with Accenture and  
> > its affiliates, including e-mail and instant messaging (including content),  
> > may be scanned by our systems for the purposes of information security and  
> > assessment of internal compliance with Accenture policy.
> > 
> > * * *
> > 
> > [www.accenture.com](http://www.accenture.com)
> 
> --  
> Alex Kiernan

--

> **[Sam Pikesley on about.me](https://about.me/pikesley)**
>
> I use about.me to show people what matters most to me.

---

<div class="post-metadata">

**Author:** ![Haynes\_Davis](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@Haynes\_Davis](https://discourse.chef.io/u/Haynes_Davis)\
**Post date:** [June 12, 2013, 12:57pm UTC](https://discourse.chef.io/t/err-in-apt-cookbook/4079/4 "2013-06-12T12:57:24Z")

</div>

Thanks.. that helped.. using version 1.10.0 for apt resolved the issue

Thanks all

Haynes.

From: Sam [[mailto:sam.pikesley@gmail.com](mailto:sam.pikesley@gmail.com)]  
Sent: Wednesday, June 12, 2013 4:00 PM  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Subject: [chef] Re: Re: err in apt cookbook

This happened to me too, I'm now pinning it my environments:

cookbook 'apt', '= 1.9.0'

On 12 June 2013 11:28, Alex Kiernan \<[alex.kiernan@gmail.com](mailto:alex.kiernan@gmail.com)[mailto:alex.kiernan@gmail.com](mailto:alex.kiernan@gmail.com)\> wrote:  
At a guess you're using Chef 10 but the apt cookbook which has been updated to use use\_inline\_resources which is new in Chef 11:

[http://docs.opscode.com/breaking\_changes\_chef\_11.html#with-inline-compilation](http://docs.opscode.com/breaking_changes_chef_11.html#with-inline-compilation)

On Wed, Jun 12, 2013 at 11:19 AM, \<[haynes.davis@accenture.com](mailto:haynes.davis@accenture.com)[mailto:haynes.davis@accenture.com](mailto:haynes.davis@accenture.com)\> wrote:  
Hi,

I am trying Zenoss cookbook. But while I run chef-client I see below error. Any help appreciated.

[Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/README.md in the cache.  
[Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/CHANGELOG.md in the cache.  
[Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/LICENSE in the cache.

# ================================================================================ Recipe Compile Error in /var/cache/chef/cookbooks/apt/providers/repository.rb

## NameError

undefined local variable or method `use\_inline\_resources' for #Class:0x7f4f6c94e6d0

## Cookbook Trace:

/var/cache/chef/cookbooks/apt/providers/repository.rb:20:in `class\_from\_file'

## Relevant File Content:

/var/cache/chef/cookbooks/apt/providers/repository.rb:

13: # Unless required by applicable law or agreed to in writing, software  
14: # distributed under the License is distributed on an "AS IS" BASIS,  
15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
16: # See the License for the specific language governing permissions and  
17: # limitations under the License.  
18: #  
19:  
20\>\> use\_inline\_resources  
21:  
22: def whyrun\_supported?  
23: true  
24: end  
25:  
26: # install apt key from keyserver  
27: def install\_key\_from\_keyserver(key, keyserver)  
28: execute "install-key #{key}" do  
29: if !node['apt']['key\_proxy'].empty?

[Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Running exception handlers  
[Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json  
[Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Exception handlers complete  
[Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out  
[Wed, 12 Jun 2013 10:16:08 +0000] FATAL: NameError: undefined local variable or method `use\_inline\_resources' for #Class:0x7f4f6c94e6d0

regards,  
Haynes Davis

* * *

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.

Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

* * *

[www.accenture.com](http://www.accenture.com)[http://www.accenture.com](http://www.accenture.com)

--  
Alex Kiernan

--

> **[Sam Pikesley on about.me](https://about.me/pikesley)**
>
> I use about.me to show people what matters most to me.

---

<div class="post-metadata">

**Author:** ![Guilhem\_Lettron](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/guilhem_lettron/32/37_2.png) [@Guilhem\_Lettron](https://discourse.chef.io/u/Guilhem_Lettron)\
**Post date:** [June 12, 2013, 1:26pm UTC](https://discourse.chef.io/t/err-in-apt-cookbook/4079/5 "2013-06-12T13:26:24Z")

</div>

You can do a pull request like this one:

> <https://github.com/sous-chefs/ark/pull/25>

It can help anyone on \< chef 11 🙂

Guilhem Lettron

On Wed, Jun 12, 2013 at 2:57 PM, [haynes.davis@accenture.com](mailto:haynes.davis@accenture.com) wrote:

> Thanks.. that helped.. using version 1.10.0 for apt resolved the issue\*\*\*  
> \*
> 
> * * *
> 
> Thanks all \*\*\*\*
> 
> * * *
> 
> Haynes.\*\*\*\*
> 
> * * *
> 
> _From:_ Sam [[mailto:sam.pikesley@gmail.com](mailto:sam.pikesley@gmail.com)]  
> _Sent:_ Wednesday, June 12, 2013 4:00 PM  
> _To:_ [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> _Subject:_ [chef] Re: Re: err in apt cookbook\*\*\*\*
> 
> * * *
> 
> This happened to me too, I'm now pinning it my environments:\*\*\*\*
> 
> * * *
> 
> cookbook 'apt', '= 1.9.0'\*\*\*\*
> 
> * * *
> 
> * * *
> 
> On 12 June 2013 11:28, Alex Kiernan [alex.kiernan@gmail.com](mailto:alex.kiernan@gmail.com) wrote:\*\*\*\*
> 
> At a guess you're using Chef 10 but the apt cookbook which has been  
> updated to use use\_inline\_resources which is new in Chef 11:\*\*\*\*
> 
> * * *
> 
> [http://docs.opscode.com/breaking\_changes\_chef\_11.html#with-inline-compilation](http://docs.opscode.com/breaking_changes_chef_11.html#with-inline-compilation)
> 
> * * *
> 
> * * *
> 
> On Wed, Jun 12, 2013 at 11:19 AM, [haynes.davis@accenture.com](mailto:haynes.davis@accenture.com) wrote:\*\*\*\*
> 
> Hi,\*\*\*\*
> 
> * * *
> 
> * * *
> 
> I am trying Zenoss cookbook. But while I run chef-client I see below  
> error. Any help appreciated.\*\*\*\*
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> cookbooks/openssh/README.md in the cache.\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> cookbooks/openssh/CHANGELOG.md in the cache.\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated  
> cookbooks/openssh/LICENSE in the cache.\*\*\*\*
> 
> * * *
> 
> ================================================================================
> 
> * * *
> 
> Recipe Compile Error in  
> /var/cache/chef/cookbooks/apt/providers/repository.rb\*\*\*\*
> 
> ================================================================================
> 
> * * *
> 
> * * *
> 
> NameError\*\*\*\*
> 
> ---------\*\*\*\*
> 
> undefined local variable or method `use\_inline\_resources' for  
> #Class:0x7f4f6c94e6d0\*\*\*\*
> 
> * * *
> 
> Cookbook Trace:\*\*\*\*
> 
> ---------------\*\*\*\*
> 
> /var/cache/chef/cookbooks/apt/providers/repository.rb:20:in  
> `class\_from\_file'\*\*\*\*
> 
> * * *
> 
> Relevant File Content:\*\*\*\*
> 
> ----------------------\*\*\*\*
> 
> /var/cache/chef/cookbooks/apt/providers/repository.rb:\*\*\*\*
> 
> * * *
> 
> 13: # Unless required by applicable law or agreed to in writing, software
> 
> * * *
> 
> 14: # distributed under the License is distributed on an "AS IS" BASIS,\*\*  
> \*\*
> 
> 15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
> implied.\*\*\*\*
> 
> 16: # See the License for the specific language governing permissions and
> 
> * * *
> 
> 17: # limitations under the License.\*\*\*\*
> 
> 18: #\*\*\*\*
> 
> 19:\*\*\*\*
> 
> 20\>\> use\_inline\_resources\*\*\*\*
> 
> 21:\*\*\*\*
> 
> 22: def whyrun\_supported?\*\*\*\*
> 
> 23: true\*\*\*\*
> 
> 24: end\*\*\*\*
> 
> 25:\*\*\*\*
> 
> 26: # install apt key from keyserver\*\*\*\*
> 
> 27: def install\_key\_from\_keyserver(key, keyserver)\*\*\*\*
> 
> 28: execute "install-key #{key}" do\*\*\*\*
> 
> 29: if !node['apt']['key\_proxy'].empty?\*\*\*\*
> 
> * * *
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Running exception handlers\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Saving node information to  
> /var/cache/chef/failed-run-data.json\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Exception handlers complete\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Stacktrace dumped to  
> /var/cache/chef/chef-stacktrace.out\*\*\*\*
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: NameError: undefined local  
> variable or method `use\_inline\_resources' for #Class:0x7f4f6c94e6d0\*\*\*\*
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> * * *
> 
> regards,\*\*\*\*
> 
> Haynes Davis\*\*\*\*
> 
> * * *
> 
> * * *
> 
> * * *
> 
> This message is for the designated recipient only and may contain  
> privileged, proprietary, or otherwise confidential information. If you have  
> received it in error, please notify the sender immediately and delete the  
> original. Any other use of the e-mail by you is prohibited.
> 
> Where allowed by local law, electronic communications with Accenture and  
> its affiliates, including e-mail and instant messaging (including content),  
> may be scanned by our systems for the purposes of information security and  
> assessment of internal compliance with Accenture policy.
> 
> * * *
> 
> [www.accenture.com](http://www.accenture.com)\*\*\*\*
> 
> * * *
> 
> * * *
> 
> --  
> Alex Kiernan \*\*\*\*
> 
> * * *
> 
> * * *
> 
> --  
> [Sam Pikesley | about.me](http://about.me/pikesley) \*\* \*\*

---

<div class="post-metadata">

**Author:** ![Joshua\_Timberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joshua_timberman/32/424_2.png) [@Joshua\_Timberman](https://discourse.chef.io/u/Joshua_Timberman)\
**Post date:** [June 14, 2013, 3:37am UTC](https://discourse.chef.io/t/err-in-apt-cookbook/4079/6 "2013-06-14T03:37:55Z")

</div>

So here's the thing about that. It's "okay" for some things, but not always, and there are potential side effects where the thing you expect doesn't actually work.

`use_inline_resources` was introduced in Chef 11 to fix with the way that resources contained within a LWRP used notifications. It really makes it easier to reason about chaining resource notifications within an LWRP, and one strong reason to upgrade to Chef 11, especially if you use a lot of LWRPs.

In the case of the apt cookbook, it was in part a fix for why-run mode, along with proper notifications within resources in the action block. The version requirements for Chef to use the apt cookbook are clearly defined in the README.

Adding this kind of backwards compatibility to cookbooks means that we either need to do it to every cookbook, accumulating cruft, and possibly confusing behavior (or code paths) for users in the future, or we move forward. Since cookbooks on the community site where they're released don't have an option to have multiple "default" versions (e.g., the version for Chef 10 or Chef 11), it means we have to make a decision moving forward.

Cheers,  
Joshua

On Jun 12, 2013, at 7:26 AM, Guilhem Lettron [guilhem@lettron.fr](mailto:guilhem@lettron.fr) wrote:

> You can do a pull request like this one: [[COOK-3087] use "use\_inline\_resources" only if chef11 and superior by guilhem · Pull Request #25 · sous-chefs/ark · GitHub](https://github.com/opscode-cookbooks/ark/pull/25)
> 
> It can help anyone on \< chef 11 🙂
> 
> Guilhem Lettron
> 
> On Wed, Jun 12, 2013 at 2:57 PM, [haynes.davis@accenture.com](mailto:haynes.davis@accenture.com) wrote:  
> Thanks.. that helped.. using version 1.10.0 for apt resolved the issue
> 
> Thanks all
> 
> Haynes.
> 
> From: Sam [[mailto:sam.pikesley@gmail.com](mailto:sam.pikesley@gmail.com)]  
> Sent: Wednesday, June 12, 2013 4:00 PM  
> To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Re: Re: err in apt cookbook
> 
> This happened to me too, I'm now pinning it my environments:
> 
> cookbook 'apt', '= 1.9.0'
> 
> On 12 June 2013 11:28, Alex Kiernan [alex.kiernan@gmail.com](mailto:alex.kiernan@gmail.com) wrote:
> 
> At a guess you're using Chef 10 but the apt cookbook which has been updated to use use\_inline\_resources which is new in Chef 11:
> 
> [http://docs.opscode.com/breaking\_changes\_chef\_11.html#with-inline-compilation](http://docs.opscode.com/breaking_changes_chef_11.html#with-inline-compilation)
> 
> On Wed, Jun 12, 2013 at 11:19 AM, [haynes.davis@accenture.com](mailto:haynes.davis@accenture.com) wrote:
> 
> Hi,
> 
> I am trying Zenoss cookbook. But while I run chef-client I see below error. Any help appreciated.
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/README.md in the cache.
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/CHANGELOG.md in the cache.
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] INFO: Storing updated cookbooks/openssh/LICENSE in the cache.
> 
> ================================================================================
> 
> Recipe Compile Error in /var/cache/chef/cookbooks/apt/providers/repository.rb
> 
> ================================================================================
> 
> NameError
> 
> * * *
> 
> undefined local variable or method `use\_inline\_resources' for #Class:0x7f4f6c94e6d0
> 
> Cookbook Trace:
> 
> * * *
> 
> /var/cache/chef/cookbooks/apt/providers/repository.rb:20:in `class\_from\_file'
> 
> Relevant File Content:
> 
> * * *
> 
> /var/cache/chef/cookbooks/apt/providers/repository.rb:
> 
> 13: # Unless required by applicable law or agreed to in writing, software
> 
> 14: # distributed under the License is distributed on an "AS IS" BASIS,
> 
> 15: # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> 
> 16: # See the License for the specific language governing permissions and
> 
> 17: # limitations under the License.
> 
> 18: #
> 
> 19:
> 
> 20\>\> use\_inline\_resources
> 
> 21:
> 
> 22: def whyrun\_supported?
> 
> 23: true
> 
> 24: end
> 
> 25:
> 
> 26: # install apt key from keyserver
> 
> 27: def install\_key\_from\_keyserver(key, keyserver)
> 
> 28: execute "install-key #{key}" do
> 
> 29: if !node['apt']['key\_proxy'].empty?
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Running exception handlers
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] ERROR: Exception handlers complete
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out
> 
> [Wed, 12 Jun 2013 10:16:08 +0000] FATAL: NameError: undefined local variable or method `use\_inline\_resources' for #Class:0x7f4f6c94e6d0
> 
> regards,
> 
> Haynes Davis
> 
> This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.
> 
> Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.
> 
> * * *
> 
> [www.accenture.com](http://www.accenture.com)
> 
> --  
> Alex Kiernan
> 
> --  
> [Sam Pikesley | about.me](http://about.me/pikesley)
