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

Support for yum 'virtual provider', specifically 'mysql' on RHEL 7 #2109

Closed
yvovandoorn opened this issue Sep 23, 2014 · 3 comments
Closed
Labels
Platform: RHEL-like Type: Bug Does not work as expected.

Comments

@yvovandoorn
Copy link

With RHEL7 MariaDB became the default MySQL package when the 'mysql' package is required. (Reference on work that went on in Fedora -- http://fedoraproject.org/wiki/Features/ReplaceMySQLwithMariaDB).

When executing chef-client with a basic recipe of 'package "mysql"' in local mode, this is the results on RHEL 7.0:

[ec2-user@ip-172-31-14-129 test]$ sudo chef-client -l warn -L /tmp/chef-client-mysqltest-warn.output -z -o mysqltest
[2014-09-23T16:27:16-04:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 11.16.0
resolving cookbooks for run list: ["mysqltest"]
Synchronizing Cookbooks:
  - mysqltest
Compiling Cookbooks...
Converging 1 resources
Recipe: mysqltest::default
  * package[mysql] action install
    * No version specified, and no candidate version available for mysql
    ================================================================================
    Error executing action `install` on resource 'package[mysql]'
    ================================================================================

    Chef::Exceptions::Package
    -------------------------
    No version specified, and no candidate version available for mysql

    Resource Declaration:
    ---------------------
    # In /root/.chef/local-mode-cache/cache/cookbooks/mysqltest/recipes/default.rb

      1: package "mysql"

    Compiled Resource:
    ------------------
    # Declared in /root/.chef/local-mode-cache/cache/cookbooks/mysqltest/recipes/default.rb:1:in `from_file'

    package("mysql") do
      action :install
      retries 0
      retry_delay 2
      guard_interpreter :default
      package_name "mysql"
      timeout 900
      cookbook_name "mysqltest"
      recipe_name "default"
    end


Running handlers:
Running handlers complete
Chef Client failed. 0 resources updated in 8.849940817 seconds

Yum commands showing how 'mysql' is provided:

[ec2-user@ip-172-31-14-129 test]$ sudo yum provides mysql
Loaded plugins: amazon-id, rhui-lb
1:mariadb-5.5.35-3.el7.x86_64 : A community developed branch of MySQL
Repo        : rhui-REGION-rhel-server-releases
Matched from:
Provides    : mysql = 1:5.5.35-3.el7



1:mariadb-5.5.37-1.el7_0.x86_64 : A community developed branch of MySQL
Repo        : rhui-REGION-rhel-server-releases
Matched from:
Provides    : mysql = 1:5.5.37-1.el7_0

It looks like it is resolved via the virtual provider feature in Yum as shown here:

[ec2-user@ip-172-31-14-129 test]$ sudo yum -d 10 install mysql
Not loading "rhnplugin" plugin, as it is disabled
Loading "amazon-id" plugin
Not loading "product-id" plugin, as it is disabled
Loading "rhui-lb" plugin
Not loading "subscription-manager" plugin, as it is disabled
Config time: 0.012
Yum version: 3.4.3
rpmdb time: 0.000
Setting up Package Sacks
mirrorlist: https://rhui2-cds01.us-west-1.aws.ce.redhat.com/pulp/mirror/rhui-client-config/rhel/server/7/x86_64/os
mirrorlist: https://rhui2-cds01.us-west-1.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/7/7Server/x86_64/debug
mirrorlist: https://rhui2-cds01.us-west-1.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/7/7Server/x86_64/os
mirrorlist: https://rhui2-cds01.us-west-1.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/7/7Server/x86_64/source/SRPMS
pkgsack time: 0.250
Checking for virtual provide or file-provide for mysql
Obs Init time: 0.052
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.37-1.el7_0 will be installed
@jblaine
Copy link
Contributor

jblaine commented Sep 23, 2014

Affects mysql community cookbook: sous-chefs/mysql#234

@lamont-granquist
Copy link
Contributor

Quoting from @adamhjk:

Yeah, this is because the yum provider actually uses the internal Yum package cache to determine
availability, and mysql doesn't exist. The right fix is to just patch the mysql cookbook to choose
mariadb on RHEL 7.

The mysql cookbook was actually fixed the other direction by pointing rhel7 at the mysql community packages and installing real mysql onto rhel7 (with a different cookbook supporting mariadb).

Still we should probably support installing virtual packages, though, since a user can type yum -y install mysql on rhel7 and it works, while in chef package "mysql" simply dies. And we have a support problem here in that we simply don't support virtual packages in yum.

@smurawski smurawski added this to the Accepted Minor milestone Apr 29, 2015
@thommay thommay added Type: Bug Does not work as expected. and removed Bug labels Jan 25, 2017
@lamont-granquist
Copy link
Contributor

this is fixed in #6540

@chef chef locked and limited conversation to collaborators Mar 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: RHEL-like Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

8 participants