Solucionado (ver solução)
Solucionado
(ver solução)
7
respostas

Erro ao rodar vagrant up

Bom dia, uso o windows 10, virtual box 6.1 e vagrant 2.2. Extrai os arquivos informados na aula, acessei a pasta e rodei os comando abaixo que resultaram no erro a seguir. Já exclui a VM, rodei vagrant destroy, desisntalei o VB, instalei de novo, testei no CMD e continua a mesma coisa.

C:\Users\ricardo.uehlein\Documents\Alura\Jenkins Docker\1110-aula-inicial
λ vagrant plugin install vagrant-disksize
Installing the 'vagrant-disksize' plugin. This can take a few minutes...
Installed the plugin 'vagrant-disksize (0.1.3)'!

C:\Users\ricardo.uehlein\Documents\Alura\Jenkins Docker\1110-aula-inicial
λ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/bionic64' version '20200922.0.0' is up to date...
==> default: Setting the name of the VM: 1110-aula-inicial_default_1601483291951_11335
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: You are trying to forward to privileged ports (ports <= 1024). Most
==> default: operating systems restrict this to only privileged process (typically
==> default: processes running as an administrative user). This is a warning in case
==> default: the port forwarding doesn't work. If any problems occur, please try a
==> default: port higher than 1024.
==> default: Forwarding ports...
    default: 81 (guest) => 81 (host) (adapter 1)
    default: 80 (guest) => 80 (host) (adapter 1)
    default: 3306 (guest) => 3306 (host) (adapter 1)
    default: 8080 (guest) => 8080 (host) (adapter 1)
    default: 9000 (guest) => 9000 (host) (adapter 1)
    default: 19999 (guest) => 19999 (host) (adapter 1)
    default: 9001 (guest) => 9001 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Resized disk: old 10240 MB, req 30720 MB, new 30720 MB
==> default: You may need to resize the filesystem from within the guest.
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
7 respostas

Olá Ricardo, tudo bem? A principio ele deu um aviso sobre as portas, mas tudo bem nessa parte, porém o que me chama a atenção são as interfaces de rede:

default: Adapter 1: nat
default: Adapter 2: hostonly

Só está sendo exibido essas duas interfaces e penso que deveriam ser mais interfaces fora que a de rede padrão pela qual essa máquina vai poder fazer o acesso a internet (é a mesma que sua máquina física faz o acesso) não aparece, então você poderia verificar essas interfaces no VirtualBox e falar pra gente se tem mais interfaces ou não?

Fico aguardando retorno!

Obrigado Jonilson, validei no VB e só apareceu esses dois adaptadores de rede. Em todo caso exclui a VM e os arquivos da aula. Extrai e rodei novamente os dois comandos: vagrant plugin install vagrant-disksize vagrant up Neste último ocorreu outro erro desta vez:

/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
    default: update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
    default: Setting up openjdk-8-jre:amd64 (8u265-b01-0ubuntu2~18.04) ...
    default: update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode
    default: Setting up openjdk-8-jdk:amd64 (8u265-b01-0ubuntu2~18.04) ...
    default: update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
    default: update-alternatives:
    default: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
    default: Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.36.11-2) ...
    default: Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Running provisioner: shell...
    default: Running: inline script
    default: # Executing docker install script, commit: 26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c
    default: + sh -c apt-get update -qq >/dev/null
    default: +
    default: sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
    default: + sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null
    default: Warning: apt-key output should not be parsed (stdout is not a terminal)
    default: + sh -c echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" > /etc/apt/sources.list.d/docker.list
    default: +
    default: sh -c apt-get update -qq >/dev/null
    default: + [ -n  ]
    default: + sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
    default: E
    default: :
    default: Failed to fetch https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_19.03.13~3-0~ubuntu-bionic_amd64.deb  Hash Sum mismatch
    default:
    default: Hashes of expected file:
    default:
    default:  - SHA512:61aec43b9e1517233d77f244d8080430f91b69c1777603bedac383ca1fae824c595c74ab76a098699b95067b5c3a2846fdf7dba6a481aeaf771944d952c5d4e4
    default:     - SHA256:5e38680a142bc11cd492b25ce94df4fde5fe0e1ca36eb865e01454358f13d55a
    default:     - SHA1:7632267ad6552b765829efb7acb27a12285151fb [weak]
    default:     - MD5Sum:f4850b6a9592d77d980f468f25ecec6c [weak]
    default:     - Filesize:22537734 [weak]
    default:    Hashes of received file:
    default:     - SHA512:ad820d565e4c32c0311bf55dc6379a799d2b0d12140b12253d09c0ee46f9eb86d525c00cb3929bde7bc1d58236fb5d802a53b8f0c9cf78fbe59c6bb5f32ccc12
    default:     - SHA256:5ec66418fac6ad2828a84af165da6324e82ea9b93602e818ef2f9cfb87cb2c0a
    default:     - SHA1:a3d2f61c210823f5b698d5ea251250ec3c8c9e58 [weak]
    default:     - MD5Sum:0153454a346e209c6ccb81cced7fe75f [weak]
    default:     - Filesize:22537734 [weak]
    default:    Last modification reported: Mon, 21 Sep 2020 18:14:05 +0000
    default: E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    default: /vagrant/scripts/docker.sh: 6: /vagrant/scripts/docker.sh: docker: not found
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Pra tirar a dúvida, mesmo com esse último erro to conseguindo seguir os comandos usados no curso: vagrant ssh banco mysql e usuários foram instalados

Por enquanto está funcionando normalmente. Caso aconteça alguma coisa eu mando aqui no fórum.

Ocorreu erro kkk ao instalar o jenkins

vagrant@ubuntu-bionic:/vagrant/scripts$ sudo ./jenkins.sh
OK
Hit:1 https://download.docker.com/linux/ubuntu bionic InRelease
Ign:2 https://pkg.jenkins.io/debian-stable binary/ InRelease
Get:3 https://pkg.jenkins.io/debian-stable binary/ Release [2044 B]
Get:4 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [833 B]
Ign:4 https://pkg.jenkins.io/debian-stable binary/ Release.gpg
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:6 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Reading package lists... Done
W: GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FCEF32E745F2C3D5
E: The repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package jenkins is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'jenkins' has no installation candidate
solução!

Quanto ao erro na instalação do Jenkins isso me parece que é porque os repositórios do Jenkins mudaram de lugar e agora para instalar você precisa usar o seguinte script:

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
    /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

Então você pode abrir o arquivo jenkins disponibilizado pelo professor e substituir o conteúdo por esse script que informei acima.

Já sobre o erro na execução da máquina virtual, tenho visto muitas pessoas relatando isso e falando que só acontece nas versões mais recentes do VirtualBox, então você poderia tentar desintalar o VirtualBox e instalar a versão 6, que é a versão que utilizo e tentar novamente?

Uma dica, como você está no Windows, então enquanto estiver utilizando o VirtualBox deixa um Hyper-V do Windows desabilitado para evitar conflitos!

Pra testar de verdade desinstalei tudo. Instalei o VirtualBox 6.0, o Hyper-V já estava desabilitado. Não deu o erro ao rodar vagrant up. Testei com o jenkins.sh do arquivo fornecido pelo professor no curso, ainda deu erro. Testei com esse cósigo que você passou e agora deu sucesso. Aparentemente não tem mais nenhum erro. Muito obrigado Jonilson.

Fico muito feliz em ajudar! E achei bem legal você ter repassado todo o passo a passo que você realizou para solucionar o erro! Sendo assim você poderia marcar minha resposta como solução desse tópico? Assim vai estar ajudando outras pessoas caso passem pelo mesmo problema!