[vagrant][mac]failed MSpanList_Insert 0x1e3000 0x170f8379be41 0x0エラーでvagrantが起動しない

投稿者: | 2017年11月16日

macOSをHigh Sierraにアップグレード後、vagrant upすると、起動せずに以下のエラーが出ました。


$ vagrant up
failed MSpanList_Insert 0x1e3000 0x1710f96632db 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x19816b)
	/Users/mitchellh/code/3rdparty/go/src/runtime/panic.go:491 +0xad fp=0x7ffeefbff5c0 sp=0x7ffeefbff590
runtime.MSpanList_Insert(0x1b3988, 0x1e3000)
...

VirtualBoxとVagrantをそれぞれ以下よりダウンロードし、最新に更新します。
(ダウンロードしたファイルをダブルクリックし、実行します。)
[VirtualBox]
https://www.virtualbox.org/wiki/Downloads

[Vagrant]
https://www.vagrantup.com/downloads.html

更新が終わったら、vagrant動作確認します。


$ sudo /usr/local/bin/vagrant
Password:
Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-hostsupdater (> 0)'

プラグインに問題があるようなので、vagrantのホームディレクトリに移動して、言われた通りにプラグインを再インストールします。


$ cd ~/.vagrant.d/

$ vagrant plugin expunge --reinstall

再度動作確認します。今度はうまくいきました。


$ sudo /usr/local/bin/vagrant
Password:
Usage: vagrant [options]  []

    -v, --version                    Print the version and exit.
    -h, --help                       Print this help.

Common commands:
     box             manages boxes: installation, removal, etc.
     connect         connect to a remotely shared Vagrant environment
     destroy         stops and deletes all traces of the vagrant machine
     global-status   outputs status Vagrant environments for this user
     halt            stops the vagrant machine
     help            shows the help for a subcommand
     init            initializes a new Vagrant environment by creating a Vagrantfile
     login           log in to HashiCorp's Vagrant Cloud
     package         packages a running vagrant environment into a box
     plugin          manages plugins: install, uninstall, update, etc.
     port            displays information about guest port mappings
     powershell      connects to machine via powershell remoting
     provision       provisions the vagrant machine
     push            deploys code in this environment to a configured destination
     rdp             connects to machine via RDP
     reload          restarts vagrant machine, loads new Vagrantfile configuration
     resume          resume a suspended vagrant machine
     share           share your Vagrant environment with anyone in the world
     snapshot        manages snapshots: saving, restoring, etc.
     ssh             connects to machine via SSH
     ssh-config      outputs OpenSSH valid configuration to connect to the machine
     status          outputs status of the vagrant machine
     suspend         suspends the machine
     up              starts and provisions the vagrant environment
     validate        validates the Vagrantfile
     version         prints current and latest Vagrant version

For help on any individual command run `vagrant COMMAND -h`

起動したいvagrant配下に移動して、


$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
...

いつものように起動するようになりました。

プロジェクトで忙しい時などは、むやみにmacOSアップデートはしない方がよさそうです。