简体   繁体   English

使用Chef 13.6.4运行Chef-solo时出错

[英]Error running chef-solo with Chef 13.6.4

I have a cookbook working on Chef 12.6. 我有一本关于Chef 12.6的菜谱。 On testing the code with Chef 13.6.4, i get the following error: 在使用Chef 13.6.4测试代码时,出现以下错误:

[root@utah testcookbook ]# chef-solo -c solo.rb -j install_db.json
Starting Chef Client, version 13.6.4

================================================================================
Error expanding the run_list:
================================================================================

Unexpected Error:
-----------------
Chef::Exceptions::ValidationFailed: Option name's value  does not match regular expression /^[\-[:alnum:]_]+$/

System Info:
------------
chef_version=13.6.4
platform=oracle
platform_version=7.3
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
program_name=chef-solo worker: ppid=4738;start=12:59:27;
executable=/opt/chef/bin/chef-solo


Running handlers:
[2018-05-07T12:59:31-07:00] ERROR: Running exception handlers
[2018-05-07T12:59:31-07:00] ERROR: Running exception handlers
Running handlers complete
[2018-05-07T12:59:31-07:00] ERROR: Exception handlers complete
[2018-05-07T12:59:31-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 04 seconds
[2018-05-07T12:59:31-07:00] FATAL: Stacktrace dumped to /root/chef/cookbooks/testcookbook/local-mode-cache/cache/chef-stacktrace.out
[2018-05-07T12:59:31-07:00] FATAL: Stacktrace dumped to /root/chef/cookbooks/testcookbook/local-mode-cache/cache/chef-stacktrace.out
[2018-05-07T12:59:31-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-07T12:59:31-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-07T12:59:31-07:00] ERROR: Option name's value  does not match regular expression /^[\-[:alnum:]_]+$/
[2018-05-07T12:59:31-07:00] ERROR: Option name's value  does not match regular expression /^[\-[:alnum:]_]+$/
[2018-05-07T12:59:31-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2018-05-07T12:59:31-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Here are the contents of my solo.rb file ( working successfully with Chef 12.6 ): 这是我的solo.rb文件的内容(与Chef 12.6一起成功使用):

[root@utah testdir]# cat solo.rb
cookbook_path '/root/chef/cookbooks'
role_path '/root/chef/cookbooks/testcookbook/roles'
data_bag_path '/root/chef/cookbooks/testcookbook/data_bags'
encrypted_data_bag_secret 
'/root/chef/cookbooks/testcookbook/data_bags/data_bag_key'

check the install_db.json file, you would have incorrectly assigned a recipe name in runlist. 检查install_db.json文件,您将在运行列表中错误地分配了配方名称。

{
 "hostname": {
 "run_list": [ "recipe[recipe_name]" ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM