你能帮我解决“在资源'服务[mysql-foo]上执行动作错误start
和nil:NilClass的未定义方法`[]'时出错的问题。我安装了最新版本的食谱”MySql “从官方网站上创建简单的食谱,你可以在下面的详细日志中看到。
感谢您对此事的关注。
Creating new client for APP-SRV
Creating new node for APP-SRV
Connecting to 127.0.0.1
127.0.0.1 -----> Existing Chef installation detected
127.0.0.1 Starting the first Chef Client run...
127.0.0.1 Starting Chef Client, version 12.15.19
127.0.0.1 resolving cookbooks for run list: ["mysql"]
127.0.0.1 Synchronizing Cookbooks:
127.0.0.1 - mysql (8.1.1)
127.0.0.1 Installing Cookbook Gems:
127.0.0.1 Compiling Cookbooks...
127.0.0.1 Converging 1 resources
127.0.0.1 Recipe: mysql::default
127.0.0.1 * mysql_service[foo] action create
127.0.0.1 * mysql_server_installation_package[foo] action install
127.0.0.1 * apt_package[mysql-server-5.5] action install (up to date)
127.0.0.1 * apt_package[perl-Sys-Hostname-Long] action nothing (skipped due to action :nothing)
127.0.0.1 * execute[Initial DB setup script] action nothing (skipped due to action :nothing)
127.0.0.1 (up to date)
127.0.0.1 * mysql_service_manager_upstart[foo] action create
127.0.0.1 * group[mysql] action create (up to date)
127.0.0.1 * linux_user[mysql] action create (up to date)
127.0.0.1 * service[mysql] action stop (up to date)
127.0.0.1 * service[mysql] action disable (up to date)
127.0.0.1 * file[/etc/mysql/my.cnf] action delete (up to date)
127.0.0.1 * file[/etc/my.cnf] action delete (up to date)
127.0.0.1 * link[/usr/share/my-default.cnf] action create (skipped due to not_if)
127.0.0.1 * directory[/etc/mysql-foo] action create (up to date)
127.0.0.1 * directory[/etc/mysql-foo/conf.d] action create (up to date)
127.0.0.1 * directory[/run/mysql-foo] action create (up to date)
127.0.0.1 * directory[/var/log/mysql-foo] action create (up to date)
127.0.0.1 * directory[/var/lib/mysql-foo] action create (up to date)
127.0.0.1 * template[/etc/mysql-foo/my.cnf] action create (up to date)
127.0.0.1 * apt_package[apparmor] action install (up to date)
127.0.0.1 * directory[/etc/apparmor.d/local/mysql] action create (up to date)
127.0.0.1 * template[/etc/apparmor.d/local/usr.sbin.mysqld] action create (up to date)
127.0.0.1 * template[/etc/apparmor.d/usr.sbin.mysqld] action create (up to date)
127.0.0.1 * template[/etc/apparmor.d/local/mysql/foo] action create (up to date)
127.0.0.1 * service[foo apparmor] action nothing (skipped due to action :nothing)
127.0.0.1 * bash[foo initial records] action run
127.0.0.1 - execute "bash" "/tmp/chef-script20161110-4682-2n48bo"
127.0.0.1
127.0.0.1
127.0.0.1 * mysql_service[foo] action start
127.0.0.1 * mysql_service_manager_upstart[foo] action start
127.0.0.1 * template[/usr/sbin/mysql-foo-wait-ready] action create (up to date)
127.0.0.1 * template[/etc/init/mysql-foo.conf] action create (up to date)
127.0.0.1 * service[mysql-foo] action start
127.0.0.1
127.0.0.1 ================================================================================
127.0.0.1 Error executing action `start` on resource 'service[mysql-foo]'
127.0.0.1 ================================================================================
127.0.0.1
127.0.0.1 NoMethodError
127.0.0.1 -------------
127.0.0.1 undefined method `[]' for nil:NilClass
127.0.0.1
127.0.0.1 Resource Declaration:
127.0.0.1 ---------------------
127.0.0.1 # In /var/chef/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb
127.0.0.1
127.0.0.1 42: service mysql_name do
127.0.0.1 43: provider Chef::Provider::Service::Upstart
127.0.0.1 44: supports status: true
127.0.0.1 45: action [:start]
127.0.0.1 46: end
127.0.0.1 47: end
127.0.0.1
127.0.0.1 Compiled Resource:
127.0.0.1 ------------------
127.0.0.1 # Declared in /var/chef/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb:42:in `block
in <class:MysqlServiceManagerUpstart>'
127.0.0.1
127.0.0.1 service("mysql-foo") do
127.0.0.1 provider Chef::Provider::Service::Upstart
127.0.0.1 action [:start]
127.0.0.1 supports {:status=>true}
127.0.0.1 retries 0
127.0.0.1 retry_delay 2
127.0.0.1 default_guard_interpreter :default
127.0.0.1 service_name "mysql-foo"
127.0.0.1 pattern "mysql-foo"
127.0.0.1 declared_type :service
127.0.0.1 cookbook_name "mysql"
127.0.0.1 end
127.0.0.1
127.0.0.1 Platform:
127.0.0.1 ---------
127.0.0.1 i686-linux
127.0.0.1
127.0.0.1
127.0.0.1 ================================================================================
127.0.0.1 Error executing action `start` on resource 'mysql_service_manager_upstart[foo]'
127.0.0.1 ================================================================================
127.0.0.1
127.0.0.1 NoMethodError
127.0.0.1 -------------
127.0.0.1 service[mysql-foo] (/var/chef/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb line 42)
had an error: NoMethodError: undefined method `[]' for nil:NilClass
127.0.0.1
127.0.0.1 Resource Declaration:
127.0.0.1 ---------------------
127.0.0.1 # In /var/chef/cache/cookbooks/mysql/libraries/mysql_service.rb
127.0.0.1
127.0.0.1 50: svc = mysql_service_manager(name, &block)
127.0.0.1 51: when 'sysvinit'
127.0.0.1
127.0.0.1 Compiled Resource:
127.0.0.1 ------------------
127.0.0.1 # Declared in /var/chef/cache/cookbooks/mysql/libraries/mysql_service.rb:50:in `svc_manager'
127.0.0.1
127.0.0.1 mysql_service_manager_upstart("foo") do
127.0.0.1 action [:start]
127.0.0.1 retries 0
127.0.0.1 retry_delay 2
127.0.0.1 default_guard_interpreter :default
127.0.0.1 declared_type :mysql_service_manager
127.0.0.1 cookbook_name "mysql"
127.0.0.1 version "5.5"
127.0.0.1 initial_root_password "vagrant"
127.0.0.1 port "3306"
127.0.0.1 instance "foo"
127.0.0.1 run_user "mysql"
127.0.0.1 run_group "mysql"
127.0.0.1 socket "/run/mysql-foo/mysqld.sock"
127.0.0.1 end
127.0.0.1
127.0.0.1 Platform:
127.0.0.1 ---------
127.0.0.1 i686-linux
127.0.0.1
127.0.0.1
127.0.0.1 ================================================================================
127.0.0.1 Error executing action `start` on resource 'mysql_service[foo]'
127.0.0.1 ================================================================================
127.0.0.1
127.0.0.1 NoMethodError
127.0.0.1 -------------
127.0.0.1 mysql_service_manager_upstart[foo] (/var/chef/cache/cookbooks/mysql/libraries/mysql_service.rb line 50) ha
d an error: NoMethodError: service[mysql-foo] (/var/chef/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.r
b line 42) had an error: NoMethodError: undefined method `[]' for nil:NilClass
127.0.0.1
127.0.0.1 Resource Declaration:
127.0.0.1 ---------------------
127.0.0.1 # In /var/chef/cache/cookbooks/mysql/recipes/default.rb
127.0.0.1
127.0.0.1 1: mysql_service 'foo' do
127.0.0.1 2: version '5.5'
127.0.0.1 3: port '3306'
127.0.0.1 4: initial_root_password 'vagrant'
127.0.0.1 5: action [:create, :start]
127.0.0.1 6: end
127.0.0.1
127.0.0.1
127.0.0.1 Compiled Resource:
127.0.0.1 ------------------
127.0.0.1 # Declared in /var/chef/cache/cookbooks/mysql/recipes/default.rb:1:in `from_file'
127.0.0.1
127.0.0.1 mysql_service("foo") do
127.0.0.1 action [:create, :start]
127.0.0.1 updated true
127.0.0.1 retries 0
127.0.0.1 retry_delay 2
127.0.0.1 default_guard_interpreter :default
127.0.0.1 declared_type :mysql_service
127.0.0.1 cookbook_name "mysql"
127.0.0.1 recipe_name "default"
127.0.0.1 version "5.5"
127.0.0.1 port "3306"
127.0.0.1 initial_root_password "vagrant"
127.0.0.1 install_method "auto"
127.0.0.1 service_manager "auto"
127.0.0.1 end
127.0.0.1
127.0.0.1 Platform:
127.0.0.1 ---------
127.0.0.1 i686-linux
127.0.0.1
127.0.0.1
127.0.0.1 Running handlers:
127.0.0.1 [2016-11-10T11:04:52+03:00] ERROR: Running exception handlers
127.0.0.1 Running handlers complete
127.0.0.1 [2016-11-10T11:04:52+03:00] ERROR: Exception handlers complete
127.0.0.1 Chef Client failed. 3 resources updated in 41 seconds
127.0.0.1 [2016-11-10T11:04:53+03:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
127.0.0.1 [2016-11-10T11:04:53+03:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug re
port
127.0.0.1 [2016-11-10T11:04:53+03:00] ERROR: mysql_service[foo] (mysql::default line 1) had an error: NoMethodError: mys
ql_service_manager_upstart[foo] (/var/chef/cache/cookbooks/mysql/libraries/mysql_service.rb line 50) had an error: NoMet
hodError: service[mysql-foo] (/var/chef/cache/cookbooks/mysql/libraries/mysql_service_manager_upstart.rb line 42) had an
error: NoMethodError: undefined method `[]' for nil:NilClass
127.0.0.1 [2016-11-10T11:04:54+03:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfull
y (exit code 1)