2013-03-11 89 views
1

我正嘗試使用chef-solo和vagrant將石墨安裝到64位清晰的虛擬機上。石墨的依賴之一是python,當我嘗試配置虛擬機時,我得到下面的錯誤。我使用Opscode的標準蟒食譜(https://github.com/opscode-cookbooks/python當使用廚師安裝python時獲取「CRC check failed」(CRC校驗失敗)

我不熟悉廚師或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 
+0

你安裝了'easy_install'嗎? – grc 2013-03-11 00:22:12

+0

@grc我想'/ usr/bin/python distribute_setup.py'就是這麼做的。 – wRAR 2013-03-11 00:57:21

回答

0

錯誤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以查看它是否有效;我想可以想象,網站上的其中一個文件是腐敗的,儘管這似乎不大可能。

如果在這一點上解決方案沒有立即顯現,請使用這些額外的診斷更新您的問題,我們將看看可以進一步挖掘的內容。