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

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

Closed
adamo opened this issue Jun 11, 2024 · 33 comments
Closed

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

adamo opened this issue Jun 11, 2024 · 33 comments

Comments

@adamo
Copy link

adamo commented Jun 11, 2024

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.

�[0;38;5;2m ▷ Running the �[0m�[1m�[0;38;5;5m'main'�[21m�[0;38;5;2m provisioner...�[0m�[0m�[0m
�[0m�[39m�[2m ▷ Running �[0m�[1m�[0;38;5;5minit�[21m�[0m�[39m�[2m hook�[21m�[0m
�[0m�[39m�[2m * Bash profile setup and directories.�[21m�[0m
�[0m�[39m�[2m * Reloading SSH Daemon�[21m�[0m
�[0m�[39m�[2m * checking Ubuntu version�[21m�[0m
�[0;38;5;2m ✔ Finished �[0m�[1m�[0;38;5;5minit�[21m�[0;38;5;2m hook in �[0m�[0m�[1m�[0;38;5;5m19s�[21m�[0m�[0m
�[0m�[39m�[2m * Testing network connection to �[0m�[4;38;5;3mhttps://ppa.launchpadcontent.net�[0m with wget -q --spider --timeout=5 --tries=3 https://ppa.launchpadcontent.net�[21m�[0m
�[0;38;5;9m ! Network connection issues found. Unable to reach �[0m�[4;38;5;3mhttps://ppa.launchpadcontent.net�[0m�[0m�[0m
�[0m�[39m�[2m * Testing network connection to �[0m�[4;38;5;3mhttps://wordpress.org�[0m with wget -q --spider --timeout=5 --tries=3 https://wordpress.org�[21m�[0m
�[0;38;5;9m ! Network connection issues found. Unable to reach �[0m�[4;38;5;3mhttps://wordpress.org�[0m�[0m�[0m
�[0m�[39m�[2m * Testing network connection to �[0m�[4;38;5;3mhttps://github.com�[0m with wget -q --spider --timeout=5 --tries=3 https://github.com�[21m�[0m
�[0;38;5;9m ! Network connection issues found. Unable to reach �[0m�[4;38;5;3mhttps://github.com�[0m�[0m�[0m
�[0m�[39m�[2m * Testing network connection to �[0m�[4;38;5;3mhttps://raw.githubusercontent.com�[0m with wget -q --spider --timeout=5 --tries=3 https://raw.githubusercontent.com�[21m�[0m
�[0;38;5;9m ! Network connection issues found. Unable to reach �[0m�[4;38;5;3mhttps://raw.githubusercontent.com�[0m�[0m�[0m
�[0m�[39m�[2m * Testing network connection to �[0m�[4;38;5;3mhttps://getcomposer.org�[0m with wget -q --spider --timeout=5 --tries=3 https://getcomposer.org�[21m�[0m
�[0;38;5;9m ! Network connection issues found. Unable to reach �[0m�[4;38;5;3mhttps://getcomposer.org�[0m�[0m�[0m
�[0m�[39m�[2m * Testing network connection to �[0m�[4;38;5;3mhttps://deb.nodesource.com�[0m with wget -q --spider --timeout=5 --tries=3 https://deb.nodesource.com�[21m�[0m
�[0;38;5;9m ! Network connection issues found. Unable to reach �[0m�[4;38;5;3mhttps://deb.nodesource.com�[0m�[0m�[0m
�[0m�[39m�[2m * Testing network connection to �[0m�[4;38;5;3mhttps://mirror.rackspace.com�[0m with wget -q --spider --timeout=5 --tries=3 https://mirror.rackspace.com�[21m�[0m
�[0;38;5;9m ! Network connection issues found. Unable to reach �[0m�[4;38;5;3mhttps://mirror.rackspace.com�[0m�[0m�[0m
�[0;38;5;9m#################################################################�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9m! Warning! Network Problems:�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9mVVV tried to check several domains it needs for provisioning but 7 of 7 failed:�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0m [�[0;38;5;9mx�[0m] https://ppa.launchpadcontent.net�[0;38;5;9m|
�[0m [�[0;38;5;9mx�[0m] https://wordpress.org�[0;38;5;9m|
�[0m [�[0;38;5;9mx�[0m] https://github.com�[0;38;5;9m|
�[0m [�[0;38;5;9mx�[0m] https://raw.githubusercontent.com�[0;38;5;9m|
�[0m [�[0;38;5;9mx�[0m] https://getcomposer.org�[0;38;5;9m|
�[0m [�[0;38;5;9mx�[0m] https://deb.nodesource.com�[0;38;5;9m|
�[0m [�[0;38;5;9mx�[0m] https://mirror.rackspace.com�[0;38;5;9m|
�[0;38;5;9m �[0m�[0m
�[0;38;5;9mMake sure you have a working internet connection, that you �[0m�[0m
�[0;38;5;9mrestarted after installing VirtualBox/Parallels/Vagrant, and that �[0m�[0m
�[0;38;5;9mthey aren't blocked by a firewall or security software.�[0m�[0m
�[0;38;5;9mIf you can load the address in your browser, then VVV should�[0m�[0m
�[0;38;5;9mbe able to connect.�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9mAlso note that some users have reported issues when combined�[0m�[0m
�[0;38;5;9mwith VPNs, disable your VPN and reprovision to see if this is�[0m�[0m
�[0;38;5;9mthe cause.�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9mAdditionally, if you're at a contributor day event, be kind,�[0m�[0m
�[0;38;5;9mprovisioning involves downloading things, a full provision may �[0m�[0m
�[0;38;5;9mruin the wifi for everybody else :(�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9mNetwork ifconfig output:�[0m�[0m
�[0;38;5;9m �[0m�[0m
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

�[0;38;5;9m �[0m�[0m
�[0;38;5;9mTry provisioning again once network connectivity is restored.�[0m�[0m
�[0;38;5;9mIf that doesn't work, and you're sure you have no VPNs and a strong �[0m�[0m
�[0;38;5;9minternet connection, open an issue on GitHub, and include the �[0m�[0m
�[0;38;5;9moutput above so that the problem can be debugged�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9mvagrant halt�[0m�[0m
�[0;38;5;9mvagrant up --provision�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9m�[0m�[4;38;5;3mhttps://github.com/Varying-Vagrant-Vagrants/VVV/issues�[0m�[0m�[0m
�[0;38;5;9m �[0m�[0m
�[0;38;5;9m#################################################################�[0m�[0m
�[0;38;5;3m ==================================================================================================�[0m�[0m
�[0;38;5;3m ! If this check fails despite succeeding in the browser, contact us in Slack or GitHub immediately�[0m�[0m
�[0;38;5;3m ==================================================================================================�[0m�[0m
�[0m�[39m�[2m * Apt package install pre-checks�[21m�[0m
�[0m�[39m�[2m ▷ Running �[0m�[1m�[0;38;5;5mbefore_packages�[21m�[0m�[39m�[2m hook�[21m�[0m
�[0m�[39m�[2m * Setting up MySQL configuration file links...�[21m�[0m
�[0m�[39m�[2m * mysql group exists�[21m�[0m
�[0m�[39m�[2m * mysql user present and has uid 9001�[21m�[0m
�[0m�[39m�[2m * Copying /srv/provision/core/mariadb/config/vvv-core.cnf to /etc/mysql/conf.d/vvv-core.cnf�[21m�[0m
�[0m�[39m�[2m * Copying PHP configs�[21m�[0m
�[0m�[39m�[2m * Checking supplementary PHP configs�[21m�[0m
�[0;38;5;2m ✔ Finished �[0m�[1m�[0;38;5;5mbefore_packages�[21m�[0;38;5;2m hook in �[0m�[0m�[1m�[0;38;5;5m0s�[21m�[0m�[0m
�[0m�[39m�[2m * Registering apt keys�[21m�[0m
�[0m�[39m�[2m ▷ Running �[0m�[1m�[0;38;5;5mregister_apt_keys�[21m�[0m�[39m�[2m hook�[21m�[0m
�[0;38;5;2m ✔ Finished �[0m�[1m�[0;38;5;5mregister_apt_keys�[21m�[0;38;5;2m hook in �[0m�[0m�[1m�[0;38;5;5m1s�[21m�[0m�[0m
�[0m�[39m�[2m * Registering apt sources�[21m�[0m
�[0m�[39m�[2m ▷ Running �[0m�[1m�[0;38;5;5mregister_apt_sources�[21m�[0m�[39m�[2m hook�[21m�[0m
�[0m�[39m�[2m * git-core/ppa already present, skipping�[21m�[0m
�[0m�[39m�[2m * installing MariaDB apt sources�[21m�[0m
�[0;38;5;2m ✔ Finished �[0m�[1m�[0;38;5;5mregister_apt_sources�[21m�[0;38;5;2m hook in �[0m�[0m�[1m�[0;38;5;5m0s�[21m�[0m�[0m
�[0m�[39m�[2m * Upgrading apt packages�[21m�[0m
�[0m�[39m�[2m * Updating apt keys�[21m�[0m
gpg: key 3B4FE6ACC0B21F32: 3 signatures not checked due to missing keys
gpg: key 3B4FE6ACC0B21F32: "Ubuntu Archive Automatic Signing Key (2012) <[email protected]>" not changed
gpg: key D94AA3F0EFE21092: 3 signatures not checked due to missing keys
gpg: key D94AA3F0EFE21092: "Ubuntu CD Image Automatic Signing Key (2012) <[email protected]>" not changed
gpg: key 871920D1991BC93C: 1 signature not checked due to a missing key
gpg: key 871920D1991BC93C: "Ubuntu Archive Automatic Signing Key (2018) <[email protected]>" not changed
gpg: Total number processed: 3
gpg:              unchanged: 3
�[0m�[39m�[2m * Running apt-get update...�[21m�[0m
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.
�[0m�[39m�[2m * Registering apt packages to install�[21m�[0m
�[0m�[39m�[2m ▷ Running �[0m�[1m�[0;38;5;5mregister_apt_packages�[21m�[0m�[39m�[2m hook�[21m�[0m
�[0;38;5;2m ✔ Finished �[0m�[1m�[0;38;5;5mregister_apt_packages�[21m�[0;38;5;2m hook in �[0m�[0m�[1m�[0;38;5;5m0s�[21m�[0m�[0m
�[0m�[39m�[2m * Main packages check and install.�[21m�[0m
�[0m�[39m�[2m * Checking for apt packages to remove.�[21m�[0m
�[0m�[39m�[2m * No apt packages to remove�[21m�[0m
�[0m�[39m�[2m * Checking for apt packages to install.�[21m�[0m
�[0m�[39m�[2m * No apt packages to install�[21m�[0m
�[0m�[39m�[2m * Running after_packages�[21m�[0m
�[0m�[39m�[2m ▷ Running �[0m�[1m�[0;38;5;5mafter_packages�[21m�[0m�[39m�[2m hook�[21m�[0m
false
false
�[0m�[39m�[2m * Adding Mailhog service file�[21m�[0m
�[0m�[39m�[2m * Enabling MailHog Service�[21m�[0m
�[0m�[39m�[2m * Starting MailHog Service�[21m�[0m
�[0m�[39m�[2m * Started MailHog Service�[21m�[0m
�[0m�[39m�[2m * Checking for NVM�[21m�[0m
�[0;38;5;2m ✓ NVM is already installed, checking for updates�[0m�[0m
fatal: unable to access 'https://github.com/nvm-sh/nvm.git/': Could not resolve host: github.com
�[0;38;5;9m ! The �[0m�[1m�[0;38;5;5m'main'�[21m�[0;38;5;9m provisioner ran into problems, the full log is available at �[0m�[1m�[0;38;5;5m'/var/log/provisioners/2024.06.11_13-49-05/provisioner-main.log'�[21m�[0;38;5;9m. It completed in �[0m�[1m�[0;38;5;5m161�[21m�[0;38;5;9m seconds.�[0m�[0m
---
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)

Your Environment

Operating System: Windows


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

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

Copy link

welcome bot commented Jun 11, 2024

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
Copy link
Member

tomjn commented Jun 11, 2024

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
Copy link
Member

tomjn commented Jun 11, 2024

You should also be able to replace all of these:

    nginx_upstream: php83

With these:

    php: 8.3

@adamo
Copy link
Author

adamo commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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 #2662 which links to a howto, I also attempted to automate this with #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
Copy link
Author

adamo commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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
Copy link
Author

adamo commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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
Copy link
Author

adamo commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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
Copy link
Author

adamo commented Jun 12, 2024

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

@tomjn
Copy link
Member

tomjn commented Jun 12, 2024

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

@adamo
Copy link
Author

adamo commented Jun 12, 2024

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
Copy link
Member

tomjn commented Jun 12, 2024

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

@adamo
Copy link
Author

adamo commented Jun 13, 2024

This is how it looks

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

@tomjn
Copy link
Member

tomjn commented Jun 13, 2024

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

@tomjn
Copy link
Member

tomjn commented Jun 13, 2024

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
Copy link
Author

adamo commented Jun 13, 2024

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

  • checked /etc/hosts file weight
  • it was 90 mb (much too much)
  • copied /etc/hosts.old
  • pased in a template of /etc/hosts for ubuntu
  • restart

It works.

Thank you @tomjn for all the help.

@tomjn
Copy link
Member

tomjn commented Jun 13, 2024 via email

@adamo
Copy link
Author

adamo commented Jun 13, 2024

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

@tomjn
Copy link
Member

tomjn commented Jun 13, 2024

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
Copy link
Member

tomjn commented Jun 13, 2024

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:

function cleanup_vvv(){

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

if [[ -z "$(grep -q "^127.0.0.1 ${line}$" /etc/hosts)" ]]; then

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
Copy link
Member

tomjn commented Jun 13, 2024

I've created a PR here:

#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
Copy link
Member

tomjn commented Jun 13, 2024

@tomjn
Copy link
Member

tomjn commented Jun 15, 2024

@adamo can you test the PR at #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
Copy link
Member

tomjn commented Jun 16, 2024

Closing this now that #2708 is merged

@tomjn tomjn closed this as completed Jun 16, 2024
@adamo
Copy link
Author

adamo commented Jun 17, 2024

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
Copy link
Member

tomjn commented Jun 17, 2024

@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
Copy link
Author

adamo commented Jun 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants