Here is some information on how to reproduce this.
I use uvt-kvm, just as an easy way to get a remote system to work with.
I assume that any boot of xenial or yakkety will reproduce the problem.
The failure shows itself in a couple different ways:
a.) original report: apt-key add my.pubkey
This show error messages and exit non-zero.
b.) console error logs with cloud-init failing renames
Note, these will not get to /var/log/cloud-init.log due to where they
get raised.
OSError: [Errno 116] Stale file handle: '/var/lib/cloud/data/tmpj6uweivq'
-> '/var/lib/cloud/data/status.json'
c.) reproduce with atomic_write.py (see attached)
sudo ./atomic_write.py /var/lib/cloud/data/status.json
Very interestingly most file paths do not fail, but that one does.
4.2 (linux-virtual-lts-wily) passes, 4.4 fails (yakkety or xenial).
## Sync yakkety images to your uvt
uvt-simplestreams-libvirt -vv sync --source
http://cloud-images.ubuntu.com/daily 'release~yakkety'
## put the key in my.pubkey locally
cat > my.pubkey <<"EOF"
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.5
Comment: Hostname: keyserver.ubuntu.com
mI0ETxf8lwEEAMAqtJVUnlCVzjTOsohaE/M4mGHFl4Py1cuE9ryOgmTWje+6BrNjtWLSfTQJ
Kp1V6hViUoxPBck1qkZoAz7VU5nDuBWDybCsolliUX4zzTYNiDnPS74fs4CDUWx9qpl5Sdb6
7aygIid/mFXubhJnTPR6Bq9ptGmc0Ks6ttNs3WJ/ABEBAAG0IkxhdW5jaHBhZCBQUEEgZm9y
IE1hYVMgTWFpbnRhaW5lcnOIuAQTAQIAIgUCTxf8lwIbAwYLCQgHAwIGFQgCCQoLBBYCAwEC
HgECF4AACgkQXP8eqZPujMU2zQP/W9OCzaU7HvFrqEt6nHGej2PEanIunxo7J8D5OR+Yl578
FpRkHRgvcdQnGuZUpdBnOFatDDFME7ClN9qUrD1wDN1r9ip2luaKiO2cZOW4Uu5Z0n/3Qc6J
eh9TNspyDMuHVVZ5GiAk+GXgF1m7ps5lCnOCZK/pXUEEUOS8AWnt3sM=
=1RpZ
-----END PGP PUBLIC KEY BLOCK-----
EOF
# launch a guest
name="sm-y1"
uvt-kvm create "$name"
# wait for it to come up
uvt-kvm wait --insecure "$name"
# add the key file for easy use there.
uvt-kvm ssh --insecure "$name" "cat > my.pubkey" <<my.pubkey
# ssh in
uvt-kvm ssh --insecure "$name"
## add trusty and get wily kernel where this is not an issue.
## This installs us a 4.2.0 kernel (currently 4.2.0-42-generic)
% echo "deb http://archive.ubuntu.com/ubuntu trusty-updates main" | sudo tee -a
/etc/apt/sources.list.d/trusty.list
% sudo apt-get update -q
% sudo eatmydata apt-get install -qy -t trusty-updates linux-virtual-lts-wily
% ls /boot/vmlinuz*
/boot/vmlinuz-4.2.0-42-generic /boot/vmlinuz-4.4.0-36-generic
##
## make 'grub-reboot' work.
##
% sudo sed -i 's,^GRUB_DEFAULT=.*,GRUB_DEFAULT=saved,' /etc/default/grub
/etc/default/grub.d/*
% grep -r GRUB_DEFAULT /etc/default/grub /etc/default/grub.d/*
/etc/default/grub:GRUB_DEFAULT=saved
% sudo update-grub
% sudo grub-set-default 0
## Set grub to reboot into the kernel you want.
#
# Assuming you want kernel 4.4.0-36-generic, to boot into that do:
sudo sh -c 'grub-reboot "$0"' "Advanced options for Ubuntu>Ubuntu, with Linux
4.4.0-36-generic"
# if you're already in overlayfs, you need to modify the root
# so you need overlayroot-chroot
sudo overlayroot-chroot sh -c 'grub-reboot "$0"' "Advanced options for
Ubuntu>Ubuntu, with Linux 4.4.0-36-generic"
# then reboot
## Toggle overlayroot on or off
#
# to turn off:
sudo overlayroot-chroot rm /etc/overlayroot.local.conf
# to turn *on*
echo overlayroot=tmpfs:recurse=0 | sudo tee /etc/overlayroot.local.conf
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1618572
Title:
apt-key add fails in overlayfs
Status in cloud-init:
Confirmed
Status in linux package in Ubuntu:
Confirmed
Bug description:
Sending a custom APT config to cloud-init fails to:
1. add keys
2. configure sources
3. configura additional repository.
The same config is being sent to curtin, and curtin doesn't seem to
fail (curtin install log http://paste.ubuntu.com/23112826/ just in
case).
config sent by maas = http://pastebin.ubuntu.com/23112834/
cloud-init.log = http://paste.ubuntu.com/23112820/
cloud-init-output.log = http://paste.ubuntu.com/23112822/
sources.list = http://paste.ubuntu.com/23112824/
ubuntu@node03:/var/log$ ls -l /etc/apt/sources.list.d/
total 0
ubuntu@node03:/var/log$ sudo apt-get update
Hit:2 http://us.archive.ubuntu.com/ubuntu yakkety-updates InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu yakkety-backports InRelease [92.2
kB]
Err:2 http://us.archive.ubuntu.com/ubuntu yakkety-updates InRelease
The following signatures couldn't be verified because the public key is not
available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
Ign:3 http://us.archive.ubuntu.com/ubuntu yakkety-backports InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu yakkety-security InRelease
Get:1 http://us.archive.ubuntu.com/ubuntu yakkety InRelease [247 kB]
Err:4 http://us.archive.ubuntu.com/ubuntu yakkety-security InRelease
The following signatures couldn't be verified because the public key is not
available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
Err:1 http://us.archive.ubuntu.com/ubuntu yakkety InRelease
The following signatures couldn't be verified because the public key is not
available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
Fetched 339 kB in 0s (388 kB/s)
Reading package lists... Error!
W: An error occurred during the signature verification. The repository is not
updated and the previous index files will be used. GPG error:
http://us.archive.ubuntu.com/ubuntu yakkety-updates InRelease: The following
signatures couldn't be verified because the public key is not available:
NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://us.archive.ubuntu.com/ubuntu yakkety-backports
InRelease: The following signatures couldn't be verified because the public key
is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: The repository 'http://us.archive.ubuntu.com/ubuntu yakkety-backports
InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore
potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration
details.
W: An error occurred during the signature verification. The repository is not
updated and the previous index files will be used. GPG error:
http://us.archive.ubuntu.com/ubuntu yakkety-security InRelease: The following
signatures couldn't be verified because the public key is not available:
NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: An error occurred during the signature verification. The repository is not
updated and the previous index files will be used. GPG error:
http://us.archive.ubuntu.com/ubuntu yakkety InRelease: The following signatures
couldn't be verified because the public key is not available: NO_PUBKEY
40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: Failed to fetch
http://us.archive.ubuntu.com/ubuntu/dists/yakkety/InRelease The following
signatures couldn't be verified because the public key is not available:
NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: Failed to fetch
http://us.archive.ubuntu.com/ubuntu/dists/yakkety-updates/InRelease The
following signatures couldn't be verified because the public key is not
available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: Failed to fetch
http://us.archive.ubuntu.com/ubuntu/dists/yakkety-security/InRelease The
following signatures couldn't be verified because the public key is not
available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: Some index files failed to download. They have been ignored, or old ones
used instead.
E: Problem renaming the file /var/cache/apt/srcpkgcache.bin.3HKvbX to
/var/cache/apt/srcpkgcache.bin - rename (116: Stale file handle)
E: Problem renaming the file /var/cache/apt/pkgcache.bin.d0JUHJ to
/var/cache/apt/pkgcache.bin - rename (116: Stale file handle)
W: You may want to run apt-get update to correct these problems
E: The package cache file is corrupted
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1618572/+subscriptions
--
Mailing list: https://launchpad.net/~kernel-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help : https://help.launchpad.net/ListHelp