OpsWorks Berksfile 处理失败:(Encoding::InvalidByteSequenceError)

OpsWorks Berksfile 处理失败:(Encoding::InvalidByteSequenceError)

几个小时前,我的所有 OpsWorks 堆栈都开始出现故障update_custom_cookbooks。它们都无法“安装 Berksfile 中指定的 cookbook 及其依赖项”,并出现以下错误:在 US-ASCII 上的 `encode': "\xC3" 中(Encoding::InvalidByteSequenceError)

我们的 OpsWorks 堆栈使用 chef 版本 11.10、Berkshelf 版本 3.1.3 和 Ubuntu 14.04 实例。

Berksfile:为了测试目的,我用以下内容替换了我们的正常文件,但仍然出现相同的错误:

source "https://supermarket.getchef.com"

cookbook 'apt'

以下是 OpsWorks 错误日志的一部分:

================================================================================
Error executing action `run` on resource 'ruby_block[Install the cookbooks specified in the Berksfile and their dependencies]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /opt/aws/opsworks/local/bin/berks vendor /opt/aws/opsworks/current/berkshelf-cookbooks ----
STDOUT: Resolving cookbook dependencies...
Fetching cookbook index from https://supermarket.getchef.com...
STDERR: /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/json-1.8.1/lib/json/common.rb:155:in `encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError)
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/json-1.8.1/lib/json/common.rb:155:in `initialize'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/json-1.8.1/lib/json/common.rb:155:in `new'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/json-1.8.1/lib/json/common.rb:155:in `parse'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/ridley-4.0.0/lib/ridley/chef/cookbook/metadata.rb:458:in `from_json'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/ridley-4.0.0/lib/ridley/chef/cookbook/metadata.rb:29:in `from_json'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/ridley-4.0.0/lib/ridley/chef/cookbook.rb:36:in `from_path'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/cached_cookbook.rb:15:in `from_store_path'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/cookbook_store.rb:108:in `block in cookbooks'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/cookbook_store.rb:98:in `collect'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/cookbook_store.rb:98:in `cookbooks'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/resolver/graph.rb:8:in `populate_store'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/resolver.rb:73:in `resolve'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:170:in `install_from_universe'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/installer.rb:39:in `run'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/berksfile.rb:371:in `install'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/berksfile.rb:590:in `vendor'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:387:in `vendor'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:52:in `dispatch'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/lib/berkshelf/cli.rb:27:in `execute!'
from /opt/aws/opsworks/local/lib/ruby/gems/2.0.0/gems/berkshelf-3.1.3/bin/berks:5:in `<top (required)>'
from /opt/aws/opsworks/local/bin/berks:23:in `load'
from /opt/aws/opsworks/local/bin/berks:23:in `<main>'
---- End output of /opt/aws/opsworks/local/bin/berks vendor /opt/aws/opsworks/current/berkshelf-cookbooks ----
Ran /opt/aws/opsworks/local/bin/berks vendor /opt/aws/opsworks/current/berkshelf-cookbooks returned 1

答案1

彼得,这可能是由于编码处理方式/不是:

在此处输入链接描述

相关内容