【问题标题】:Getting "CRC check failed" when installing python using chef使用 chef 安装 python 时出现“CRC check failed”
【发布时间】:2013-04-10 15:54:23
【问题描述】:

我正在尝试使用 chef-solo 和 vagrant 将石墨安装到 64 位 Lucid VM 上。石墨的依赖项之一是 python,当我尝试配置 VM 时,出现以下错误。我正在使用来自 Opscode (https://github.com/opscode-cookbooks/python) 的标准 python 食谱

我不熟悉 chef 或 python,所以这个错误让我有点难过。任何帮助表示赞赏。

[default] Running provisioner: Vagrant::Provisioners::ChefSolo...
[default] Generating chef JSON and uploading...
[default] Running chef-solo...
stdin: is not a tty
[2013-03-11T00:18:05+01:00] INFO: *** Chef 10.14.2 ***
[2013-03-11T00:18:05+01:00] INFO: Setting the run_list to ["recipe[graphite]"] from JSON
[2013-03-11T00:18:05+01:00] INFO: Run List is [recipe[graphite]]
[2013-03-11T00:18:05+01:00] INFO: Run List expands to [graphite]
[2013-03-11T00:18:05+01:00] INFO: Starting Chef Run for lucid64.hsd1.ca.comcast.net.
[2013-03-11T00:18:05+01:00] INFO: Running start handlers
[2013-03-11T00:18:05+01:00] INFO: Start handlers complete.
[2013-03-11T00:18:06+01:00] WARN: This recipe uses encrypted data bags, which are not supported on Chef Solo - fallback to node attribute.
[2013-03-11T00:18:06+01:00] INFO: Processing package[python] action install (python::package line 40)
[2013-03-11T00:18:06+01:00] INFO: Processing package[python-dev] action install (python::package line 40)
[2013-03-11T00:18:06+01:00] INFO: Processing remote_file[/tmp/vagrant-chef-1/distribute_setup.py] action create (python::pip line 33)
[2013-03-11T00:18:06+01:00] INFO: Processing execute[install-pip] action run (python::pip line 39)

================================================================================
Error executing action `run` on resource 'execute[install-pip]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '127'
---- Begin output of   /usr/bin/python distribute_setup.py --download-base=https://pypi.python.org/packages/source/d/distribute/
  /usr/local/bin/easy_install pip
 ----
STDOUT: Extracting in /tmp/tmphzwy_0
STDERR: Traceback (most recent call last):
  File "distribute_setup.py", line 546, in <module>
    sys.exit(main())
  File "distribute_setup.py", line 543, in main
    return _install(tarball, _build_install_args(options))
  File "distribute_setup.py", line 77, in _install
    _extractall(tar)
  File "distribute_setup.py", line 479, in _extractall
    for tarinfo in members:
  File "/usr/lib/python2.6/tarfile.py", line 2412, in next
    tarinfo = self.tarfile.next()
  File "/usr/lib/python2.6/tarfile.py", line 2314, in next
    self.fileobj.seek(self.offset)
  File "/usr/lib/python2.6/gzip.py", line 382, in seek
    self.read(1024)
  File "/usr/lib/python2.6/gzip.py", line 219, in read
    self._read(readsize)
  File "/usr/lib/python2.6/gzip.py", line 267, in _read
    self._read_eof()
  File "/usr/lib/python2.6/gzip.py", line 304, in _read_eof
    hex(self.crc)))
IOError: CRC check failed 0x94c615b3 != 0x2e611106L
sh: /usr/local/bin/easy_install: not found
---- End output of   /usr/bin/python distribute_setup.py --download-base=https://pypi.python.org/packages/source/d/distribute/
  /usr/local/bin/easy_install pip
 ----
Ran   /usr/bin/python distribute_setup.py --download-base=https://pypi.python.org/packages/source/d/distribute/
  /usr/local/bin/easy_install pip
 returned 127

【问题讨论】:

  • 你安装easy_install了吗?
  • @grc 我想/usr/bin/python distribute_setup.py 正是这样做的。

标签: python chef-infra chef-solo


【解决方案1】:

错误IOError: CRC check failed 0x94c615b3 != 0x2e611106L 表示gzip 模块无法解压下载的.tgz 文件。这可能是由网络问题引起的。

要隔离此问题,请尝试运行命令手动设置分发,即运行vagrant ssh,然后:

/usr/bin/python distribute_setup.py --download-base=https://pypi.python.org/packages/source/d/distribute/

这应该可以帮助您缩小进程在distribute_setup.py 文件中出错的位置。如果distribute_setup.py 失败,那么您可以检查它下载的distribute-X.Y.Z.tar.gz 文件以查看它是否与https://pypi.python.org/packages/source/d/distribute/ 中的文件匹配(获取两个文件的md5sum 以验证它们是否相同)。如果它们相同,我会尝试提取刚刚手动下载的 .tgz 以查看它是否有效;我想可以想象网站上的其中一个文件已损坏,尽管这似乎不太可能。

如果此时解决方案不是很明显,请使用这些额外的诊断更新您的问题,我们将看看可以做哪些进一步的挖掘。

【讨论】:

    猜你喜欢
    • 2014-01-05
    • 2017-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-09
    • 2014-05-07
    • 1970-01-01
    相关资源
    最近更新 更多