# Chef recipe failing with a error no candidate version

**URL:** <https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393>\
**Category:** Chef Automate\
**Created:** [September 12, 2016, 4:56pm UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393 "2016-09-12T16:56:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pramod41](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pramod41](https://discourse.chef.io/u/pramod41)\
**Post date:** [September 12, 2016, 4:56pm UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/1 "2016-09-12T16:56:22Z")

</div>

hi,  
i am trying to install jenkins on my node with help of a cookbook.  
when i run chef-client on the node following error occurs all the time.  
error:  
- execute yum update -y

- yum\_package[jenkins] action install

Running handlers:  
[2016-09-12T11:10:47-05:00] ERROR: Running exception handlers  
Running handlers complete  
[2016-09-12T11:10:47-05:00] ERROR: Exception handlers complete  
Chef Client failed. 2 resources updated in 28 seconds  
[2016-09-12T11:10:47-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
[2016-09-12T11:10:47-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report  
[2016-09-12T11:10:47-05:00] ERROR: yum\_package[jenkins] (jenkins::default line 11) had an error: Chef::Exceptions:📦 No candidate version available for jenkins  
[2016-09-12T11:10:47-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

**default.rb**  
execute 'yum update -y’  
package “jenkins” do  
action:install  
end

service “jenkins” do  
action:start  
end

---

<div class="post-metadata">

**Author:** ![nclemons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/nclemons/32/3374_2.png) [@nclemons](https://discourse.chef.io/u/nclemons)\
**Post date:** [September 12, 2016, 5:06pm UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/2 "2016-09-12T17:06:08Z")

</div>

It sounds like it’s unable to find the version you’re trying to install from the repo here: [http://pkg.jenkins-ci.org/redhat/](http://pkg.jenkins-ci.org/redhat/)

You probably want to switch to using a WAR install instead of package, honestly.

Nathan Clemons  
DevOps Engineer  
Moxie Cloud Services (MCS)

O +1.425.467.5075  
M +1.360.861.6291  
E [nclemons@gomoxie.com](mailto:nclemons@gomoxie.com)  
W [www.gomoxie.com](http://www.gomoxie.com)[http://www.gomoxie.com/](http://www.gomoxie.com/)

---

<div class="post-metadata">

**Author:** ![pramod41](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pramod41](https://discourse.chef.io/u/pramod41)\
**Post date:** [September 13, 2016, 8:35pm UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/3 "2016-09-13T20:35:20Z")

</div>

thank you so much for responding.i am a beginner.  
can you suggest me any books or websites where i can learn how to write recipes by following examples.i am tired with this kind of errors.

---

<div class="post-metadata">

**Author:** ![nclemons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/nclemons/32/3374_2.png) [@nclemons](https://discourse.chef.io/u/nclemons)\
**Post date:** [September 14, 2016, 1:12am UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/4 "2016-09-14T01:12:04Z")

</div>

So [https://learn.chef.io/](https://learn.chef.io/) has a lot of good info the last time I checked. I believe there are some Chef books out there, but the last time I looked, many of them were outdated. I’m not sure I have any recommendations available to give at this time, the leanpub ebook that helped me the most is both outdated and I think no longer being published. Others might have some better recommendations.

Happy to help as much as I can, this mailing list has helped me incredibly through the years, along with the IRC/Slack channels. I definitely feel your pain, my Jenkins wrapper cookbook is somewhere around 0.1.110 or so (and only got created a few months back, previous job used Bamboo). Depending on your config, it can definitely get complicated fast. (My biggest issues have been around authentication, especially after I enable the LDAP auth plugin, since it seems to disable the local account I’d created, so I had the IT folks make a new service account in AD just so that it will continue to work after the integration.)

---

<div class="post-metadata">

**Author:** ![pramod41](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pramod41](https://discourse.chef.io/u/pramod41)\
**Post date:** [September 14, 2016, 6:54am UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/5 "2016-09-14T06:54:39Z")

</div>

thank u so much for u r time. appreciate u for sharing u r experience.

---

<div class="post-metadata">

**Author:** ![pmw](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@pmw](https://discourse.chef.io/u/pmw)\
**Post date:** [September 14, 2016, 3:42pm UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/6 "2016-09-14T15:42:06Z")

</div>

I’ve found these two books to be pretty good:  
o Learning Chef ([http://shop.oreilly.com/product/0636920032397.do](http://shop.oreilly.com/product/0636920032397.do))  
o Customizing Chef ([http://shop.oreilly.com/product/0636920032984.do](http://shop.oreilly.com/product/0636920032984.do))

As the names imply, start with Learning Chef.

Paul

---

<div class="post-metadata">

**Author:** ![pramod41](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@pramod41](https://discourse.chef.io/u/pramod41)\
**Post date:** [September 14, 2016, 3:49pm UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/7 "2016-09-14T15:49:13Z")

</div>

these books sounds interesting.i will start with it.thank you so much.

---

<div class="post-metadata">

**Author:** ![som3guy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/som3guy/32/1625_2.png) [@som3guy](https://discourse.chef.io/u/som3guy)\
**Post date:** [September 28, 2016, 12:37am UTC](https://discourse.chef.io/t/chef-recipe-failing-with-a-error-no-candidate-version/9393/8 "2016-09-28T00:37:58Z")

</div>

I am curious, if you have the yum repo setup prior to running this install command.

I am not seeing a version specified, so it leads me to believe you do not have the repo setup or setup correctly.

You can manually run:  
`yum search jenkins`  
or `yum repolist`

The first command will show whether jenkins is available and the second will show how many packages are available in the jenkins repo. (As well as other repos of course.)

I hope that helps.
