人工工厂 5.8.4专业版
厨师开发套件版本:1.1.16
首席客户端版本:12.17.44
交付版本:主要版本(83358fb62c0f711c70ad5a81030a6cae4017f103)
berks 版本:5.2.0
厨房版本:1.14.2
在Artifactory,我有一个(虚拟的)存储库: avirtual-repo
Berksfile包含:
# cat Berksfile
# vim: ft=berksfile.ruby:
source "http://artifactory-server:8181/artifactory/api/chef/avirtual-repo"
cookbook "top_level_cookbook_name", ">= 0.0.0"
当我运行berks install
时,它 有时 成功(需要时间来获取在{{1}期间找到的食谱和相关食谱版本}进程)和 大多数情况下 ,它会失败,并显示以下超时错误消息。
在Jenkins中成功berks install
成功运行:我看到了:
berks intsall
在詹金斯(Jenkins)中06:27:39 Resolving cookbook dependencies...
06:27:39 Fetching cookbook index from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo...
06:27:50 Installing active_directory (2.1.16) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
06:27:50 Installing dependent_project1 (3.0.19) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
...
......
....
bunch of more cookbooks are downloaded and it works
the end result is, I see a Berkshelf.lock file as expected in the workspace folder, containing locked versions for the top level cookbooks and its dependent cookbooks
.....
...
06:35:47
06:35:47 -- Next steps - starts here onwards
的失败运行:我看到以下错误:
错误消息: /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:805:在`gets'中:执行到期( 法拉第::超时错误 )
[2019-03-06T10:25:27.447804#74360] 错误-:演员崩溃了!
[2019-03-06T10:25:37.451708#74360] 错误-:无法在10秒内彻底终止所有演员!
失败的完整控制台输出:
berks intstall
查看gems .rb文件的源代码,我看到它在某处谈论超时限制为 600 (秒),但是我认为这足以满足要求,在成功运行期间,一切都在1-3分钟失败的运行大约需要6-7分钟,然后才能终止整个进程进程,从而最终超时。
答案 0 :(得分:0)
一种可能的解决方案是更改gem的源文件并更改其值。保存它,然后重试berks install
来查看。如果需要,请重新启动Chef。
例如:将以下文件中的值更改为包含options
的行和值,例如将 retry 更改为3,将 retry_interval 更改为1或2, open_timeout 设置为60, timeout 设置为60。
# ls -l /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-api-client-3.0.0/lib/berkshelf/api_client/connection.rb
-rw-r--r-- 1 root root 2651 Dec 15 2016 /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-api-client-3.0.0/lib/berkshelf/api_client/connection.rb
[superuser@chefserver ~]
# grep timeout: $_
options = {retries: 3, retry_interval: 0.5, open_timeout: 30, timeout: 30}.merge(options)
[superuser@chefserver ~]
#
以下是相关信息:https://github.com/berkshelf/berkshelf/issues/1287#issuecomment-60674084