sous-chefs / mysql

Development repository for the mysql cookbook
https://supermarket.chef.io/cookbooks/mysql
Apache License 2.0
338 stars 690 forks source link

Support Debian 9 (Stretch) #528

Closed olivierlemasle closed 4 years ago

olivierlemasle commented 7 years ago

Starting with Debian 9, published in June 2017, Debian replaces MySQL by MariaDB.

A package mysql-client with version 5.5.999 is still provided, and depends on the meta-package default-mysql-client, which installs MariaDB 10.1.

From Debian 9 release notes:

Users who had mysql-server-5.5 or mysql-server-5.6 will have it removed and replaced by the MariaDB equivalent. Similarly, installing default-mysql-client will install mariadb-client-10.1.

Therefore, this cookbook should:

Any thought?

Cookbook version

8.4.0

Chef-client version

12.19.33

Platform Details

Debian 9 (Stretch)

Scenario:

Install MySQL client using resource mysql_client.

Steps to Reproduce:

On Vagrant box bento/debian-9.0:

mysql_client 'default' do
  action :create
end

Expected Result:

MySQL client installed, or at least MariaDB installed through package default-mysql-client.

Actual Result:

Chef error:

* mysql_client_installation_package[default] action create[2017-07-11T21:54:58+00:00] INFO: Processing mysql_client_installation_package[default] action create (test::database line 15)

  ================================================================================
  Error executing action `create` on resource 'mysql_client_installation_package[default]'
  ================================================================================

  NoMethodError
  -------------
  undefined method `split' for nil:NilClass

  Cookbook Trace:
  ---------------
  /tmp/kitchen/cache/cookbooks/mysql/libraries/helpers.rb:75:in `major_from_full'
  /tmp/kitchen/cache/cookbooks/mysql/libraries/mysql_base.rb:26:in `block in <class:MysqlBase>'
  /tmp/kitchen/cache/cookbooks/mysql/libraries/helpers.rb:87:in `default_client_package_name'
  /tmp/kitchen/cache/cookbooks/mysql/libraries/mysql_client_installation_package.rb:12:in `block in <class:MysqlClientInstallationPackage>'
  /tmp/kitchen/cache/cookbooks/mysql/libraries/mysql_client_installation_package.rb:18:in `block in <class:MysqlClientInstallationPackage>'

  Resource Declaration:
  ---------------------
  # In /tmp/kitchen/cache/cookbooks/test/recipes/database.rb

   15: mysql_client 'default' do
   16:   action :create
   17: end
   18: 

  Compiled Resource:
  ------------------
  # Declared in /tmp/kitchen/cache/cookbooks/test/recipes/database.rb:15:in `from_file'

  mysql_client_installation_package("default") do
    action [:create]
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    declared_type :mysql_client
    cookbook_name "test"
    recipe_name "database"
  end

  Platform:
  ---------
  x86_64-linux

[2017-07-11T21:54:58+00:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2017-07-11T21:54:58+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-07-11T21:54:58+00:00] ERROR: Exception handlers complete
Chef Client failed. 3 resources updated in 19 seconds
[2017-07-11T21:54:58+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2017-07-11T21:54:58+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-07-11T21:54:58+00:00] FATAL: NoMethodError: mysql_client_installation_package[default] (test::database line 15) had an error: NoMethodError: undefined method `split' for nil:NilClass
cactysman commented 7 years ago

Facing the exact same problem. Wasn't able to install mysql like that yet.

tas50 commented 7 years ago

We'd welcome a PR to get this working on Debian 9

olivierlemasle commented 7 years ago

Hi @tas50

Thank you for your answer. Which solution do you prefer for a PR? The first one (use community packages)?

heaven commented 7 years ago

I am getting this error on Ubuntu as well.

kaspergrubbe commented 6 years ago

I am in the same boat as all of you. @tas50 could help @olivierlemasle on how you prefer the PR?

Peneheals commented 6 years ago

I am in the same boat as all of you. @tas50 could help @olivierlemasle on how you prefer the PR?

github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

github-actions[bot] commented 4 years ago

Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.