Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.54k stars 847 forks source link

Bug: Windows: Network connection issues found. Unable to reach #2707

Closed adamo closed 5 months ago

adamo commented 5 months ago

What was The Command Used To Provision

vagrant up --provision

What Kind of VVV Provision Was This

This was a reprovision of an already working VVV

Logs/What Broke

I've tried to add a new site and provision but got errors connecting to hosts.

 ▷ Running the 'main' provisioner...
 ▷ Running init hook
 * Bash profile setup and directories.
 * Reloading SSH Daemon
 * checking Ubuntu version
 ✔ Finished init hook in 19s
 * Testing network connection to https://ppa.launchpadcontent.net with wget -q --spider --timeout=5 --tries=3 https://ppa.launchpadcontent.net
 ! Network connection issues found. Unable to reach https://ppa.launchpadcontent.net
 * Testing network connection to https://wordpress.org with wget -q --spider --timeout=5 --tries=3 https://wordpress.org
 ! Network connection issues found. Unable to reach https://wordpress.org
 * Testing network connection to https://github.com with wget -q --spider --timeout=5 --tries=3 https://github.com
 ! Network connection issues found. Unable to reach https://github.com
 * Testing network connection to https://raw.githubusercontent.com with wget -q --spider --timeout=5 --tries=3 https://raw.githubusercontent.com
 ! Network connection issues found. Unable to reach https://raw.githubusercontent.com
 * Testing network connection to https://getcomposer.org with wget -q --spider --timeout=5 --tries=3 https://getcomposer.org
 ! Network connection issues found. Unable to reach https://getcomposer.org
 * Testing network connection to https://deb.nodesource.com with wget -q --spider --timeout=5 --tries=3 https://deb.nodesource.com
 ! Network connection issues found. Unable to reach https://deb.nodesource.com
 * Testing network connection to https://mirror.rackspace.com with wget -q --spider --timeout=5 --tries=3 https://mirror.rackspace.com
 ! Network connection issues found. Unable to reach https://mirror.rackspace.com
#################################################################
 
! Warning! Network Problems:
 
VVV tried to check several domains it needs for provisioning but 7 of 7 failed:
 
 [x] https://ppa.launchpadcontent.net|
 [x] https://wordpress.org|
 [x] https://github.com|
 [x] https://raw.githubusercontent.com|
 [x] https://getcomposer.org|
 [x] https://deb.nodesource.com|
 [x] https://mirror.rackspace.com|
 
Make sure you have a working internet connection, that you 
restarted after installing VirtualBox/Parallels/Vagrant, and that 
they aren't blocked by a firewall or security software.
If you can load the address in your browser, then VVV should
be able to connect.
 
Also note that some users have reported issues when combined
with VPNs, disable your VPN and reprovision to see if this is
the cause.
 
