Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Unknown
-
Resolution: Fixed
-
Affects Version/s: 10.14.0
-
Fix Version/s: 10.14.0
-
Component/s: Chef Client
-
Labels:
-
Environment:
Ubuntu 10.04 LTS x64
root@server:~# /var/lib/gems/1.8/bin/chef-solo -v
Chef: 10.14.0.rc.0
Description
Hi,
I'm currently testing whyrun on a few cookbooks with Chef 10.14.0.rc.0.
test snippet:
package "multitail" apt_repository "zend" do uri "http://zend.repo.domain.local/zend-server/deb" distribution "server" components ["non-free"] key "http://zend.repo.domain.local/zend-server/zend.key" action :add end package "zendserverce" do package_name "zend-server-ce-php-5.3" end
On this whyrun breaks:
root@server:~# /var/lib/gems/1.8/bin/chef-solo -w -c /bjdev/chef-solo/solo.rb -j /bjdev/chef-solo/node.json-bjtest
[2012-08-28T18:26:09+02:00] WARN: Forcing formatter of 'doc' to capture whyrun output.
Starting Chef Client, version 10.14.0.rc.0
[2012-08-28T18:26:09+02:00] INFO: *** Chef 10.14.0.rc.0 ***
[2012-08-28T18:26:10+02:00] INFO: Setting the run_list to ["recipe[bjtest]"] from JSON
[2012-08-28T18:26:10+02:00] INFO: Run List is [recipe[bjtest]]
[2012-08-28T18:26:10+02:00] INFO: Run List expands to [bjtest]
[2012-08-28T18:26:10+02:00] INFO: Starting Chef Run for server
[2012-08-28T18:26:10+02:00] INFO: Running start handlers
[2012-08-28T18:26:10+02:00] INFO: Start handlers complete.
Compiling Cookbooks...
Converging 3 resources
Recipe: bjtest::default
* package[multitail] action install[2012-08-28T18:26:10+02:00] INFO: Processing package[multitail] action install (bjtest::default line 8)
- Would install version 5.2.2-2 of package multitail
* apt_repository[zend] action add[2012-08-28T18:26:10+02:00] INFO: Processing apt_repository[zend] action add (bjtest::default line 12)
* Whyrun not supported for apt_repository[zend], bypassing load. (Skipped: whyrun not supported by provider Chef::Provider::AptRepository)
(up to date)
* package[zendserverce] action install[2012-08-28T18:26:10+02:00] INFO: Processing package[zendserverce] action install (bjtest::default line 20)
* No version specified, and no candidate version available for zend-server-ce-php-5.3
================================================================================
Error executing action `install` on resource 'package[zendserverce]'
================================================================================
Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for zend-server-ce-php-5.3
Resource Declaration:
---------------------
# In /bjdev/cookbooks/bjtest/recipes/default.rb
19:
20: package "zendserverce" do
21: package_name "zend-server-ce-php-5.3"
22: #notifies :create, "cookbook_file[/usr/local/zend/gui/application/data/zend-server-user.ini]", :immediately
23: end
24:
Compiled Resource:
------------------
# Declared in /bjdev/cookbooks/bjtest/recipes/default.rb:20:in `from_file'
package("zendserverce") do
recipe_name "default"
cookbook_name :bjtest
action :install
retry_delay 2
retries 0
package_name "zend-server-ce-php-5.3"
end
[2012-08-28T18:26:10+02:00] ERROR: Running exception handlers
[2012-08-28T18:26:10+02:00] ERROR: Exception handlers complete
Chef Client failed. 1 resources updated
[2012-08-28T18:26:10+02:00] FATAL: Stacktrace dumped to /bjdev/chef-stacktrace.out
[2012-08-28T18:26:10+02:00] FATAL: Chef::Exceptions::Package: package[zendserverce] (bjtest::default line 20) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for zend-server-ce-php-5.3
root@server:~#
I understand why this breaks, but is this intended or future work ?
package "htop" otherwise assumed to be installed correctly (only because the standard ubuntu apt-repo was already added
and whyrun can find the package via an apt package search) .
I think whyrun should do the same (except the apt package search) with packages that are in an apt-repo that isn't already added/activated.
(assume the apt-repo is correctly added and the package is in the repo and is able to install)
I have many cookbooks which add custom repo's and I think there are also many public cookbooks with custom repo's.
At the moment you can't test this cookbooks with whyrun.
just missing 2 whyrun clauses:
https://github.com/opscode/chef/pull/381