Vagrant: all Vagrant commands crash with " stack level too deep (SystemStackError)"

Created on 20 Mar 2018  ยท  6Comments  ยท  Source: hashicorp/vagrant

The problem existed with Vagrant 2.0.2 and 2.0.3 (Debian 64Bit packages from website)
System: Debian Stretch 64Bit

running all vagrant commands (vagrant help, vagrant status, vagrant halt, ...)
on all vagrantfiles i get the following error:

user@host: vagrant help
/opt/vagrant/embedded/lib/ruby/2.4.0/resolv.rb:111:in `=~': stack level too deep (SystemStackError)
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv.rb:111:in `each_address'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv.rb:94:in `getaddress'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv.rb:45:in `getaddress'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv-replace.rb:12:in `getaddress'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv-replace.rb:34:in `bind'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv.rb:655:in `bind_random_port'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv.rb:755:in `block in initialize'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/resolv.rb:740:in `each'
     ... 2870 levels...
    from /opt/vagrant/embedded/lib/ruby/2.4.0/net/http.rb:1407:in `request'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/net/http.rb:1165:in `get'
    from /opt/vagrant/embedded/gems/2.0.3/gems/hashicorp-checkpoint-0.1.5/lib/checkpoint.rb:91:in `check'
    from /opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/util/checkpoint_client.rb:78:in `block in check'

Example Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "public_network"
end

The command (from version 2.0.2) work shortly before without any problems. The only changes (afair) where updates of the following debian packages:

[UPGRADE] firefox:amd64 58.0.2~linuxmint1+betsy -> 59.0.1~linuxmint2+betsy
[UPGRADE] firefox-esr:amd64 52.7.1esr-1~deb9u1 -> 52.7.2esr-1~deb9u1
[UPGRADE] firefox-esr-l10n-de:amd64 52.7.1esr-1~deb9u1 -> 52.7.2esr-1~deb9u1
[UPGRADE] firefox-l10n-de:amd64 58.0.2~linuxmint1+betsy -> 59.0.1~linuxmint2+betsy
[UPGRADE] libvorbis0a:amd64 1.3.5-4+deb9u1 -> 1.3.5-4+deb9u2
[UPGRADE] libvorbisenc2:amd64 1.3.5-4+deb9u1 -> 1.3.5-4+deb9u2
[UPGRADE] libvorbisfile3:amd64 1.3.5-4+deb9u1 -> 1.3.5-4+deb9u2
[UPGRADE] openjdk-8-jdk:amd64 8u151-b12-1~deb9u1 -> 8u162-b12-1~deb9u1
[UPGRADE] openjdk-8-jdk-headless:amd64 8u151-b12-1~deb9u1 -> 8u162-b12-1~deb9u1
[UPGRADE] openjdk-8-jre:amd64 8u151-b12-1~deb9u1 -> 8u162-b12-1~deb9u1
[UPGRADE] openjdk-8-jre-headless:amd64 8u151-b12-1~deb9u1 -> 8u162-b12-1~deb9u1
[UPGRADE] qownnotes:amd64 18.03.6-1 -> 18.03.7-1
[UPGRADE] skypeforlinux:amd64 8.17.0.2 -> 8.18.0.6
[UPGRADE] vivaldi-snapshot:amd64 1.15.1125.3-1 -> 1.15.1130.3-1

After that update and a system reboot vagrant stopped working with the afformentioned error.

Looking throu the issue tracker one comment in #9563 helped:

user@host:  export VAGRANT_DISABLE_RESOLV_REPLACE=1
user@host:  vagrant help
Usage: vagrant [options]  []

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

Common commands:
     box             manages boxes: installation, removal, etc.
...

Now it works without any problems, even without issuing this export statement....
What does the export statement do?

bug core

Most helpful comment

Confirming the bug, had the same issue and export VAGRANT_DISABLE_RESOLV_REPLACE=1 solved the problem. Hope it helps

All 6 comments

Hi @sseide - do you happen to have a nameserver entry in /etc/resolve.conf that is a hostname and not an IP? Thanks!

Today i had the same problem again after booting up my laptop...
Exporting the env var again I was able to use Vagrant without this SystemStackError again.

my /etc/resolv.conf looks like that:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver fe80::1%enp0s31f6
nameserver 192.168.2.1
search speedport.ip

Booth ip addresses (ipv4 and v6) point to the same router.

Confirming the bug, had the same issue and export VAGRANT_DISABLE_RESOLV_REPLACE=1 solved the problem. Hope it helps

I hit this problem three/four weeks ago, a system restart "magically" solved the issue. Today I faced it again and just discovered this bug report.

In my case, my resolv.conf looks like this:

nameserver fe80::9e97:26ff:fe11:335f%wlp2s0

And my setup:

  • openSUSE Tumbleweed
  • ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux-gnu]
  • Vagrant 2.0.2

export VAGRANT_DISABLE_RESOLV_REPLACE=1 solved the issue for me too, thanks for the workaround :)

Fixed by #9644

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings