Parallels / vagrant-parallels

Vagrant Parallels Provider
https://parallels.github.io/vagrant-parallels
MIT License
996 stars 87 forks source link

"missing interpolation" error on network collision #339

Closed kevinburkengrok closed 5 years ago

kevinburkengrok commented 5 years ago

I got this error:

/opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n/config.rb:99:in `block in missing_interpolation_argument_handler': missing interpolation argument :netaddr in "The specified host network collides with a non-hostonly network!\nThis will cause your specified IP to be inaccessible. Please change\nthe IP or name of your host only network so that it no longer matches that of\na bridged or non-hostonly network.\n\nBridged Network Address: '%{netaddr}'\nHost-only Network '%{interface_name}': '%{that_netaddr}'" ({:_key=>:collides, :_namespace=>"vagrant.actions.vm.host_only_network"} given) (I18n::MissingInterpolationArgument)
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n/interpolate/ruby.rb:29:in `block in interpolate_hash'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n/interpolate/ruby.rb:21:in `gsub'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n/interpolate/ruby.rb:21:in `interpolate_hash'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n/interpolate/ruby.rb:17:in `interpolate'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n/backend/base.rb:176:in `interpolate'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n/backend/base.rb:59:in `translate'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n.rb:185:in `block in translate'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n.rb:181:in `catch'
    from /opt/vagrant/embedded/gems/2.2.4/gems/i18n-1.1.1/lib/i18n.rb:181:in `translate'
    from /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/errors.rb:103:in `translate_error'
    from /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/errors.rb:72:in `initialize'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:294:in `exception'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:294:in `raise'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:294:in `block in hostonly_config'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:291:in `each'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:291:in `hostonly_config'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:80:in `block in call'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:73:in `each'
    from /Users/kevin/.vagrant.d/gems/2.4.4/gems/vagrant-parallels-2.0.0/lib/vagrant-parallels/action/network.rb:73:in `call'

The issue seems to be how NetworkCollision is thrown. Compare virtualbox/action/network.rb to this project's network.rb.

                raise Vagrant::Errors::NetworkCollision,
                  netaddr: netaddr,
                  that_netaddr: that_netaddr,
                  interface_name: interface[:name]

and here:

            @env[:machine].provider.driver.read_bridged_interfaces.each do |interface|
              next if interface[:status] == 'Down'
              that_netaddr = IPAddr.new("#{interface[:ip]}/#{interface[:netmask]}")
              raise Vagrant::Errors::NetworkCollision if netaddr.include? that_netaddr
            end
legal90 commented 5 years ago

@kevinburkengrok Thank you for creating this issue! I fixed that in v2.0.1. Please, upgrade the plugin and try again.

After that you should get the error message with details which hopefully will help you to solve the collision on your side. E.q. there is a collision between one of private_network (aka "Host Only") specified in your Vagrantfile and some other network adapter presenting on your host (aka "Bridged").