# Libraries loaded twice?

**URL:** <https://discourse.chef.io/t/libraries-loaded-twice/4750>\
**Category:** Chef Infra (archive)\
**Created:** [November 26, 2013, 10:08pm UTC](https://discourse.chef.io/t/libraries-loaded-twice/4750 "2013-11-26T22:08:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor\_Serebryany](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/igor_serebryany/32/362_2.png) [@Igor\_Serebryany](https://discourse.chef.io/u/Igor_Serebryany)\
**Post date:** [November 26, 2013, 10:08pm UTC](https://discourse.chef.io/t/libraries-loaded-twice/4750/1 "2013-11-26T22:08:07Z")

</div>

I was under the impression that:

- libraries are only loaded once, when the cookbook is evaluated
- each cookbook is evaluated only once

however, i recently ran into a problem where my library code was running  
twice because:

- my cookbook was both included in a role’s run\_list
- a different cookbook in that run list explicitly depended on that cookbook

this is using chef-solo 11.4.0. is this a bug in chef? or am i missing  
something?

–igor

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [November 26, 2013, 11:43pm UTC](https://discourse.chef.io/t/libraries-loaded-twice/4750/2 "2013-11-26T23:43:31Z")

</div>

I think this is caused by a bug that was fixed in 11.6 or 11.8.

--  
Daniel DeLeo

On Tuesday, November 26, 2013 at 2:08 PM, Igor Serebryany wrote:

> I was under the impression that:
> 
> - libraries are only loaded once, when the cookbook is evaluated
> - each cookbook is evaluated only once
> 
> however, i recently ran into a problem where my library code was running twice because:
> 
> - my cookbook was both included in a role's run\_list
> - a different cookbook in that run list explicitly depended on that cookbook
> 
> this is using chef-solo 11.4.0. is this a bug in chef? or am i missing something?
> 
> --igor
