Chef::异常::从源代码安装nginx-1.4.4时检查总和匹配
我在这里描述了错误: 然而,这种修复方法对我来说并不适用 根据该页面上的建议,我创建了一个shasum:Chef::异常::从源代码安装nginx-1.4.4时检查总和匹配,nginx,chef-infra,checksum,chef-solo,Nginx,Chef Infra,Checksum,Chef Solo,我在这里描述了错误: 然而,这种修复方法对我来说并不适用 根据该页面上的建议,我创建了一个shasum: shasum -a 256 nginx-1.4.4.tar ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3 nginx-1.4.4.tar 然后我打开了这个文件: vi /opt/chef/cookbooks/nginx/recipes/source.rb 我发现了这个街区: re
shasum -a 256 nginx-1.4.4.tar
ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3 nginx-1.4.4.tar
然后我打开了这个文件:
vi /opt/chef/cookbooks/nginx/recipes/source.rb
我发现了这个街区:
remote_file nginx_url do
source nginx_url
checksum node['nginx']['source']['checksum']
path src_filepath
backup false
end
我将其改为:
remote_file nginx_url do
source nginx_url
checksum 'ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3'
path src_filepath
backup false
end
但我仍然得到这个错误:
Recipe: nginx::source
* yum_package[pcre-devel] action install (up to date)
* yum_package[openssl-devel] action install (up to date)
* remote_file[http://nginx.org/download/nginx-1.4.4.tar.gz] action create
================================================================================
Error executing action `create` on resource 'remote_file[http://nginx.org/download/nginx-1.4.4.tar.gz]'
================================================================================
Chef::Exceptions::ChecksumMismatch
----------------------------------
Checksum on resource (ed744d) does not match checksum on content (7c989a)
Resource Declaration:
---------------------
# In /opt/chef/cookbooks/nginx/recipes/source.rb
58: remote_file nginx_url do
59: source nginx_url
60: checksum 'ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3'
61: path src_filepath
62: backup false
63: end
64:
Compiled Resource:
------------------
# Declared in /opt/chef/cookbooks/nginx/recipes/source.rb:58:in `from_file'
remote_file("http://nginx.org/download/nginx-1.4.4.tar.gz") do
provider Chef::Provider::RemoteFile
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
source ["http://nginx.org/download/nginx-1.4.4.tar.gz"]
use_etag true
use_last_modified true
declared_type :remote_file
cookbook_name :nginx
recipe_name "source"
checksum "ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3"
path "/var/chef/cache/nginx-1.4.4.tar.gz"
atomic_update true
end
Running handlers:
[2016-02-16T15:40:44+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-02-16T15:40:44+00:00] ERROR: Exception handlers complete
Chef Client failed. 5 resources updated in 19 seconds
[2016-02-16T15:40:44+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-02-16T15:40:44+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-02-16T15:40:44+00:00] ERROR: remote_file[http://nginx.org/download/nginx-1.4.4.tar.gz] (nginx::source line 58) had an error: Chef::Exceptions::ChecksumMismatch: Checksum on resource (ed744d) does not match checksum on content (7c989a)
[2016-02-16T15:40:44+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
有人有什么建议吗
我在我的本地机器(Mac)上运行这个程序 这听起来像是在上面的评论中解决的,但是对于记录,您需要确保校验和与下载的文件完全一致。在gzip压缩的情况下,这可能会造成混淆。对文件运行sha256sum命令,并将输出用作校验和。似乎您正在使用md5或sha1哈希算法作为校验和奇怪。。您确定您的
shasum
可执行文件按预期接受-a
参数吗?我得到执行的7C989A58E5408C9593DA0BEBCD0E4FFC3D892D1316BA5042DB0BE5B0B4102B9
作为curl的结果http://nginx.org/download/nginx-1.4.4.tar.gz |shasum-一个256-
远程文件[http://nginx.org/download/nginx-1.4.4.tar.gz]action create
似乎您正在下载一个.tar.gz
,而不是您选中的.tar
。@Tensibai--很好point@StephenKing--我硬编码为“7C989A58E5408C9593DA0BEBCD0E4FFC3D892D1316BA5042DB0BE5B0B4102B9”,这使我通过了那个错误。非常感谢。现在我在资源“服务[nginx]”上执行操作reload
时出错,Mixlib::ShellOut::ShellCommandFailed我想我可以开始一个新的StackOverflow问题。