LoginSignup
3

More than 5 years have passed since last update.

Windows環境でvagrant up時にEncoding::InvalidByteSequenceErrorが発生する

Last updated at Posted at 2018-04-23

現象

VirtualBoxとVagrantのバージョンを更新したら、以下のエラーが発生するようになりました。

C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/io.rb:32:in `encode': incomplete "\x83" on Windows-31J (Encoding::InvalidByteSequenceError)
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/io.rb:32:in `read_until_block'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/subprocess.rb:182:in `block in execute'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/subprocess.rb:180:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/subprocess.rb:180:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/subprocess.rb:22:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/providers/virtualbox/driver/base.rb:451:in `block in raw'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/providers/virtualbox/driver/base.rb:450:in `raw'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/plugins/providers/virtualbox/driver/base.rb:388:in `block in execute'
        from C:/HashiCorp/Vagrant/embedded/gems/2.1.1/gems/vagrant-2.1.1/lib/vagrant/util/retryable.rb:17:in `retryable'

スナップショット名を確認する

日本語スナップショットを作成していた場合発生するようです。
しかし今回スナップショットを作成していません。

Vagrantファイルにエンコードを明記する

以下をVagrantfileに追記します

# -*- coding: utf-8 -*-

VirtualBoxのバージョンを下げる

最新のVirtualBoxを使っているとVagrant側の対応が追いついていない場合があるそうです。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3