Giter Club home page Giter Club logo

Comments (8)

amaltson avatar amaltson commented on July 17, 2024

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.

amaltson avatar amaltson commented on July 17, 2024

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.

bflad avatar bflad commented on July 17, 2024

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"
end

Reply to this email directly or view it on GitHubhttps://github.com//issues/93#issuecomment-37978243
.

from docker.

amaltson avatar amaltson commented on July 17, 2024

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.

amaltson avatar amaltson commented on July 17, 2024

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.

bflad avatar bflad commented on July 17, 2024

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.

amaltson avatar amaltson commented on July 17, 2024

Wow, thanks for looking into it so deeply @bflad. I'll check with the Chef JIRA. Thanks again!

from docker.

bflad avatar bflad commented on July 17, 2024

Sure thing. :) Please let me know if you do wind up opening a ticket.

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.