问题描述
我从 datadog 食谱中创建了一个包装好的食谱,但由于某种原因,repository.rb 食谱失败了。我必须说,如果原始数据狗食谱中的运行厨房效果很好。我真的是 CHEF 的新手,我无法解决这个问题。任何帮助都是极好的。提前致谢:)
kitchen converge dd-agent-ubuntu-1804-14
-----> Starting Test Kitchen (v2.11.2)
$$$$$$ Deprecated configuration detected:
require_chef_omnibus
Run 'kitchen doctor' for details.
-----> Converging <dd-agent-ubuntu-1804-14>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with berkshelf 7.2.0...
Removing non-cookbook files before transfer
Preparing solo.rb
-----> Chef installation detected (14)
Transferring files to <dd-agent-ubuntu-1804-14>
Starting Chef Client,version 14.15.6
resolving cookbooks for run list: ["mycookbook_datadog::default"]
Synchronizing Cookbooks:
- mycookbook_datadog (1.0.1)
- chef_handler (3.0.3)
- datadog (4.0.1)
- yum (6.1.1)
- apt (7.4.0)
Installing Cookbook Gems:
Compiling Cookbooks...
[2021-06-13T11:39:12+00:00] WARN: Resource chef_handler from the client is overriding the resource from a cookbook. Please upgrade your cookbook or remove the cookbook from your run_list.
Recipe: datadog::dd-handler
* chef_gem[chef-handler-datadog] action install (up to date)
* chef_handler[Chef::Handler::Datadog] action enable (skipped due to only_if)
Converging 21 resources
Recipe: datadog::dd-agent
* ruby_block[datadog-api-key-unset] action run (skipped due to only_if)
Recipe: apt::default
* file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing)
* apt_update[periodic] action periodic (up to date)
* execute[apt-get update] action nothing (skipped due to action :nothing)
* execute[apt-get autoremove] action nothing (skipped due to action :nothing)
* execute[apt-get autoclean] action nothing (skipped due to action :nothing)
* directory[/var/cache/local] action create (up to date)
* directory[/var/cache/local/preseeding] action create (up to date)
* template[/etc/apt/apt.conf.d/10dpkg-options] action create (up to date)
* template[/etc/apt/apt.conf.d/10recommends] action create (up to date)
* apt_package[apt-transport-https,gnupg,dirmngr] action install (up to date)
Recipe: datadog::repository
* apt_package[install-apt-transport-https] action install (up to date)
* apt_repository[datadog] action add
================================================================================
Error executing action `add` on resource 'apt_repository[datadog]'
================================================================================
NoMethodError
-------------
undefined method `start_with?' for nil:NilClass
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/datadog/recipes/repository.rb
53: apt_repository 'datadog' do
54: keyserver keyserver
55: key 'A2923DFF56EDA6E76E55E492D3A80E30382E94DE'
56: uri node['datadog']['aptrepo']
57: distribution node['datadog']['aptrepo_dist']
58: components components
59: action :add
60: retries retries
61: end
62:
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/datadog/recipes/repository.rb:53:in `from_file'
apt_repository("datadog") do
action [:add]
default_guard_interpreter :default
declared_type :apt_repository
cookbook_name "datadog"
recipe_name "repository"
keyserver "hkp://keyserver.ubuntu.com:80"
key ["XXXXX"]
uri nil
distribution "stable"
components ["7"]
retries 4
repo_name "datadog"
end
System Info:
------------
chef_version=14.15.6
platform=ubuntu
platform_version=18.04
ruby=ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-linux]
program_name=/opt/chef/bin/chef-solo
executable=/opt/chef/bin/chef-solo
Running handlers:
[2021-06-13T11:39:22+00:00] ERROR: Running exception handlers
Running handlers complete
[2021-06-13T11:39:22+00:00] ERROR: Exception handlers complete
Chef Client Failed. 0 resources updated in 11 seconds
[2021-06-13T11:39:22+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2021-06-13T11:39:22+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2021-06-13T11:39:22+00:00] FATAL: NoMethodError: apt_repository[datadog] (datadog::repository line 53) had an error: NoMethodError: undefined method `start_with?' for nil:NilClass
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions Failed.
>>>>>> Converge Failed on instance <dd-agent-ubuntu-1804-14>. Please see .kitchen/logs/dd-agent-ubuntu-1804-14.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)