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

undefined method `property_type' for MysqlCookbook::MysqlBase:Class #507

Closed adam-connectfive closed 7 years ago

adam-connectfive commented 7 years ago

Cookbook version

mysql [8.2.0]

Chef-client version

Chef Client, version 12.3.0

Platform Details

Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-62-generic x86_64)

Scenario:

Trying to run "chef-client" configured to install an instance of MySQL

Steps to Reproduce:

Expected Result:

Expecting cookbook to compile

Actual Result:

Cookbook fails to compile:

sudo chef-client
Starting Chef Client, version 12.3.0
Synchronizing Cookbooks:
Compiling Cookbooks...

================================================================================
Recipe Compile Error in /var/cache/chef/cookbooks/mysql/libraries/mysql_base.rb
================================================================================

NoMethodError
-------------
undefined method `property_type' for MysqlCookbook::MysqlBase:Class

Cookbook Trace:
---------------
  /var/cache/chef/cookbooks/mysql/libraries/mysql_base.rb:14:in `<class:MysqlBase>'
  /var/cache/chef/cookbooks/mysql/libraries/mysql_base.rb:2:in `<module:MysqlCookbook>'
  /var/cache/chef/cookbooks/mysql/libraries/mysql_base.rb:1:in `<top (required)>'

Relevant File Content:
----------------------
/var/cache/chef/cookbooks/mysql/libraries/mysql_base.rb:

  7:        true
  8:      end
  9:
 10:      ################
 11:      # Type Constants
 12:      ################
 13:
 14>>     Boolean = property_type(
 15:        is: [true, false],
 16:        default: false
 17:      ) unless defined?(Boolean)
 18:
 19:      ###################
 20:      # Common Properties
 21:      ###################
 22:      property :run_group, String, default: 'mysql', desired_state: false
 23:      property :run_user, String, default: 'mysql', desired_state: false

Running handlers:
Running handlers complete
Chef Client failed. 0 resources updated in 1.320537177 seconds
someara commented 7 years ago

You'll need to upgrade to 12.5 or higher. Alternatively, you could try depending on compat_resource in your cookbook

-s

adam-connectfive commented 7 years ago

Thanks so much for the quick reply. I was just about to reply with the same findings.

Thank you.

For anyone else who may stumble across this: Ubuntu 16.04 doesn't reference a chef client newer than 12.3 (at least as of this posting). Installing the latest chef-client manually did the trick.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.