3
1

More than 3 years have passed since last update.

Vagrantアップデートを乗り越える

Last updated at Posted at 2019-10-21

Vagrantアップデート後は大体いつも面倒くさい事になる気がします。今回もなったので備忘録。

環境

Windows10 Virtualbox Vagrant CentOS7 Docker Docker-compose

症状1: Vagrantが起動しない

Vagrantアップデート後にvagrant up が失敗するようになり以下のエラーメッセージが出る。

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-vbguest (= 0.19.0)'

指示に従ってvagrant plugin repairとかを試してみても解決しないが、プラグイン入れ直し時に

Installed the plugin 'vagrant-vbguest (0.20.0)'!

と出ているのに起動に失敗する際には

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-vbguest (= 0.19.0)'

となるので、どうもどこかで最新と指定の間でバージョンの整合性が取れてないっぽいことがわかる。

対処1: plugins.jsonを直す

調べてみると./.vagrant/plugins.json内で古い方のバージョンを指定してるっぽいのでエディタで開いてバージョンを新しい方のに書き換える。
(ちなみに最初横着して「このファイル無かったら起動時に自動で正しい奴が生成されんじゃね」と思って試したけど普通に駄目だった)

vagrant upして、祈る。
駄目でした。

default: bash: line 4:  3251 Segmentation fault      /usr/local/bin/docker-compose-1.24.1 -f "/vagrant/docker-compose.yml" up -d

\( 'ᾥ' )/ ォァー

ひとまずVagrantfileのdocker-composeでプロビジョニングしてる辺りをコメントアウトしたら起動には成功するようにはなりました。
docker-composeは手動で起動するか。

症状2: docker-composeがセグフォ

>vagrant ssh
$ docker-compose up -d
Segmentation fault

とてもつらい

どうもdocker-composeがおかしいっぽいので入れ直す

$ sudo yum install docker-compose
No package docker-compose available.

(間違えた)

curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
> vagrant reload

→ 成功

:clap:ヤッター!:clap:

3
1
0

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
1