agiledivider / vagrant-hostsupdater

MIT License
1.15k stars 130 forks source link

Windows10 - Virtualbox - 6.1.16 r140961 - HostsUpdater.rb:152:in `+': no implicit conversion of nil into String #190

Closed ticketshop0devops closed 3 years ago

ticketshop0devops commented 3 years ago

vagrant up fails after updating to latest version

VirtualBox 6.1.16 r140961 vagrant: 2.2.14

Traceback (most recent call last): 28: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/batch_action.rb:86:in block (2 levels) in run' 27: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/machine.rb:201:inaction' 26: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/machine.rb:201:in call' 25: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:613:inlock' 24: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/machine.rb:215:in block in action' 23: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/machine.rb:246:inaction_raw' 22: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/runner.rb:89:in run' 21: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/busy.rb:19:inbusy' 20: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/runner.rb:89:in block in run' 19: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/builder.rb:149:incall' 18: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/warden.rb:48:in call' 17: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/builtin/trigger.rb:32:incall' 16: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/warden.rb:48:in call' 15: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/action/check_virtualbox.rb:26:incall' 14: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/warden.rb:48:in call' 13: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/builtin/call.rb:43:incall' 12: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/runner.rb:89:in run' 11: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/busy.rb:19:inbusy' 10: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/runner.rb:89:in block in run' 9: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/builder.rb:149:incall' 8: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/warden.rb:48:in call' 7: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/virtualbox/action/created.rb:15:incall' 6: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/warden.rb:48:in call' 5: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/commands/up/middleware/store_box_metadata.rb:33:incall' 4: from C:/Program Files (x86)/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/warden.rb:48:in call' 3: from c:/Program Files/lw_d/DEV/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/Action/UpdateHosts.rb:17:incall' 2: from c:/Program Files/lw_d/DEV/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/HostsUpdater.rb:99:in addHostEntries' 1: from c:/Program Files/lw_d/DEV/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/HostsUpdater.rb:152:inaddToHosts' c:/Program Files/lw_d/DEV/.vagrant.d/gems/2.6.6/gems/vagrant-hostsupdater-1.2.0/lib/vagrant-hostsupdater/HostsUpdater.rb:152:in `+': no implicit conversion of nil into String (TypeError)

This is similar to Issue #188 ...

It can be fixed by changing HostsUpdater.rb in Line 152

From tmpPath = File.join(Dir.tmpdir, 'hosts-' + uuid + '.cmd')

to

tmpPath = File.join(Dir.tmpdir, 'hosts-' + uuid.to_s + '.cmd')

ticketshop0devops commented 3 years ago

HostsUpdater.zip

cgsmith commented 3 years ago

@ticketshop0devops Can you test this pre-release before I push it out? https://github.com/agiledivider/vagrant-hostsupdater/releases/tag/1.2.1-beta

yayMark commented 3 years ago

Still happens for me