gpt4 book ai didi

Mysql Service Recipe 抛出未定义方法错误

转载 作者:行者123 更新时间:2023-11-29 21:37:05 25 4
gpt4 key购买 nike

我正在尝试使用 Chef mysql recipe但我不断收到错误,undefined method '[]' for nil:NilClass

mysql.rb

mysql_service 'mysql' do
port '3306'
version '5.7.10'
initial_root_password 'SuperSecretPassword'
action [:create, :start]
end

mysql_config 'foo' do
source 'wp-config.php.erb'
notifies :restart, 'mysql_service[mysql]'
action :create
end

错误日志

Recipe: wp::mysql
* mysql_service[mysql] action create

================================================================================
Error executing action `create` on resource 'mysql_service[mysql]'
================================================================================

NoMethodError
-------------
undefined method `[]' for nil:NilClass

Cookbook Trace:
---------------
/root/chef-solo/cookbooks-2/mysql/libraries/helpers.rb:380:in `package_name_for'
/root/chef-solo/cookbooks-2/mysql/libraries/helpers.rb:421:in `server_package'
/root/chef-solo/cookbooks-2/mysql/libraries/helpers.rb:432:in `server_package_name'
/root/chef-solo/cookbooks-2/mysql/libraries/provider_mysql_service_base.rb:31:in `block in <class:MysqlServiceBase>'

Resource Declaration:
---------------------
# In /root/chef-solo/cookbooks-3/wp/recipes/mysql.rb

5: mysql_service 'mysql' do
6: port '3306'
7: version '5.7.10'
8: initial_root_password 'ZH9D3nHE9gm1gFIgKdDC'
9: action [:create, :start]
10: end
11:

Compiled Resource:
------------------
# Declared in /root/chef-solo/cookbooks-3/wp/recipes/mysql.rb:5:in `from_file'

mysql_service("mysql") do
action [:create, :start]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :mysql_service
cookbook_name :wp
recipe_name "mysql"
port "3306"
version "5.7.10"
initial_root_password "ZH9D3nHE9gm1gFIgKdDC"
end


Running handlers:
[2016-01-17T12:04:43-05:00] ERROR: Running exception handlers
Running handlers complete
[2016-01-17T12:04:43-05:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 04 seconds
[2016-01-17T12:04:43-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-01-17T12:04:43-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-01-17T12:04:43-05:00] ERROR: mysql_service[mysql] (wp::mysql line 5) had an error: NoMethodError: undefined method `[]' for nil:NilClass
[2016-01-17T12:04:43-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.

最佳答案

该方法涉及查找当前平台等的包名称。可能意味着您正在尝试使用说明书不支持的操作系统/发行版。

关于Mysql Service Recipe 抛出未定义方法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34841074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com