Hello,
I migrated to incus a while back. It worked as intended. I haven’t had to create a new container since yesterday. When I did, it failed with this issue. As my /etc/subuid
and /etc/subgid
were messy, I cleared them and added root:1000000:1000000000
to them.
So far so good I could create new containers. I then rebooted the host and one container would not start with error :
level=error msg="Failed to auto start instance" err="Failed to handle idmapped storage: invalid argument - Failed to change ACLs on /var/lib/incus/storage-pools/default/containers/hass/rootfs/var/log/journal" instance=hass project=default
So I mounted the ZFS dataset and deleted that /rootfs/var/log/journal
directory. Started the container again, after remapping, it started.
I now have an issue with all files with numeric UID. For example instead of root:root, I have 1000000:1000000.
Here is the container’s config before the remapping :
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 20.04 LTS amd64 (release) (20200720)
image.label: release
image.os: ubuntu
image.release: focal
image.serial: "20200720"
image.version: "20.04"
security.nesting: "true"
security.syscalls.intercept.mknod: "true"
security.syscalls.intercept.setxattr: "true"
user.network-config: " \n version: 2\n ethernets:\n eth0:\n dhcp6: no\n
\ dhcp4: yes"
user.user-data: |-
#cloud-config
runcmd:
- hostnamectl set-hostname hass.[readacted domain]
- echo "postfix postfix/mailname string hass.[readacted domain]" | debconf-set-selections
- echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
- apt-get install --assume-yes mailutils
- postconf -e "inet_interfaces = loopback-only"
- echo root:maintenance@[readacted domain] >> /etc/aliases
- newaliases
- systemctl reload postfix
- [sh, -c, "cat >> /root/.bashrc <<EOF\nif [ -f /etc/bash_completion ] && ! shopt -oq posix;\nthen\n . /etc/bash_completion\nfi\n\nEOF" ]
volatile.base_image: 0a4f3d88ed1c0e0d34c0f1e9be71b5dd73dc3de81a1e139b0ecd4e0faa958a30
volatile.cloud-init.instance-id: 24b87d5a-d348-4a6d-8e19-8c6a1ad3ac3c
volatile.eth0.hwaddr: 00:16:3e:21:4f:11
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.power: RUNNING
volatile.uuid: 4b899469-e03b-4370-890e-a46f5c8147ef
volatile.uuid.generation: 4b899469-e03b-4370-890e-a46f5c8147ef
devices:
eth0:
ipv4.address: 10.39.199.26
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
ephemeral: false
profiles:
- default
- ubuntu
stateful: false
description: ""
Here is it now :
# incus config show --expanded hass
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 20.04 LTS amd64 (release) (20200720)
image.label: release
image.os: ubuntu
image.release: focal
image.serial: "20200720"
image.version: "20.04"
security.nesting: "true"
security.syscalls.intercept.mknod: "true"
security.syscalls.intercept.setxattr: "true"
user.network-config: " \n version: 2\n ethernets:\n eth0:\n dhcp6: no\n
\ dhcp4: yes"
user.user-data: |-
#cloud-config
runcmd:
- hostnamectl set-hostname hass.[readacted domain]
- echo "postfix postfix/mailname string hass.[readacted domain]" | debconf-set-selections
- echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
- apt-get install --assume-yes mailutils
- postconf -e "inet_interfaces = loopback-only"
- echo root:maintenance@[readacted domain] >> /etc/aliases
- newaliases
- systemctl reload postfix
- [sh, -c, "cat >> /root/.bashrc <<EOF\nif [ -f /etc/bash_completion ] && ! shopt -oq posix;\nthen\n . /etc/bash_completion\nfi\n\nEOF" ]
user.vendor-data: |
#cloud-config
locale: fr_FR.UTF-8
timezone: Pacific/Noumea
## doing only update until package cloud-init is updated
## see: https://github.com/canonical/cloud-init/issues/5143
package_update: true
# package_upgrade: true
ntp:
enabled: true
ntp_client: systemd-timesyncd
servers:
- 0.oceania.pool.ntp.org
- 1.oceania.pool.ntp.org
- 2.oceania.pool.ntp.org
- 3.oceania.pool.ntp.org
- pool.ntp.org
- ntp.ubuntu.com
apt:
primary:
- arches: [default]
uri: http://nc.archive.ubuntu.com/ubuntu
conf: | # APT config
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
// Extended Security Maintenance; doesn't necessarily exist for
// every release and this system may not have it installed, but if
// available, the policy for updates is such that unattended-upgrades
// should also install from here by default.
"${distro_id}ESMApps:${distro_codename}-apps-security";
"${distro_id}ESM:${distro_codename}-infra-security";
"${distro_id}:${distro_codename}-updates";
"${distro_id}:${distro_codename}-proposed";
"${distro_id}:${distro_codename}-backports";
};
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
runcmd:
- [sh, -c, "cat >> /root/.bashrc <<EOF\nif [ -f /etc/bash_completion ] && ! shopt -oq posix;\nthen\n . /etc/bash_completion\nfi\n\nEOF" ]
volatile.base_image: 0a4f3d88ed1c0e0d34c0f1e9be71b5dd73dc3de81a1e139b0ecd4e0faa958a30
volatile.cloud-init.instance-id: 24b87d5a-d348-4a6d-8e19-8c6a1ad3ac3c
volatile.eth0.host_name: veth1c5f09ca
volatile.eth0.hwaddr: 00:16:3e:21:4f:11
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.power: RUNNING
volatile.last_state.ready: "false"
volatile.uuid: 4b899469-e03b-4370-890e-a46f5c8147ef
volatile.uuid.generation: 4b899469-e03b-4370-890e-a46f5c8147ef
devices:
eth0:
ipv4.address: 10.39.199.26
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:
- default
- ubuntu
stateful: false
description: ""
How can I please get out of this mess ?