【问题标题】: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.

都是日志。有没有办法找出哪本食谱完全失败了?

【问题讨论】:

  • 您可以尝试在命令末尾添加一个-V(大写 v),以获得来自刀的详细输出。在这种情况下,也许可以改进输出以显示失败的上传。 (似乎github 上没有公开票)
  • 我知道它不能回答问题,但我强烈建议使用 Berkshelf 来管理食谱依赖项。它将在管理复杂的依赖树方面做得更好。参见示例:stackoverflow.com/questions/27420956/…

标签: 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

这有望让您更深入地了解它失败的原因。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-01
    • 2014-01-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多