Debug output
I'm not sure you'll need them, as I hope I've provided sufficient information here, but in case you do, I've uploaded the debug files along with some related content here (attempting to paste into gist seems to have overloaded my browser's brain), with contents of several things:
- output (and error) of various vagrant commands, in the
?a-* (where ? is 0-4, and * is the command that was run) files, as per the filenames, but with --debug appended.
- output of
ps -ft $(tty) www for each run, in ?b-ps-after-?a.out, for each of the above
- abbreviated output of
vagrant ssh -c "ip addr" in 4c-ip-addr-after-4a.out
- the Vagrantfile (also below)
- the URL for a stack-overflow question mentioned (because copy/paste is still unhappy after the gist thing).
- partial output of an strace of vagrant up
- output of
vagrant --version
Expected behavior
- When running
vagrant destroy (or vagrant destroy -f), the ssh processes that are used to forward ports should be killed, as it seems to be with vagrant halt.
- Later, I expect new invocations of
vagrant up to have ports properly forwarded.
- If that's not possible, I would expect to see an error generated.
Actual behavior
vagrant up creates an ssh process that seems to fork itself, and vagrant halt and vagrant destroy both kill the parent of these two processes, but for whatever reason, when vagrant destroy does so (perhaps using a different signal?), the child ssh process is not killed, thus locking in a forwarder that ends up having a stale IP address, and
- not getting re-started in subsequent
vagrant up, because
- while an attempt is made to launch a new
ssh to forward ports, it silently (from a vagrant user's perspective, and even per the --debug logs) fails... though running vagrant up under strace -f -s 4096 ... shows that bind() is getting EADDRINUSE, because the old process is still around.
Reproduction information
Vagrant version
Vagrant 2.2.19 -- sorry it's not the latest; I'm hoping this is still relevant -- I found it in also existing in a StackOverflow answer from some years ago that hadn't been resolved, so... guessing it's a lingering bug. Unfortunately, I'm hitting this on a system where upgrading is infeasible currently.
Host operating system
Ubuntu 22.04.3 LTS
Guest operating system
Debian 13.5 trixie (debian/trixie64, libvirt, 13.20260519.1)
Steps to reproduce
vagrant up
vagrant destroy -f
vagrant up
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "debian/trixie64"
config.nfs.verify_installed = false
config.vm.network "forwarded_port", guest: 80, host: 8080
end
Debug output
I'm not sure you'll need them, as I hope I've provided sufficient information here, but in case you do, I've uploaded the debug files along with some related content here (attempting to paste into gist seems to have overloaded my browser's brain), with contents of several things:
?a-*(where?is 0-4, and*is the command that was run) files, as per the filenames, but with--debugappended.ps -ft $(tty) wwwfor each run, in?b-ps-after-?a.out, for each of the abovevagrant ssh -c "ip addr"in 4c-ip-addr-after-4a.outvagrant --versionExpected behavior
vagrant destroy(orvagrant destroy -f), thesshprocesses that are used to forward ports should be killed, as it seems to be withvagrant halt.vagrant upto have ports properly forwarded.Actual behavior
vagrant upcreates ansshprocess that seems to fork itself, andvagrant haltandvagrant destroyboth kill the parent of these two processes, but for whatever reason, whenvagrant destroydoes so (perhaps using a different signal?), the childsshprocess is not killed, thus locking in a forwarder that ends up having a stale IP address, andvagrant up, becausesshto forward ports, it silently (from a vagrant user's perspective, and even per the--debuglogs) fails... though runningvagrant upunderstrace -f -s 4096 ...shows thatbind()is gettingEADDRINUSE, because the old process is still around.Reproduction information
Vagrant version
Vagrant 2.2.19-- sorry it's not the latest; I'm hoping this is still relevant -- I found it in also existing in a StackOverflow answer from some years ago that hadn't been resolved, so... guessing it's a lingering bug. Unfortunately, I'm hitting this on a system where upgrading is infeasible currently.Host operating system
Ubuntu 22.04.3 LTS
Guest operating system
Debian 13.5 trixie (debian/trixie64, libvirt, 13.20260519.1)
Steps to reproduce
vagrant upvagrant destroy -fvagrant upVagrantfile