Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_correct forwarded_port not working #11063

Closed
adrianovieira opened this issue Sep 10, 2019 · 4 comments
Closed

auto_correct forwarded_port not working #11063

adrianovieira opened this issue Sep 10, 2019 · 4 comments

Comments

@adrianovieira
Copy link

Please note that the Vagrant issue tracker is in priority reserved for bug reports and enhancements. For general usage questions, please use the Vagrant mailing list:
https://groups.google.com/forum/#!forum/vagrant-up. Thank you!

Tip: Before submitting your issue, don't hesitate to remove the above introductory text, possible empty sections (e.g. References), and this tip.

Vagrant version

Run vagrant -v to show the version. If you are not running the latest version
of Vagrant, please upgrade before submitting an issue.
Vagrant 2.2.5

Host operating system

This is the operating system that you run locally.
Fedora 30

Guest operating system

This is the operating system you run in the virtual machine.
Centos/7

Provider

Libvirt

Vagrantfile

# Copy-paste your Vagrantfile here (but don't include sensitive information such as 
# passwords, authentication tokens, or email addresses)
Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
  config.vm.network "forwarded_port", guest: 9200, host: 9200, auto_correct: true
  (1..(2)).each do |node_id|
    config.vm.define "node-#{node_id}" do |node|
      node.vm.provider "virtualbox" do |virtualbox|
        virtualbox.customize [ "modifyvm", :id, "--cpus", 2 ]
        virtualbox.customize [ "modifyvm", :id, "--memory", 4096 ]
      end
      node.vm.provider :libvirt do |libvirt|
        libvirt.cpus = 2
        libvirt.memory = 4096
      end
    end
  end
end

OR

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  (1..(2)).each do |node_id|
    config.vm.define "node-#{node_id}" do |node|

      node.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
      node.vm.network "forwarded_port", guest: 9200, host: 9200, auto_correct: true

      node.vm.provider "virtualbox" do |virtualbox|
        virtualbox.customize [ "modifyvm", :id, "--cpus", 2 ]
        virtualbox.customize [ "modifyvm", :id, "--memory", 4096 ]
      end
      node.vm.provider :libvirt do |libvirt|
        libvirt.cpus = 2
        libvirt.memory = 4096
      end
    end
  end
end

Please note, if you are using Homestead or a different Vagrantfile format, we
may be unable to assist with your issue. Try to reproduce the issue using a
vanilla Vagrantfile first.

Debug output

Provide a link to a GitHub Gist containing the complete debug output:
https://www.vagrantup.com/docs/other/debugging.html. The debug output should
be very long. Do NOT paste the debug output in the issue, just paste the
link to the Gist.
https://gist.github.com/adrianovieira/d3054367e1473bc041ab48281de0c202

Expected behavior

What should have happened?
second created VM node to open on different ports

Actual behavior

What actually happened?

both created VM node had opened on same ports

Steps to reproduce

  1. get one of those Vagranfile
  2. vagrant up

References

Are there any other GitHub issues (open or closed) that should be linked here?
For example:

@briancain
Copy link
Member

Hi @adrianovieira From what I can tell your debug log is showing that there's an rsync error:

ERROR warden: Error occurred: There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /tmp/
Guest path: /vagrant
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 22 -o LogLevel=FATAL   -o ControlMaster=auto -o ControlPath=/tmp/vagrant-rsync-20190910-28701-1fvemfa -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/tmp/.vagrant/machines/node-2/libvirt/private_key'" "--exclude" ".vagrant/" "/tmp/" "[email protected]:/vagrant"
Error: symlink has no referent: "/tmp/.org.chromium.Chromium.BGhOCN/SingletonCookie"
symlink has no referent: "/tmp/.org.chromium.Chromium.FGKPFg/SingletonCookie"
symlink has no referent: "/tmp/.org.chromium.Chromium.Z78cWR/SingletonCookie"
rsync: opendir "/tmp/systemd-private-f2812f755e804cf3b5cf3e211a93e8e7-ModemManager.service-3BlqjC" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-f2812f755e804cf3b5cf3e211a93e8e7-bolt.service-nJkXRQ" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-f2812f755e804cf3b5cf3e211a93e8e7-colord.service-bteAYl" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-f2812f755e804cf3b5cf3e211a93e8e7-dbus-broker.service-JCP5sw" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-f2812f755e804cf3b5cf3e211a93e8e7-rtkit-daemon.service-LZhNGj" failed: Permission denied (13)
rsync: opendir "/tmp/systemd-private-f2812f755e804cf3b5cf3e211a93e8e7-upower.service-NfBREk" failed: Permission denied (13)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1189) [sender=3.1.3]

I don't see any errors in the log about auto_correct with port forwarding.

@adrianovieira
Copy link
Author

Hi, @briancain
Thanks by your reply.

But you got the problem "You don't see any errors in the log about auto_correct with port forwarding".

vagrant brings both VM up, but didn't show anything about port forwarding. Worst than that, it didn't map different ports between one and another VMs.

@briancain
Copy link
Member

Hi @adrianovieira - This looks like a vagrant-libvirt bug to me. Port Forwarding works fine with the vmware and virtualbox plugin, both of which use the built in action HandleForwardedPortCollisions. From a quick search, the libvirt plugin does not use this any where, so that would explain why port forwarding isn't working with that plugin. I recommend opening an issue with them. Thanks!

@ghost
Copy link

ghost commented Jan 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants