【问题标题】:How see what exactly cookbook were uploaded fail?如何查看上传失败的具体食谱?
【发布时间】:2015-02-13 06:58:04
【问题描述】:
我尝试上传带有依赖项的食谱,这是一个日志:
[root@redhat cookbooks]# knife cookbook upload reference-app --include-dependencies
Uploading my-cookbook [0.1.0]
Uploading maven [1.2.0]
Uploading hipsnip-jetty [0.9.0]
Uploading ark [0.9.0]
Uploading java [1.29.0]
Uploading windows [1.34.8]
Uploading 7-zip [1.0.2]
Uploading chef_handler [1.1.6]
WARNING: Uploaded 8 cookbooks ok but 2 cookbooks upload failed.
都是日志。有没有办法找出哪本食谱完全失败了?
【问题讨论】:
标签:
ruby
chef-infra
chef-recipe
cookbook
【解决方案1】:
使用详细标志会告诉你为什么它没有正确上传。
例如,我在 apt 食谱中添加了一些错误的代码...
[scarman@coldlight cookbooks]$ knife cookbook upload apt --include-dependencies -n -V
Uploading apt [2.6.0]
INFO: Validating ruby files
FATAL: Cookbook file recipes/default.rb has a ruby syntax error:
FATAL: /home/scarman/DevOps/cookbooks/apt/recipes/default.rb:29: `@#' is not allowed as an instance variable name
FATAL: /home/scarman/DevOps/cookbooks/apt/recipes/default.rb:29: syntax error, unexpected end-of-input, expecting '('
FATAL: uha897*@S::@#!!
FATAL: ^
并且还关闭了我的互联网片刻......
[scarman@coldlight cookbooks]$ knife cookbook upload apt --include-dependencies -n -V
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 1/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 2/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 3/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 4/5
ERROR: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all, retry 5/5
ERROR: Network Error: Error connecting to https://api.opscode.com/organizations/cls-chef/cookbooks?num_versions=all - getaddrinfo: Name or service not known
Check your knife configuration and network settings
这有望让您更深入地了解它失败的原因。