Chef Berks 安装 (Berkshelf) 连接 Artifactory 存储库超时(法拉第超时/Actor 崩溃)

Chef Berks Install (Berkshelf) Timesout contacting Artifactory repository (Faraday Timeout / Actor Crashed)

Artifactory 5.8.4 专业版

Chef 开发套件 版本:1.1.16

主厨客户端版本:12.17.44

交付 版本:master (83358fb62c0f711c70ad5a81030a6cae4017f103)

berks 版本:5.2.0

厨房版本:1.14.2

在 Artifactory 中,我有这个存储库(虚拟):avirtual-repo

Berks 文件包含:

# 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时,它有时成功(需要时间来获取它在 berks install 过程中找到的说明书和相关说明书版本)和 大多数时候 ,它失败并显示以下超时错误消息.

在 Jenkins 中 成功 运行 berks intsall:我看到了这个:

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

对于 Jenkins 中 berks intstallFAILED 运行:我看到以下错误:

错误信息/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:805:in `gets': 执行过期 ( 法拉第::TimeoutError )

[2019-03-06T10:25:27.447804 #74360] 错误——:Actor 崩溃了!

[2019-03-06T10:25:37.451708 #74360] 错误——:无法在 10 秒内彻底终止所有演员!

失败的完整控制台输出运行:

10:19:12 Resolving cookbook dependencies...
10:19:12 Fetching cookbook index from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo...
10:19:24 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)
10:19:24 Installing apache_commons (0.3.8) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:19:24 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)
10:19:24 Installing automation_library (2.0.7) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:19:24 Installing chef_scripts (1.4.0) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:20:20 Installing dependent_project2 (4.10.20) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:20:21 Installing cots_database (7.1.0) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:20:21 Installing database (7.1.1) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:20:22 Installing db_devops (6.1.701) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:21:19 Installing dependent_project3 (3.3.20) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:21:19 Installing top_level_cookbook_name (0.1.6) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:21:20 Installing global_domains (0.1.1) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:21:20 Installing dependent_project4 (1.1.13) from http://artifactory-server:8181/artifactory/api/chef/avirtual-repo ([opscode] http://artifactory-server:8181/artifactory/api/chef/avirtual-repo/api/v1)
10:25:37 /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:805:in `gets': execution expired (Faraday::TimeoutError)
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:805:in `block in parse_header'
10:25:37    from /opt/chefdk/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:801:in `parse_header'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:784:in `read_header'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:561:in `get_header'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1299:in `do_get_header'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1245:in `do_get_block'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1019:in `block in do_request'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1133:in `protect_keep_alive_disconnected'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1014:in `do_request'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:856:in `request'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/httpclient.rb:36:in `call'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/request/retry.rb:116:in `call'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/ridley-5.1.0/lib/ridley/middleware/follow_redirects.rb:67:in `perform_with_redirection'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/ridley-5.1.0/lib/ridley/middleware/follow_redirects.rb:60:in `call'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/response.rb:8:in `call'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in `build_response'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in `run_request'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:140:in `get'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/community_rest.rb:116:in `find'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/community_rest.rb:100:in `download'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:61:in `try_download'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:35:in `block in download'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:34:in `each'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:34:in `download'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/installer.rb:105:in `install'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
10:25:37    from (celluloid):0:in `remote procedure call'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:92:in `value'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/proxies/sync_proxy.rb:33:in `method_missing'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/proxies/cell_proxy.rb:17:in `_send_'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/pool_manager.rb:41:in `_send_'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/pool_manager.rb:140:in `method_missing'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
10:25:37    from (celluloid):0:in `remote procedure call'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/future.rb:104:in `value'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/future.rb:68:in `value'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/installer.rb:175:in `map'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/installer.rb:175:in `install_from_universe'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/installer.rb:39:in `run'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/berksfile.rb:422:in `install'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/cli.rb:143:in `install'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/cli.rb:52:in `dispatch'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/cli.rb:27:in `execute!'
10:25:37    from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/bin/berks:5:in `<top (required)>'
10:25:37    from /usr/bin/berks:49:in `load'
10:25:37    from /usr/bin/berks:49:in `<main>'
10:25:37 E, [2019-03-06T10:25:27.447804 #74360] ERROR -- : Actor crashed!
10:25:37 Faraday::TimeoutError: execution expired
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:805:in `gets'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:805:in `block in parse_header'
10:25:37    /opt/chefdk/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:801:in `parse_header'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:784:in `read_header'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:561:in `get_header'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1299:in `do_get_header'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1245:in `do_get_block'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1019:in `block in do_request'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1133:in `protect_keep_alive_disconnected'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:1014:in `do_request'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient.rb:856:in `request'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/httpclient.rb:36:in `call'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/request/retry.rb:116:in `call'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/ridley-5.1.0/lib/ridley/middleware/follow_redirects.rb:67:in `perform_with_redirection'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/ridley-5.1.0/lib/ridley/middleware/follow_redirects.rb:60:in `call'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/response.rb:8:in `call'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in `build_response'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in `run_request'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:140:in `get'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/community_rest.rb:116:in `find'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/community_rest.rb:100:in `download'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:61:in `try_download'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:35:in `block in download'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:34:in `each'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/downloader.rb:34:in `download'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/berkshelf-5.2.0/lib/berkshelf/installer.rb:105:in `install'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
10:25:37    /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
10:25:37 E, [2019-03-06T10:25:37.451708 #74360] ERROR -- : Couldn't cleanly terminate all actors in 10 seconds!
10:25:37 
10:25:37 -- OK berks install failed, see console output above. Exiting Gracefully -- Berks Install Failed -- 
10:25:37 

查看 gems .rb 文件的源代码,我看到某处谈到超时限制是 600(秒),但我认为这已经足够了,因为在成功运行,1-3 分钟内一切正常。失败的 运行 需要大约 6-7 分钟,然后通过终止整个单个进程线程最终超时。

一个简单的简单解决方案是重新启动机器上的Artifactory服务。

试试这个解决方案:更改 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

现在,重要的是 berks install 是 运行ning 时,什么可能首先导致这些错误 消息来自源存储库 (Artifactory) 的食谱工件,尤其是在 berks shelf uninstall 之后,即清理 Berks SHELF(缓存区域)。事实证明,如果你 运行 提升 AQL (使用 curl -uU:pass ... -T aql.jsonjfrog rt s ... --spec aql.json (两个 json 文件都有 不同的语法 (jfrog cli --spec aql.json 需要更多外部 {, } 括号) 用于相同的 AQL 搜索),然后您会注意到,该特定 运行 的控制台输出(通过 CLI 或某些自动化)将 NOT return 输出非常快,在某些情况下,它会花费无限的时间。如果您的进程经常 运行 此类 AQL(例如:运行ning 来自不同的运行 个/多个 Jenkins 作业)然后 berks install 可能会间歇性地出现这些错误。

此外,即使您 Control + ^C(杀死或任何其他方式)杀死那个 curl/jfrog 命令行 运行,它也会 Artifactory 中的某些东西 以及可能所有未来的 berks install 运行s 仍然会不断收到这些超时错误,直到 artifactory 服务重启 如此执行将有助于解决 berks 超时问题(目前)。

应该考虑选择以下方法(特别选择后一种而不是第一种):

  1. berks shelf uninstall + berks install(即清理 shelf/cache,然后获取依赖的食谱版本 - 来自给定来源的最新版本:此处为 Artifactory 并更新 berk 的缓存)
  2. berks update + berks install -- 这将使任何 berks cmd 更快(因为你没有清理整个缓存并从头开始重新创建它 - 因为 berks install berks shelf uninstall 之后需要 1-10 分钟以上的时间,具体取决于食谱工件在其他食谱 dependencies/tree/graph 搜索中的编号)。

How to use Artifactory AQL .json[ 上查看此 post =83=] 文件使用 curljfrog cli:

在这里查看 berks update 的工作原理:What exactly does "berks update <cookbook-name>" do?

有关 Berkshelf 的更多信息,请参阅此处:https://docs.chef.io/berkshelf.html

一种可能的解决方案是尝试创建(或修改)~/.berkshelf/config.json 并添加它以查看是否有帮助?

{
  "api": {
    "timeout": 3000
  }
}