hashicorp/vagrant

"docker" provisioner fails on ubuntu/trusty64

Closed this issue ยท 8 comments

rhuss commented

vagrant up with a docker provisioning fails with the error below.

I suspect the reason is a missing apt-get update in docker_install.rb because if I do this manually before, the apt-get install works without problems.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: fabric8_default_1431075352387_45670
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> 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
    default: Warning: Connection timeout. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /Users/roland/Development/fabric8/fabric8
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: stdin: is not a tty
==> default: Running provisioner: docker...
    default: Installing Docker (latest) onto machine...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`

Stdout from the command:

Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  crda iw libnl-3-200 libnl-genl-3-200 wireless-regdb
The following NEW packages will be installed:
  crda iw libnl-3-200 libnl-genl-3-200 linux-image-extra-3.13.0-52-generic
  wireless-regdb
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 36.9 MB of archives.
After this operation, 153 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libnl-3-200 amd64 3.2.21-1 [44.5 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libnl-genl-3-200 amd64 3.2.21-1 [10.2 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main wireless-regdb all 2013.02.13-1ubuntu1 [6,456 B]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty/main crda amd64 1.1.2-1ubuntu2 [15.2 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty/main iw amd64 3.4-1 [51.7 kB]
Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-extra-3.13.0-52-generic amd64 3.13.0-52.85
  404  Not Found [IP: 91.189.91.13 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main linux-image-extra-3.13.0-52-generic amd64 3.13.0-52.85
  404  Not Found [IP: 91.189.91.14 80]
Fetched 128 kB in 1s (83.5 kB/s)


Stderr from the command:

stdin: is not a tty
modprobe: FATAL: Module aufs not found.
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-extra-3.13.0-52-generic_3.13.0-52.85_amd64.deb  404  Not Found [IP: 91.189.91.14 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

๐Ÿ‘ I can confirm the problem and solution

I added a || true to the end of line https://github.com/mitchellh/vagrant/blob/master/plugins/provisioners/docker/cap/debian/docker_install.rb#L13 and the installer kept chugging (Debian 8 + Linode, where AUFS nor installing a matching linux-image-extra package are possible). Since Docker is more than happy to work with devmapper perhaps this set of install commands should be made optional.

root@magicdust:/home/displague# docker info
Containers: 0
Images: 0
Storage Driver: devicemapper
 Pool Name: docker-202:0-131844-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 305.7 MB
 Data Space Total: 107.4 GB
 Data Space Available: 23.71 GB
 Metadata Space Used: 729.1 kB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.147 GB
 Udev Sync Supported: false
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.82-git (2013-10-04)
Execution Driver: native-0.2
Kernel Version: 4.0.1-x86_64-linode55
Operating System: Debian GNU/Linux 8 (jessie)
CPUs: 1
Total Memory: 988.4 MiB
Name: magicdust
ID: ...
WARNING: No memory limit support
WARNING: No swap limit support

๐Ÿ‘ same problem, and the PR #5786 fixed it for me

I also experience this problem.

I can confirm that running a shell provisioning with apt-get update
before config.vm.provision :docker do ... solves the issue, eg:
config.vm.provision :shell, inline: "sudo apt-get update"

@boutros, your fix worked perfectly!

Fixed!

+1 thanks for this.

Hi, I have been experiencing the same kind of issue, but I have been experiencing 3 different failures for the same spot in the code. I am kind of thinking this is an Ubuntu issue, as it is more or less reproducible with 4 different versions of ubuntu/trusty64 vagrant boxes.

Unauthenticated packages

Vagrant assumes that this means the command failed!

lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`

Stdout from the command:

Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  crda iw libnl-3-200 libnl-genl-3-200 wireless-regdb
The following NEW packages will be installed:
  crda iw libnl-3-200 libnl-genl-3-200 linux-image-extra-3.13.0-62-generic
  wireless-regdb
0 upgraded, 6 newly installed, 0 to remove and 5 not upgraded.
Need to get 36.9 MB of archives.
After this operation, 152 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  libnl-3-200 libnl-genl-3-200 wireless-regdb crda iw


Stderr from the command:

stdin: is not a tty
modprobe: FATAL: Module aufs not found.

Invalid GPG key

Vagrant assumes that this means the command failed!

apt-get update -y

Stdout from the command:

Ign http://archive.ubuntu.com trusty InRelease
Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://archive.ubuntu.com trusty-updates InRelease
Get:2 http://security.ubuntu.com trusty-security Release [63.5 kB]
Hit http://archive.ubuntu.com trusty Release.gpg
Get:3 http://archive.ubuntu.com trusty-updates Release.gpg [933 B]
Get:4 http://archive.ubuntu.com trusty Release [11.9 kB]
Get:5 http://security.ubuntu.com trusty-security/main Sources [93.7 kB]
Ign http://archive.ubuntu.com trusty Release
Get:6 http://archive.ubuntu.com trusty-updates Release [63.5 kB]
Get:7 http://security.ubuntu.com trusty-security/universe Sources [29.9 kB]
Get:8 http://archive.ubuntu.com trusty/main Sources [14 B]
Get:9 http://archive.ubuntu.com trusty/universe Sources [6,399 kB]
Get:10 http://security.ubuntu.com trusty-security/main amd64 Packages [339 kB]
Get:11 http://security.ubuntu.com trusty-security/universe amd64 Packages [115 kB]
Get:12 http://security.ubuntu.com trusty-security/main Translation-en [185 kB]
Get:13 http://security.ubuntu.com trusty-security/universe Translation-en [67.2 kB]
Ign http://archive.ubuntu.com trusty/main amd64 Packages/DiffIndex
Ign http://archive.ubuntu.com trusty/universe amd64 Packages/DiffIndex
Hit http://archive.ubuntu.com trusty/main Translation-en
Hit http://archive.ubuntu.com trusty/universe Translation-en
Get:14 http://archive.ubuntu.com trusty-updates/main Sources [232 kB]
Get:15 http://archive.ubuntu.com trusty-updates/universe Sources [134 kB]
Get:16 http://archive.ubuntu.com trusty-updates/main amd64 Packages [614 kB]
Get:17 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [309 kB]
Get:18 http://archive.ubuntu.com trusty-updates/main Translation-en [297 kB]
Get:19 http://archive.ubuntu.com trusty-updates/universe Translation-en [164 kB]
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Ign http://archive.ubuntu.com trusty/main Translation-en_US
Ign http://archive.ubuntu.com trusty/universe Translation-en_US
Fetched 9,120 kB in 12s (711 kB/s)


Stderr from the command:

stdin: is not a tty
W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

Apt-get fails to install a wireless dependency

Vagrant assumes that this means the command failed!

lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`

Stdout from the command:

Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-image-extra-3.13.0-62-generic : Depends: crda (>= 1.1.1-1ubuntu2) but it is not installable or
                                                wireless-crda but it is not going to be installed


Stderr from the command:

stdin: is not a tty
modprobe: FATAL: Module aufs not found.
E: Unable to correct problems, you have held broken packages.

Does anyone have an idea of why this would be failing?