agiledivider / vagrant-hostsupdater

MIT License
1.15k stars 129 forks source link

hosts file not being written to #167

Open moosecodes opened 6 years ago

moosecodes commented 6 years ago

Installed Vagrant Version: 2.1.1

I cannot get my vagrant machine to halt because it errors out during the shutdown procedure when it gets to removing the hosts from the hosts file. The vagrant machine keeps running because of the interruption. The terminal is saying that my user is not in the sudoers file, however, I never had to access the sudoers file to run vagrant in the first place (for the last few years).

When I run vagrant up, I see the plugin reporting that it is writing to the /etc/hosts file (like it always does). However, I cannot access any of my sites because the hosts file was not actually updated. This problem started occurring recently after I updated vagrant from an older version. Is there any way to fix this? I tried using vagrant plugin repair, however, that does not solve the problem either.

This is what the terminal reads:

==> default: [vagrant-hostsupdater] Checking for host entries
==> default: [vagrant-hostsupdater] Writing the following entries to (/etc/hosts)
==> default: [vagrant-hostsupdater]   192.168.50.4  vvv  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  vvv.dev  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  vvv.test  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  vvv.local  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  vvv.localhost  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  local.wordpress.test  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  local.wordpress.dev  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  src.wordpress-develop.test  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  build.wordpress-develop.test  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  src.wordpress-develop.dev  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6
==> default: [vagrant-hostsupdater]   192.168.50.4  build.wordpress-develop.dev  # VAGRANT: 993e46400adbd7881ea0c8d2c23b726e (default) / 45a13e6c-8ef4-4b72-ac6e-539f7d63cae6

This is what my hosts file looks like:

127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost

my current workaround is to copy the output of the hostupdater (above) and modifying the hosts file manually.