Additionally, if you're at a contributor day event, be kind,
provisioning involves downloading things, a full provision may 
ruin the wifi for everybody else :(
 
Network ifconfig output:
 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:feb1:285d  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:b1:28:5d  txqueuelen 1000  (Ethernet)
        RX packets 3049  bytes 356876 (356.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2258  bytes 391211 (391.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.4  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::a00:27ff:fe92:a226  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:92:a2:26  txqueuelen 1000  (Ethernet)
        RX packets 13  bytes 2734 (2.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 51  bytes 6764 (6.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 128  bytes 10544 (10.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 128  bytes 10544 (10.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 
Try provisioning again once network connectivity is restored.
If that doesn't work, and you're sure you have no VPNs and a strong 
internet connection, open an issue on GitHub, and include the 
output above so that the problem can be debugged
 
vagrant halt
vagrant up --provision
 
https://github.com/Varying-Vagrant-Vagrants/VVV/issues
 
#################################################################
 ==================================================================================================
 ! If this check fails despite succeeding in the browser, contact us in Slack or GitHub immediately
 ==================================================================================================
 * Apt package install pre-checks
 ▷ Running before_packages hook
 * Setting up MySQL configuration file links...
 * mysql group exists
 * mysql user present and has uid 9001
 * Copying /srv/provision/core/mariadb/config/vvv-core.cnf to /etc/mysql/conf.d/vvv-core.cnf
 * Copying PHP configs
 * Checking supplementary PHP configs
 ✔ Finished before_packages hook in 0s
 * Registering apt keys
 ▷ Running register_apt_keys hook
 ✔ Finished register_apt_keys hook in 1s
 * Registering apt sources
 ▷ Running register_apt_sources hook
 * git-core/ppa already present, skipping
 * installing MariaDB apt sources
 ✔ Finished register_apt_sources hook in 0s
 * Upgrading apt packages
 * Updating apt keys
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: key 3B4FE6ACC0B21F32: "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" not changed
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>" not changed
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: key 871920D1991BC93C: "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" not changed
gpg: Total number processed: 3
gpg:              unchanged: 3
 * Running apt-get update...
Err:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:2 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Err:3 https://mirror.rackspace.com/mariadb/repo/10.5/ubuntu focal InRelease
  Temporary failure resolving 'mirror.rackspace.com'
Err:4 https://nginx.org/packages/mainline/ubuntu focal InRelease
  Temporary failure resolving 'nginx.org'
Err:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu focal InRelease
  Temporary failure resolving 'ppa.launchpadcontent.net'
Err:6 https://packagecloud.io/github/git-lfs/ubuntu focal InRelease
  Temporary failure resolving 'packagecloud.io'
Err:7 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:8 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Err:9 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'us.archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/focal-security/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/focal/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch https://packagecloud.io/github/git-lfs/ubuntu/dists/focal/InRelease  Temporary failure resolving 'packagecloud.io'
W: Failed to fetch https://mirror.rackspace.com/mariadb/repo/10.5/ubuntu/dists/focal/InRelease  Temporary failure resolving 'mirror.rackspace.com'
W: Failed to fetch https://nginx.org/packages/mainline/ubuntu/dists/focal/InRelease  Temporary failure resolving 'nginx.org'
W: Failed to fetch https://ppa.launchpadcontent.net/ondrej/php/ubuntu/dists/focal/InRelease  Temporary failure resolving 'ppa.launchpadcontent.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 * Registering apt packages to install
 ▷ Running register_apt_packages hook
 ✔ Finished register_apt_packages hook in 0s
 * Main packages check and install.
 * Checking for apt packages to remove.
 * No apt packages to remove
 * Checking for apt packages to install.
 * No apt packages to install
 * Running after_packages
 ▷ Running after_packages hook
false
false
 * Adding Mailhog service file
 * Enabling MailHog Service
 * Starting MailHog Service
 * Started MailHog Service
 * Checking for NVM
 ✓ NVM is already installed, checking for updates
fatal: unable to access 'https://github.com/nvm-sh/nvm.git/': Could not resolve host: github.com
 ! The 'main' provisioner ran into problems, the full log is available at '/var/log/provisioners/2024.06.11_13-49-05/provisioner-main.log'. It completed in 161 seconds.
---
sites:
  # latest version of WordPress, can be used for client work and testing
  # Check the readme at https://github.com/Varying-Vagrant-Vagrants/custom-site-template
  # wordpress-one:
  #   skip_provisioning: false
  #   description: "A standard WP install, useful for building plugins, testing things, etc"
  #   repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
  #   hosts:
  #     - one.wordpress.test
  #   custom:
  #     wpconfig_constants:
  #       WP_DEBUG: true
  #       WP_DEBUG_LOG: true
  #       WP_DISABLE_FATAL_ERROR_HANDLER: true # To disable in WP 5.2 the FER mode

  piwnicasmakow:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - piwnicasmakow.test
    custom:
      wp_type: none
    nginx_upstream: php83

  brixani:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - brixani.test
    nginx_upstream: php80

  excitingpoland:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - excitingpoland.test
    nginx_upstream: php80

  greenfox:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - greenfox.test
    nginx_upstream: php80

  amtrener:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - amtrener.test
    nginx_upstream: php80

  base:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - base.test
    custom:
      wp_type: none
    nginx_upstream: php83

  cedo:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - cedo.test
    custom:
      wp_type: none
    nginx_upstream: php83

  paluchruda:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - paluchruda.test
    custom:
      wp_type: none
    nginx_upstream: php83

  inspiracje:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - inspiracje.test
    custom:
      wp_type: none
    nginx_upstream: php80

  depcoreagency:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - depcoreagency.test
    custom:
      wp_type: none
    nginx_upstream: php83

  depcore:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - depcore.test
    custom:
      wp_type: none
    nginx_upstream: php83

  gfp:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - gfp.test
    custom:
      wp_type: none
    nginx_upstream: php83

  vidocq:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - vidocq.test
    custom:
      wp_type: none
    nginx_upstream: php83

  opinia:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - opinia.test
    custom:
      wp_type: none
    nginx_upstream: php83

  pickpocket:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - pickpocket.test
    custom:
      wp_type: none
    nginx_upstream: php83

  prodoo:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - prodoo.test
    custom:
      wp_type: none
    nginx_upstream: php83

  tias:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - tias.test
    custom:
      wp_type: none
    nginx_upstream: php83

  paclan:
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - paclan.test
    custom:
      wp_type: none
    nginx_upstream: php83

extensions:
  core: # The core VVV extensions
    - tls-ca # HTTPS SSL/TLS certificates
    - phpmyadmin # Web based database client
    #- memcached-admin # Object cache management
    #- opcache-status # opcache management
    #- webgrind # PHP Debugging
    #- mongodb # needed for Tideways/XHGui
    #- tideways # PHP profiling tool, also installs xhgui check https://varyingvagrantvagrants.org/docs/en-US/references/tideways-xhgui/
    - nvm # Node Version Manager
    #- php74
    - php80
    - php81
    - php83

# vm_config controls how Vagrant provisions the virtual machine, and can be used to
# increase the memory given to VVV and the number of CPU cores.
# It can also be used to override the default provider being used within Vagrant.

vm_config:
  memory: 2048
  cores: 2
  # as Vagrant currently restricts you to one provider per machine
  # https://www.vagrantup.com/docs/providers/basic_usage.html#vagrant-up
  # provider: virtualbox
  # provider: hyperv
  # provider: parallels
  # provider: vmware_desktop
  # provider: docker

# General VVV options
general:
  db_backup:
    enable: false
    gzip: true
    #exclude:
    #  - wordpress-trunk

  db_restore: false
  db_share_type: false
  #github_token: xxxxxx

vagrant-plugins:
  disksize: 10GB # requires the disk size vagrant plugin

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Your Environment

Operating System: Windows


\ V\ V\ V / v3.13 Ruby:3.1.4, Path:"C:/strony/sites" _/_/_/ git::develop(c4250187)

Platform: mingw32 windows missingWinAdminPriv vagrant-hostsupdater vagrant-goodhosts vagrant-vbguest monochrome-terminal shared_db_folder_disabled Vagrant: v2.4.1, virtualbox: v7.0.18

welcome[bot] commented 5 months ago

Thanks for opening your first issue here! Be sure to follow the issue template and include your OS/Vagrant/VVV versions! Don't forget you can get support in the VVV slack at https://varyingvagrantvagrants.org/docs/en-US/slack/

tomjn commented 5 months ago

I see missingWinAdminPriv have you tried this from a prompt with elevated admin privileges? As an aside vagrant-hostsupdater isn't necessary for VVV, unless you're using it on other vagrant projects I'd uninstall it.

tomjn commented 5 months ago

You should also be able to replace all of these:

    nginx_upstream: php83

With these:

    php: 8.3
adamo commented 5 months ago

Thanks for your reply but the problem is still there. Maybe there is a problem with a DNS inside the machine?

When using vagrant ssh i can do ping 8.8.8.8 but ping google.com fails

tomjn commented 5 months ago

hmmm that's possible, I've had that myself but only when using Parallels on Arm, I switched the DNS inside the VM to 8.8.8.8 too and things started working again.

See https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2662 which links to a howto, I also attempted to automate this with https://github.com/Varying-Vagrant-Vagrants/VVV/pull/2701 but didn't have much luck.

I was hoping to set these servers for DNS:

DNS_SERVERS=(
  # Quad9
  "9.9.9.9"
  "149.112.112.112"
  "2620:fe::fe"
  "2620:fe::9"

  # Cloudflare
  "1.1.1.1"
  "1.0.0.2"
  "2606:4700:4700::1112"
  "2606:4700:4700::1002"
)

Using google would cause issues in some countries that block those DNS servers, and there are privacy considerations to account for too. Quad9 has a good reputation on those counts and Cloudflare comes in close too

adamo commented 5 months ago

I'm still fighting with this nothing has worked or I'm missing something. I've tried:

Im still getting ' Network connection issues found. Unable to reach https://ppa.launchpadcontent.net' when provisioning and Problem: Could not load the site, this implies that provisioning the site failed, please check there were no errors during provisioning, and reprovision. error.

tomjn commented 5 months ago

You shouldn't need to do anything related to VirtualBox or vagrant here to try and diagnose and fix this, all viable debugging steps are general Ubuntu steps you can perform via vagrant ssh and vagrant halt/vagrant up.

Also keep in mind no attempt is made to provision sites until after the main provisioner has completed. If it fails then nothing after it will run, after all why provision a site on a VM with no Nginx/PHP/DB? ( Why install the roof on a house that has no walls yet? )

tomjn commented 5 months ago

Of note, Ubuntu has tried changing how DNS is handled over several revisions, knowing which version of Ubuntu will help greatly. You also don't need to reprovision to test if your fix worked, it's enough to test it from the command line inside the VM. Reprovisioning is just the most exensive/time consuming way to do it.

It's also highly unlikely you can fix this from the vagrant/Windows side, all clues point to a Linux based solution

tomjn commented 5 months ago

changing the ip address in /etc/resolv.conf

If I remember right this is a generated file, by turning off the VM and turning it back on as part of a provision you've probably erased your DNS changes.

changing the file step 3 (Method 2: The not-so-easy way) from https://learnubuntu.com/change-dns-server/

This article backsup the temporary part of the above.

Take a look at Netplan. My next step with that PR was to figure out a netplan YAML file to drop in to add the DNS servers. Modifying an existing netplan YAML file in the VM and applying it should also work.

You definitely don't need to install resolvectl etc, it should all be doable with what's already there.

There is a chance your VM has a much older Ubuntu version that doesn't use this system though.

I've went to Virtualbox forum https://forums.virtualbox.org/viewtopic.php?t=94277

Those are all Windows errors and Windows error logs, totally unrelated to what you're dealing with. If you had the issues that thread is talking about then the provisioners would never have started in the first place and you'd be seeing vagrant errors not provisioner errors.

reinstalled vagrant, VB again - removed, added network interfaces

This rarely fixes problems and usually causes new ones! Unless you're seeing a VirtualBox or Vagrant error don't touch these!

turned the firewall off

If the host WIndows OS also had this issue then that might have been the cause, you should turn it back on.

Im still getting ' Network connection issues found. Unable to reach https://ppa.launchpadcontent.net/' when provisioning

The provisioner network checks are there to check if it's safe to continue and help diagnose issues. Some people can provision even when these checks fail and had to disable them manually, we do not know why.

These should be treated as informational and not as an error. Most people who encounter this do so because they didn't bother to reboot their machine after updating/installing VirtualBox. The problem you're facing is actually further down in the apt-get update step where it can't resolve the hosts for packages.

adamo commented 5 months ago

Wow. Thank you'r response and the effort you put in it. It helped me immensely the problem as you'd pointed out is in the distro and "Of note, Ubuntu has tried changing how DNS is handled over several revisions, knowing which version of Ubuntu will help greatly." I have Ubuntu 20.04 LTS

I've followed this advice then did sudo ap-get update the update that failed previously worked.

The provision has the same problems so i guess it resets the name servers to previous values - how do I make them permament?

tomjn commented 5 months ago

The latter echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null is probably what you want but I can't confirm if that's the case

adamo commented 5 months ago

The latter echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null is probably what you want but I can't confirm if that's the case

Yes this worked inside ssh but after provision it resets the DNS and the error is still there. Where can I add this line in the provision script?

tomjn commented 5 months ago

Where can I add this line in the provision script?

You don't, that's not how this is supposed to work. If Linux was your main operating system you wouldn't want to re-apply a temporary fix everytime you turned the machine on, or modify a Linux OS installer to do it for you.

Test it via vagrant ssh and ignore the provisioning and see if it does indeed get stripped. I've managed to do this in the past and it required no changes to VVV once done in an SSH session inside the VM, the difficulties came when trying to add it to the provisioners so I didn't have to figure it out everytime I destroyed the VM and created a new one for testing. That's what the PR I linked to was attempting to do, and why I was digging through Netplan configs ( and modifying a netplan config is probably what you need to do too )

tomjn commented 5 months ago

Look at https://linuxize.com/post/how-to-set-dns-nameservers-on-ubuntu-18-04/#setting-dns-nameservers-on-ubuntu-server it has a Netplan example that might help, my PR tried to modify those nameservers but I assumed they existed and they did not.

The PR could be modified to use shyaml to add those but if DNS isn't working then we can't install shyaml in order to fix it so it has to be done without any shyaml/PHP using tools only available in stock Ubuntu

adamo commented 5 months ago

Thanks. OK. Trying those solutions right now with no luck. It seems DNS settings are really messed up right nowin ubuntu.

tomjn commented 5 months ago

what file did you modify in Netplan? Do you have a copy of it?

adamo commented 5 months ago

I modified each in the directory - don't have the ability to get it now but I've added this to each one

nameservers:
          addresses: [1.1.1.1, 1.0.0.1]

and then sudo netplan apply

this systemd-resolve --status | grep 'DNS Servers' -A2 didn't work

tomjn commented 5 months ago

the indentation matters, if there is no indentation on the nameservers section then it won't work

adamo commented 5 months ago

This is how it looks

image /etc/netplan/50-vagrant.yaml image /etc/netplan/00-installer-config.yaml

tomjn commented 5 months ago

Can you add it to the 00-installer-config.yaml too under eth1?

tomjn commented 5 months ago

you can also copy into /srv/www if you want to modify it with a native editor and copy back, just be careful with line endings

adamo commented 5 months ago

I've contacted a friend whos a ubuntu expert heres what he did:

It works.

Thank you @tomjn for all the help.

tomjn commented 5 months ago

Hmm do you know what the contents were? That’s worrying but if it’s full of site host names it would explain why and suggest a fix

On Thu, 13 Jun 2024 at 11:38, Adam @.***> wrote:

I've contacted a friend whos a ubuntu expert heres what he did:

It works.

Thank you @tomjn https://github.com/tomjn for all the help.

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2707#issuecomment-2165274553, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZZST4U7O6NPKVLBYBTZHFZBVAVCNFSM6AAAAABJEMXITCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRVGI3TINJVGM . You are receiving this because you were mentioned.Message ID: @.***>

adamo commented 5 months ago

yes I've a copy of the etc.hosts file hosts.zip

tomjn commented 5 months ago

Ah it's as I thought, every provision adds the hosts of VVV to the local file so that local loopback works, but it doesn't cleanup or check if it's already there.

tomjn commented 5 months ago

So there are 2 places that add site host names, one adds them with #vvv-auto on the end, and this function is meant to clear them out:

https://github.com/Varying-Vagrant-Vagrants/VVV/blob/c42501871c39f5d33d3d60e467c3c70d2fe70921/provision/core/vvv/provision.sh#L114

This one adds them and checks if they're already present:

https://github.com/Varying-Vagrant-Vagrants/VVV/blob/c42501871c39f5d33d3d60e467c3c70d2fe70921/provision/provision-site.sh#L234

and in the vagrant up trigger it updates the hosts without checking first in vvv_update_guest_hosts, so lots of vagrant up/halt would extend the hosts file over time

tomjn commented 5 months ago

I've created a PR here:

https://github.com/Varying-Vagrant-Vagrants/VVV/pull/2708

It might help prevent or reduce this from happening, can you take a look?

I suspect this code isn't cleaning up the hosts file but might be appending it:

https://github.com/Varying-Vagrant-Vagrants/VVV/blob/c42501871c39f5d33d3d60e467c3c70d2fe70921/provision/core/vvv/provision.sh#L115C1-L126C22

Does anything jump out at you as obvious?

tomjn commented 5 months ago

also found in my notes: https://github.com/derekbit/kube-virtdeploy/blob/master/scripts/fix.generic-ubuntu-dns.sh

tomjn commented 5 months ago

@adamo can you test the PR at https://github.com/Varying-Vagrant-Vagrants/VVV/pull/2708? From what I understand cleaning your hosts file manually was a temporary fix, this should solve the problem and auto-cleanup the hosts file automatically

tomjn commented 5 months ago

Closing this now that #2708 is merged

adamo commented 5 months ago

Sorry for the delay but you're working with a speed of light and I had family thins to attend to - if this helps you I'll check it today.

tomjn commented 5 months ago

@adamo no rush, the changes made it into the v3.13.1 release so there's no urgency. Confirm when you're free and give me a ping if the host file starts growing or DNS becomes weird again

adamo commented 5 months ago

I've applied the updated, and will keep you posted if something comes up.