Search code examples
vagrantvirtualboxhomesteadvagrantfile

How can I fix Homestead Vagrant error "Configuring and enabling network interfaces... `await_response_state': Agent pid 3330 (RuntimeError)"


I'm using Laravel 7.x Homestead. Everything had been working fine for years, maybe until around the time I upgraded from 6.x to 7.x (though I'm not sure because I don't frequently try to reload).

Now whenever I run cd /c/code/Homestead/ && vagrant up or cd /c/code/Homestead/ && vagrant reload --provision this happens:

==> vboxHomestead: Machine booted and ready!
==> vboxHomestead: Checking for guest additions in VM...
    vboxHomestead: The guest additions on this VM do not match the installed version of
    vboxHomestead: VirtualBox! In most cases this is fine, but in rare cases it can
    vboxHomestead: prevent things such as shared folders from working properly. If you see
    vboxHomestead: shared folder errors, please make sure the guest additions within the
    vboxHomestead: virtual machine match the version of VirtualBox you have installed on
    vboxHomestead: your host and reload your VM.
    vboxHomestead:
    vboxHomestead: Guest Additions Version: 6.0.0 r127566
    vboxHomestead: VirtualBox Version: 6.1
==> vboxHomestead: Setting hostname...
==> vboxHomestead: Configuring and enabling network interfaces...
C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-scp-1.2.1/lib/net/scp.rb:398:in `await_response_state': Agent pid 3330 (RuntimeError)
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-scp-1.2.1/lib/net/scp.rb:369:in `block (3 levels) in start_command'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/channel.rb:323:in `process'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:250:in `block in ev_preprocess'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:540:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:540:in `each_channel'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:250:in `ev_preprocess'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/event_loop.rb:101:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/event_loop.rb:101:in `ev_preprocess'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/event_loop.rb:29:in `process'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:228:in `process'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:181:in `block in loop'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:181:in `loop'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/session.rb:181:in `loop'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-ssh-5.1.0/lib/net/ssh/connection/channel.rb:272:in `wait'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-scp-1.2.1/lib/net/scp.rb:284:in `upload!'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/plugins/communicators/ssh/communicator.rb:327:in `block (2 levels) in upload'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/plugins/communicators/ssh/communicator.rb:333:in `block in upload'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/plugins/communicators/ssh/communicator.rb:742:in `block in scp_connect'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/plugins/communicators/ssh/communicator.rb:382:in `connect'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/plugins/communicators/ssh/communicator.rb:740:in `scp_connect'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/plugins/communicators/ssh/communicator.rb:303:in `upload'
...

Additionally, trying to destroy the box causes a similar error:

vagrant destroy
==> vboxHomestead: Running action triggers before destroy ...
==> vboxHomestead: Running trigger...
==> vboxHomestead: Backing up mysql database homestead...
==> vboxHomestead: Trigger run failed
C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-scp-1.2.1/lib/net/scp.rb:398:in `await_response_state': Agent pid 4861 (RuntimeError)
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.7/gems/net-scp-1.2.1/lib/net/scp.rb:369:in `block (3 le...

unless and until I comment out backup: true in the Homestead.yaml. Then vagrant destroy works, and then vagrant up works, and I use the machine for a while, and eventually I run into this problem all over again later.

How can I narrow down where the problem is?

I'm using Vagrant 2.2.7, VirtualBox 6.1.4, Homestead v10.5.1, which uses box 'laravel/homestead' version '9.3.0'.


Solution

  • The maintainer of Homestead says:

    We can't guarantee results of vagrant reload --provision and I generally advise against using it unless you're really comfortable with what Vagrant is doing and what your provisioners are doing.