Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.2.0 of git cookbook conflicts with mysql cookbook LWRP #198

Closed
schwing opened this issue Apr 16, 2015 · 6 comments
Closed

Version 4.2.0 of git cookbook conflicts with mysql cookbook LWRP #198

schwing opened this issue Apr 16, 2015 · 6 comments

Comments

@schwing
Copy link

schwing commented Apr 16, 2015

Recipe: git::default
  * git_client[default] action install

    ================================================================================
    Error executing action `install` on resource 'git_client[default]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `package_version' for Chef::Resource::AptPackage

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/mysql/libraries/resource_mysql_service.rb:59:in `parsed_package_version'
    /var/chef/cache/cookbooks/git/libraries/provider_git_client_package.rb:16:in `block (2 levels) in <class:Package>'
    /var/chef/cache/cookbooks/git/libraries/provider_git_client_package.rb:14:in `block in <class:Package>'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/git/recipes/default.rb

     19: git_client 'default' do
     20:   action :install
     21: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/git/recipes/default.rb:19:in `from_file'

    git_client("default") do
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :git_client
      cookbook_name "git"
      recipe_name "default"
    end

This is caused by https://github.com/chef-cookbooks/mysql/blob/v5.6.1/libraries/resource_mysql_service.rb#L58-L60
and https://github.com/jssjr/git/blob/4733ad3f574680f900c44eddffb6081ab4ca7106/libraries/helpers.rb#L11-L13 conflicting, from the look of it. Conflicting version 4.2.0 of the git cookbook was released yesterday.

Including the git::default recipe seems overkill just to install the package at https://github.com/rackspace-cookbooks/platformstack/blob/master/recipes/ohai_plugins.rb#L12 and nothing else. This dependency should be removed and replaced with a simple package install, unless there's some pressing reason not to.

@martinb3
Copy link
Contributor

It appears to be a bug of the mysql cookbook, described at sous-chefs/mysql#328 and fixed in sous-chefs/mysql@93d6467.

@martinb3
Copy link
Contributor

It seems like the main point of the upstream git cookbook is to aid in configuring a git server/daemon. I'd be okay with reverting to just using the package resource here. It seems the only interesting logic in the provider is configuring EPEL if the OS is old enough to not have a git package (RHEL/CentOS <= 5).

My one concern is that by ditching the git cookbook, we're just playing whack-a-mole, since the actual defect (helper methods polluting other cookbooks) is from the mysql cookbook. I'd love to see it fixed at the root of the problem.

martinb3 added a commit that referenced this issue Apr 17, 2015
RE: #198, pin back git cookbook while we figure out a longer-term path forward.
@schwing
Copy link
Author

schwing commented Apr 17, 2015

Good catch on EPEL for RHEL/CentOS 5, I completely overlooked that. Agreed that it appears to be fixed in newer versions.

@martinb3
Copy link
Contributor

Looks like they released upstream to give us the fix backported to the versions we're using. sous-chefs/mysql#328

@someara
Copy link

someara commented Apr 17, 2015

PS: The main point of the git cookbook (as far as I'm concerned) is to abstract package names and handle repo activation when needed on various platforms.

https://github.com/jssjr/git/blob/master/libraries/helpers.rb#L3-L9

The service stuff can probably be removed...
I can't imagine anyone is actually using the raw git protocol from xinetd.

The recent refactor was just to shove recipes into resources as a start.

-s

@schwing
Copy link
Author

schwing commented Apr 17, 2015

Thanks all, especially for the additional context and clarification. This was resolved in sous-chefs/mysql#328 and I agree that leaving the git cookbook in is the best option to avoid that package naming weirdness. Closing this out.

@schwing schwing closed this as completed Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants