Closed tangor86 closed 3 years ago
So HyperV is a problem as it doesn't set the IP address like the other VM software and when this plugin is executed don't get that, so it is not executed (doesn't happen sometimes like this case). As I am not using Windows I am not able to do a fix for this or find a better way to get that information.
Maybe I should add an alert in the plugin if doesn't detect the IP address and HyperV is used.
you can add some output and provide me steps to apply this change and how to test, I will check on my PC and we will see... it you have idea ofc...
I have no idea about how to get the IP address with hyperv inside vagrant, as I know with this provider is defined after the execution of vagrant...
Maybe @tomjn has some ideas about it?
@Mte90 check for it after as well as before provisioning
I did a new release with the new code from @tomjn :-)
updated plugin but seems no progress, hosts are not updated:
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>vagrant plugin install --local
Vagrant will now install the following plugins to the local project
which have been defined in current Vagrantfile:
vagrant-goodhosts (> 0)
Press ctrl-c to cancel...
Installing the 'vagrant-goodhosts' plugin. This can take a few minutes...
Fetching vagrant-goodhosts-1.0.18.gem
Installed the plugin 'vagrant-goodhosts (1.0.18)'!
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>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: can't activate vagrant-goodhosts-1.0.17, already activated vagrant-goodhosts-1.0.18
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>vagrant plugin repair
Repairing currently installed global plugins. This may take a few minutes...
Installed plugins successfully repaired!
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>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: can't activate vagrant-goodhosts-1.0.17, already activated vagrant-goodhosts-1.0.18
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>vagrant plugin update
Updating installed plugins...
All plugins are up to date.
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>vagrant plugin update
Updating installed plugins...
All plugins are up to date.
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>
C:\Users\EUGENY\vvv-local>vagrant up
__ __ __ __
\ V\ V\ V / v3.7.2 Path:"C:/Users/EUGENY/vvv-local"
\_/\_/\_/ git::stable(92758fd)
Platform: mingw32 windows HyperV-Admin HasWinAdminPriv vagrant-goodhosts vagrant-vbguest monochrome-terminal shared_db_folder_disabled
Vagrant: v2.2.18, hyperv: vn/a
Docs: https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard: http://vvv.test
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
==> default: Verifying Hyper-V is accessible...
==> default: [vagrant-goodhosts] No ip address found for this virtual machine
default: Configuring the VM...
default: Setting VM Enhanced session transport type to disabled/default (VMBus)
Vagrant requires administrator access for pruning SMB shares and
may request access to complete removal of stale shares.
==> default: Starting the machine...
==> default: Waiting for the machine to report its IP address...
default: Timeout: 120 seconds
default: IP: 172.21.57.240
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 172.21.57.240:22
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Preparing SMB shared folders...
default: You will be asked for the username and password to use for the SMB
default: folders shortly. Please use the proper username/password of your
default: account.
default:
default: Username (user[@domain]): taXXXXXXXXXXXXXXXXXX
default: Password (will be hidden):
Vagrant requires administrator access to create SMB shares and
may request access to complete setup of configured shares.
==> default: Setting hostname...
==> default: Mounting SMB shared folders...
default: C:/Users/EUGENY/vvv-local/database/sql => /srv/database
default: C:/Users/EUGENY/vvv-local/config => /srv/config
default: C:/Users/EUGENY/vvv-local/provision => /srv/provision
default: C:/Users/EUGENY/vvv-local/certificates => /srv/certificates
default: C:/Users/EUGENY/vvv-local/log/memcached => /var/log/memcached
default: C:/Users/EUGENY/vvv-local/log/nginx => /var/log/nginx
default: C:/Users/EUGENY/vvv-local/log/php => /var/log/php
default: C:/Users/EUGENY/vvv-local/log/provisioners => /var/log/provisioners
default: C:/Users/EUGENY/vvv-local/www => /srv/www
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running action triggers after up ...
==> default: Running trigger: VVV Post-Up...
default: Running: inline script
default: * Restarting Nginx
default: * Restarting MariaDB
default: * Syncing clocks
default: 11 Oct 16:02:33 ntpdate[3237]: adjust time server 91.189.89.198 offset -0.000610 sec
default:
default: ✧ ▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄ ✧ Thanks for __ __ __ __
default: ✧█▒▒░░░░░░░░░▒▒█ using \ V\ V\ V /
default: ✧ █░░█░░░░░█░░█ ✧ \_/\_/\_/
default: ▄▄ █░░░▀█▀░░░█ ▄▄✧
default: █░░█ ▀▄░░░░░░░▄▀ █░░█ Vagrant Up has finished! Visit http://vvv.test
default: ──────────────────────────────────────────────────────────────────────
C:\Users\EUGENY\vvv-local>
Always add —local to plugin commands, otherwise it was a long shot, you’ll need to manually update IPs going forward as this isn’t a trivial fix. It could be months/years before it’s solved for Hyper-V.
As an aside, Hyper-V isn’t necessary for VVV, if you can get away with disabling hyper-v you should. It’s mainly for people who turn on Hyper-V to use docker, but not all windows docker installs use Hyper-V
Bringing machine 'default' up with 'virtualbox' provider...
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 vvv.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 one.wordpress.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 two.wordpress.test
==> default: [vagrant-goodhosts] Checking for host entries
Traceback (most recent call last):
30: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
29: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `action'
28: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `call'
27: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/environment.rb:614:in `lock'
26: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:215:in `block in action'
25: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:246:in `action_raw'
24: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run'
23: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy'
22: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run'
21: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call'
20: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
19: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/delayed.rb:19:in `call'
18: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
17: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
16: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
15: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/call.rb:43:in `call'
14: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run'
13: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy'
12: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run'
11: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call'
10: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
9: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/created.rb:15:in `call'
8: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
7: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/commands/up/middleware/store_box_metadata.rb:33:in `call'
6: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
5: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/Action/BaseAction.rb:31:in `call'
4: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/Action/UpdateHosts.rb:7:in `run'
3: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:105:in `addHostEntries'
2: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:105:in `each'
1: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:112:in `block in addHostEntries'
C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:128:in `check_hostnames_to_add': undefined method `each' for "vvv.test one.wordpress.test two.wordpress.test":String (NoMethodError)
holy smokes! works under virtualbox without any issues! just needed to force 1.0.17 version of this plugin... in the hosts file adds all hosts in one line: 192.168.50.4 vvv.test one.wordpress.test two.wordpress.test mysite.test
P.S: and also performance of the website seems to be better, faster loading...
and also doesn't ask for password!
Bringing machine 'default' up with 'virtualbox' provider... ==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 vvv.test ==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 one.wordpress.test ==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 two.wordpress.test ==> default: [vagrant-goodhosts] Checking for host entries Traceback (most recent call last): 30: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run' 29: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `action' 28: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `call' 27: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/environment.rb:614:in `lock' 26: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:215:in `block in action' 25: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:246:in `action_raw' 24: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run' 23: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy' 22: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run' 21: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call' 20: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call' 19: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/delayed.rb:19:in `call' 18: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call' 17: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call' 16: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call' 15: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/call.rb:43:in `call' 14: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run' 13: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy' 12: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run' 11: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call' 10: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call' 9: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/created.rb:15:in `call' 8: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call' 7: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/commands/up/middleware/store_box_metadata.rb:33:in `call' 6: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call' 5: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/Action/BaseAction.rb:31:in `call' 4: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/Action/UpdateHosts.rb:7:in `run' 3: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:105:in `addHostEntries' 2: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:105:in `each' 1: from C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:112:in `block in addHostEntries' C:/Users/EUGENY/vvv-local-vb/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.18/lib/vagrant-goodhosts/GoodHosts.rb:128:in `check_hostnames_to_add': undefined method `each' for "vvv.test one.wordpress.test two.wordpress.test":String (NoMethodError)
I also got this bug. check_hostnames_to_add being undefined 1.0.18 https://github.com/goodhosts/vagrant/blob/1.0.18/lib/vagrant-goodhosts/GoodHosts.rb but in Ruby you can't use a function before it's defined maybe? See lines 112 and 124
@Mte90 did you run my code from the PR or did it get released on just a code review? I hadn't tested any of the code I wrote
holy smokes! works under virtualbox without any issues! just needed to force 1.0.17 version of this plugin...
@tangor86 unless you disabled Hyper-V explicitly, VirtualBox 6 will lie to you and try to use hyper-v behind the scenes with a compatibility layer. Many users have had issues with that layer. Eitherway try to keep VVV related things in the VVV repo, this issue should justbe for goodhosts and the hosts file additions
I released a new version with bugfix for the previous release. Seems that I installed in my local ambient the dev extension but I wasn't using that during the tests -.-'
C:\Users\EUGENY\vvv-local>vagrant halt
==> default: Running action triggers before halt ...
==> default: Running trigger: VVV Pre-Halt...
default: Running: inline script
default: . ★ ☁ ★ .
default: Z ☽ ★ . ☁
default: Z ▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄ ★ __★__ __ __
default: ☁ z█▒▒░░░░░░░░░▒▒█ Sleep tight \ V\ V\ V /
default: ★ █░░▁░░░░░▁░░█ ★ \_/\_/\_/
default: . █░░░▀█▀░░░█ . ★
default: ★ ▀▄░░░░░░░▄▀ ★ .
default:
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 vvv.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 one.wordpress.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 two.wordpress.test
==> default: [vagrant-goodhosts] Removing hosts
Traceback (most recent call last):
35: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/bin/vagrant:231:in `<main>'
34: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/environment.rb:290:in `cli'
33: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/cli.rb:67:in `execute'
32: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/commands/halt/command.rb:30:in `execute'
31: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/plugin/v2/command.rb:232:in `with_target_vms'
30: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/plugin/v2/command.rb:232:in `each'
29: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/plugin/v2/command.rb:243:in `block in with_target_vms'
28: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/commands/halt/command.rb:31:in `block in execute'
27: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `action'
26: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `call'
25: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/environment.rb:614:in `lock'
24: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:215:in `block in action'
23: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:246:in `action_raw'
22: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run'
21: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy'
20: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run'
19: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call'
18: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
17: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/trigger.rb:32:in `call'
16: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
15: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
14: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
13: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/call.rb:43:in `call'
12: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run'
11: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy'
10: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run'
9: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call'
8: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
7: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/created.rb:15:in `call'
6: from D:/HashiCorp/Vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
5: from C:/Users/EUGENY/vvv-local/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/Action/BaseAction.rb:31:in `call'
4: from C:/Users/EUGENY/vvv-local/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/Action/RemoveHosts.rb:15:in `run'
3: from C:/Users/EUGENY/vvv-local/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:185:in `removeHostEntries'
2: from C:/Users/EUGENY/vvv-local/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:185:in `each'
1: from C:/Users/EUGENY/vvv-local/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:191:in `block in removeHostEntries'
C:/Users/EUGENY/vvv-local/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:159:in `removeGoodhostEntries': undefined local variable or method `cli' for #<VagrantPlugins::GoodHosts::Action::RemoveHosts:0x000001b8d8950398> (NameError)
C:\Users\EUGENY\vvv-local>
guys? :)
guys
a dangerous assumption!
C:/Users/EUGENY/vvv-local/.vagrant/plugins/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:159:in
removeGoodhostEntries': undefined local variable or methodcli' for #<VagrantPlugins::GoodHosts::Action::RemoveHosts:0x000001b8d8950398> (NameError)
WIP
Also are you sure it's using the latest version when it ran? Globally installed plugins vs locally installated plugins might mean that although you have the new version installed globally, you don't have it installed locally for that project ( installing with --local
then forgetting about it is a very common mistake )
Noting that I ran vagrant plugin update --local
and got the .19 version, and it worked fine on an up
and a halt
I managed to reproduce the failure on halt
and flushing out .vagrant/plugins
so it used the global version:
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 tomjn.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.50.4 multisite-subdir.test
==> default: [vagrant-goodhosts] Removing hosts
Traceback (most recent call last):
35: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/bin/vagrant:231:in `<main>'
34: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/environment.rb:290:in `cli'
33: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/cli.rb:67:in `execute'
32: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/commands/halt/command.rb:30:in `execute'
31: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/plugin/v2/command.rb:232:in `with_target_vms'
30: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/plugin/v2/command.rb:232:in `each'
29: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/plugin/v2/command.rb:243:in `block in with_target_vms'
28: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/commands/halt/command.rb:31:in `block in execute'
27: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `action'
26: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:201:in `call'
25: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/environment.rb:614:in `lock'
24: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:215:in `block in action'
23: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/machine.rb:246:in `action_raw'
22: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run'
21: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy'
20: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run'
19: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call'
18: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
17: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/trigger.rb:32:in `call'
16: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
15: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
14: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
13: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builtin/call.rb:43:in `call'
12: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `run'
11: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/util/busy.rb:19:in `busy'
10: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/runner.rb:89:in `block in run'
9: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/builder.rb:149:in `call'
8: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
7: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/plugins/providers/virtualbox/action/created.rb:15:in `call'
6: from /opt/vagrant/embedded/gems/2.2.18/gems/vagrant-2.2.18/lib/vagrant/action/warden.rb:48:in `call'
5: from /Users/tarendai/.vagrant.d/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/Action/BaseAction.rb:31:in `call'
4: from /Users/tarendai/.vagrant.d/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/Action/RemoveHosts.rb:15:in `run'
3: from /Users/tarendai/.vagrant.d/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:185:in `removeHostEntries'
2: from /Users/tarendai/.vagrant.d/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:185:in `each'
1: from /Users/tarendai/.vagrant.d/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:191:in `block in removeHostEntries'
/Users/tarendai/.vagrant.d/gems/2.7.4/gems/vagrant-goodhosts-1.0.19/lib/vagrant-goodhosts/GoodHosts.rb:159:in `removeGoodhostEntries': undefined local variable or method `cli' for #<VagrantPlugins::GoodHosts::Action::RemoveHosts:0x00007fec0a353ce0> (NameError)
https://github.com/goodhosts/vagrant/pull/42 should fix that issue, the release needs a proper set of testing before a .20 should go out, this would have been caught by verifying the plugin version used via vagrant plugin list --local
and an up
/halt
/up
/halt
I was thinking to add some tests or linter to avoid those cases that I can't see.
I did a new release https://github.com/goodhosts/vagrant/releases/tag/1.1.0beta
It is a beta and a major has includes a refactoring and some code style changes (also the recent fixes). Before to do an official release I prefer to get some testing from everyone :-)
You can updates the vagrant plugin and you will have this latest release, let me know if works so I can do an official release.
Download the gem from https://github.com/goodhosts/vagrant/releases/tag/1.1.0beta and next
vagrant plugin install vagrant-goodhosts-1.1.0beta.gem
or vagrant plugin --local install vagrant-goodhosts-1.1.0beta.gem
to do it
updated plugin today to 1.1.0, up and halt seem to work without any issues now, thanks a lot! (with virtualbox as provider)
Hello!
after doing vagrant up, my hosts are not accessible by domain name, only if add them manually to my hosts file...
as I understood it should have been done by goodhosts plugin? Attaching some logs and files.
log on installing goodhosts:
config.yml
vagrantfile
vagrant up + halt commands log (RUNNING AS ADMIN)
what is interesting here is this line: ==> default: [vagrant-goodhosts] No ip address found for this virtual machine it appears on both, up and halt...
any ideas how to make my hosts file updated automagically?