当使用vagrant 1.8.7 添加box时遇到错误的处理方法

环境

OSX 10.11.6: 苹果操作系统版本10.11.6
Vagrant 1.8.7: Vagrant版本号1.8.7

错误内容 (Mandarin Chinese)

當試圖在盒子中添加bento/CentOS-7.2時出現錯誤。

$ vagrant box add bento/centos-7.2
The box 'bento/centos-7.2' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/bento/centos-7.2"]
Error: 

处理方法

由于Vagrant内部的curl存在问题,所以需要将其删除。
如果原本已经存在curl,则使用原有的curl。

sudo rm -rf /opt/vagrant/embedded/bin/curl

最终的结果

尽管在途中有一段时间运行,但在SSLRead()时发生了错误。

$ vagrant box add bento/centos-7.2
==> box: Loading metadata for box 'bento/centos-7.2'
    box: URL: https://atlas.hashicorp.com/bento/centos-7.2
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) parallels
2) virtualbox
3) vmware_desktop

Enter your choice: 2
==> box: Adding box 'bento/centos-7.2' (v2.3.0) for provider: virtualbox
    box: Downloading: https://atlas.hashicorp.com/bento/boxes/centos-7.2/versions/2.3.0/providers/virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

SSLRead() return error -9806

删除tmp文件中的box…目录。

$ rm -rf ~/.vagrant.d/tmp/box*

再次执行后,下载成功。

$ vagrant box add bento/centos-7.2
==> box: Loading metadata for box 'bento/centos-7.2'
    box: URL: https://atlas.hashicorp.com/bento/centos-7.2
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) parallels
2) virtualbox
3) vmware_desktop

Enter your choice: 2
==> box: Adding box 'bento/centos-7.2' (v2.3.0) for provider: virtualbox
    box: Downloading: https://atlas.hashicorp.com/bento/boxes/centos-7.2/versions/2.3.0/providers/virtualbox.box
==> box: Successfully added box 'bento/centos-7.2' (v2.3.0) for 'virtualbox'!

请参阅

在Vagrant1.8.7版本中,执行box add时出现错误。
无法成功下载vagrant的box文件。

广告
将在 10 秒后关闭
bannerAds