Comments (8)
Looking a little further, it doesn't look like CentOS has 0.8.0 in the EPEL repositories. In fact, CentOS only has 0.8.1.
from docker.
It looks like this still fails when I set to the version explicitly to 0.8.1. It seems that the package installation still fails even when version 0.8.1 exists.
================================================================================
Error executing action `install` on resource 'package[docker-io]'
================================================================================
Chef::Exceptions::Package
-------------------------
Version 0.8.1 of docker-io not found. Did you specify both version and release? (version-release, e.g. 1.84-10.fc6)
Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/docker/recipes/package.rb
5: package 'docker-io' do
6: version node['docker']['version']
7: action node['docker']['package']['action'].intern
8: end
9: when 'debian', 'ubuntu'
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/docker/recipes/package.rb:5:in `from_file'
package("docker-io") do
action [:install]
retries 0
retry_delay 2
package_name "docker-io"
version "0.8.1"
cookbook_name :docker
recipe_name "package"
end
from docker.
I think you need to specify the second half of the package "version" for
the package resource to work. X.Y.Z-RELEASE.ARCH like the error says. I
should be able to test later tonight.
Brian Flad
Sent from mobile
On Mar 18, 2014 3:39 PM, "Arthur Maltson" [email protected] wrote:
It looks like this still fails when I set to the version explicitly to
0.8.1. It seems that the package installation still fails even when version
0.8.1 exists.Error executing action
install
on resource 'package[docker-io]'Chef::Exceptions::Package
Version 0.8.1 of docker-io not found. Did you specify both version and release? (version-release, e.g. 1.84-10.fc6)
Resource Declaration:
In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/docker/recipes/package.rb
5: package 'docker-io' do
6: version node['docker']['version']
7: action node['docker']['package']['action'].intern
8: end
9: when 'debian', 'ubuntu'Compiled Resource:
Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/docker/recipes/package.rb:5:in `from_file'
package("docker-io") do
action [:install]
retries 0
retry_delay 2
package_name "docker-io"
version "0.8.1"
cookbook_name :docker
recipe_name "package"
endReply to this email directly or view it on GitHubhttps://github.com//issues/93#issuecomment-37978243
.
from docker.
Hmm that's strange, I just did $ sudo yum install docker-io-0.8.1
in CentOS and it resolves 0.8.1 fine..
from docker.
I've changed node attribute to ['docker']['version'] = '0.8.1-1.el6'
instead of just 0.8.1
and it worked through the package installation. I'm still confused why the above yum command works..
from docker.
This is a current limitation of the Chef package resource, nothing specific to this cookbook unfortunately.
Important lines above what you posted:
[2014-03-19T05:26:22+00:00] INFO: Processing package[docker-io] action install (docker::package line 5)
[2014-03-19T05:26:25+00:00] DEBUG: package[docker-io] checking yum info for docker-io-0.8.1
[2014-03-19T05:26:25+00:00] DEBUG: package[docker-io] installed version: (none) candidate version: 0.8.1-1.el6
In fact, we can see what Chef knows from yum:
[root@docker-centos-6 ~]# python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.10.4/lib/chef/provider/package/yum-dump.py | grep docker-io
docker-io 0 0.8.1 1.el6 x86_64 [] a epel
why-run shows it has install_version as well:
[2014-03-19T05:40:10+00:00] DEBUG: package[docker-io] checking yum info for docker-io-0.8.1
[2014-03-19T05:40:10+00:00] DEBUG: package[docker-io] installed version: (none) candidate version: 0.8.1-1.el6
- Would install version 0.8.1 of package docker-io
So it certainly knows there's a candidate (and its full candidate_version) available for install. So what gives, Chef?
Stepping through...
# https://github.com/opscode/chef/blob/master/lib/chef/provider/package.rb#L82
install_package('docker-io', '0.8.1')
> # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L1107
> @yum.version_available?('docker-io', '0.8.1', nil)
> # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L833
> version('docker-io', nil, true, false)
> # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L885
> package('docker-io', nil, true, false)
> # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L902
> @rpmdb.available?('docker-io')
> # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L618
> @available.include?('docker-io')
- # which is populated by refresh already and correctly found
- # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L758
< true
< true
< pkg
< # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L888
< pkg.version.to_s # '0.8.1-1.el6'
! # YumCache RPMpackage version is stored in version-release.arch format!
! # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L346
- # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L835
- return true if '0.8.1' == '0.8.1-1.el6'
< # https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L838
< return false
# https://github.com/opscode/chef/blob/master/lib/chef/provider/package/yum.rb#L1136
raise Chef::Exceptions::Package, "Version 0.8.1 of docker-io not found. Did you specify both version " + "and release? (version-release, e.g. 1.84-10.fc6)"
So there you go, when it is caching the state of yum/RPMs, its storing in full version-release.arch syntax and using that for the comparison to what you pass into the version for the package resource. If I was you, I'd check the CHEF tickets in JIRA to see if someone has already complained about this behavior as it does seem less than desirable when using just the version X.Y.Z should theoretically work. I'm wondering if there's edge cases for why it does the comparison the way it does.
from docker.
Wow, thanks for looking into it so deeply @bflad. I'll check with the Chef JIRA. Thanks again!
from docker.
Sure thing. :) Please let me know if you do wind up opening a ticket.
from docker.
Related Issues (20)
- (debian-9, installation-script-main) is no longer a valid test HOT 1
- Changelog weirdness
- Containers with embedded health checks restart on every Chef run
- Logging drivers are out of sync
- Can't stop updates to /lib/systemd/system/docker.service
- README.md is missing resources / broken links
- Setting a version causes a service restart on every run HOT 4
- docker_installation_tarball group is always reset HOT 1
- Wrong source list generation for Debian 11 HOT 8
- Use docker_image resource with build_if_missing action with buildkit
- Invalid filter 'dangling=[docker_image_prune[cleanup]]'
- docker Chef 18 compatibility HOT 7
- docker-ce package name in ubuntu 22.04 is in a different format that affects module 'docker_installation_package' HOT 1
- Can't start a simple container
- Dependency Dashboard
- docker_volume_prune resource
- Unable to use `package_name`-property of the `docker_service`-resource
- PR #1253 is a breaking change. Break on CentOS 7 (Old kernel without cgroup v2)
- ipv6 forwarding prevents the daemon to run when ipv6 is disabled in kernel
- docker_container network_mode "container:*" leads to redeploy on every chef client run
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker.