7 votos

Extraño los problemas de red con Vagrant, VirtualBox, Ansible y Ubuntu Server cuadro

Estamos usando Vagrant y Ansible a disposición de VirtualBox de la máquina.

Fue un gran trabajo, pero recientemente hemos comenzado a surgir algunos extraños problemas de red con las tareas que requieren el acceso a la Internet, como: apt-get update, composer update, gem install etc. Estos problemas surgen de vez en cuando y son inestables. A veces no se puede conectar a un servidor o nombre de dominio no está resolviendo.

Curiosamente, es cuando me conecto a la caja en sí a través de SSH (vagrant ssh) y emitir comandos manualmente como, por ejemplo sudo apt-get update; sudo apt-get dist-upgrade - funciona bien todo el tiempo.

Aquí está el error de muestreo con el MECANISMO nacional de prevención:

failed: [localhost] => {"cmd": "/usr/bin/npm install --global npm-check-updates", "failed": true, "rc": 1}
stderr: npm http GET https://registry.npmjs.org/npm-check-updates
npm http GET https://registry.npmjs.org/npm-check-updates
npm http GET https://registry.npmjs.org/npm-check-updates
npm ERR! network getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

Aquí está el error de muestreo con APT:

failed: [localhost] => {"failed": true, "parsed": false}
invalid output was: SUDO-SUCCESS-qryiheatxowjxtcfbzrnzercnnwxtmyv
Traceback (most recent call last):
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1405611978.79-161922279792225/apt", line 1762, in <module>
    main()
  File "/home/vagrant/.ansible/tmp/ansible-tmp-1405611978.79-161922279792225/apt", line 492, in main
    cache.update()
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 440, in update
    raise FetchFailedException(e)
apt.cache.FetchFailedException: W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/i18n/Translation-en_US  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/i18n/Translation-en  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/i18n/Translation-en_US.UTF-8  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/i18n/Translation-en_US  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/i18n/Translation-en  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/i18n/Translation-en_US.UTF-8  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/i18n/Translation-en_US  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/i18n/Translation-en  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/i18n/Translation-en_US.UTF-8  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/i18n/Translation-en_US  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/i18n/Translation-en  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/i18n/Translation-en_US.UTF-8  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/source/Sources  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/source/Sources  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/binary-i386/Packages  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/binary-i386/Packages  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/source/Sources  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/source/Sources  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-i386/Packages  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-i386/Packages  Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
, E:Some index files failed to download. They have been ignored, or old ones used instead.

Las versiones de Software:

  • ansible 1.6.6
  • Vagrant 1.6.3
  • VirtualBox 4.3.14

Estamos utilizando el siguiente cuadro:

http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box

Host del sistema operativo es Ubuntu 14.04.

Encontramos tales problemas con equipos diferentes, absolutamente en redes diferentes (diferentes ciudades).

¿Cuál puede ser la razón para esto? ¿Cómo podemos mejorarlo y corregirlo?

Actualización #1

Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# "2" is an API version here.
Vagrant.configure("2") do |config|

  config.vm.box = "trusty32"
  config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box"

  config.vm.hostname = "wa.local"
  config.vm.network "private_network", ip: "192.168.2.2"

  # Using NFS for now, cause native sharing is broken
  config.vm.synced_folder ".", "/vagrant", nfs: true

  # Provisioning
  config.vm.provision "ansible" do |ansible|
    ansible.host_key_checking = false
    ansible.inventory_path = "ansible/inventory.ini"
    ansible.playbook = "ansible/vagrant.yml"
    ansible.limit = "all"
  end

  # Provider Configuration: VirtualBox
  config.vm.provider :virtualbox do |vb|
    # Setting RAM to 1 GB
    vb.memory = 1024
    vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  end

end

Actualización #2

El problema se ha ido por ahora. Todavía no sé por qué ocurrió en el primer lugar. Tal vez la línea vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] que recientemente he añadido a Vagrantfile ayudado.

Gracias por todas las sugerencias!

1voto

Christopher Karel Puntos 4717

¿Tienes algún Prevención de Intrusiones Dispositivos o servidores de seguridad que podría estar causando problemas? He visto la automatización de los métodos de reglas de activación diseñado para luchar contra los bots. Numerosas conexiones puede ser malinterpretado como escaneos de puertos, la fuerza bruta de los intentos, etc. IDS/IPS/Firewalls empezarán a caer los paquetes, causando cosas extrañas a fallar sin una lógica clara de por qué. Estas reglas no se disparará cuando haces las cosas de forma manual, por lo que todo parece estar bien cuando solucione el problema.

EnMiMaquinaFunciona.com

EnMiMaquinaFunciona es una comunidad de administradores de sistemas en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros sysadmin, hacer tus propias preguntas o resolver las de los demás.

Powered by: