nestybox / sysbox

An open-source, next-generation "runc" that empowers rootless containers to run workloads such as Systemd, Docker, Kubernetes, just like VMs.
Apache License 2.0
2.78k stars 152 forks source link

GLibC issue on Ubuntu 20.04.2 LTS (Focal Fossa) #271

Closed AlexTalker closed 3 years ago

AlexTalker commented 3 years ago

This issue is a result of debugging of a problem initially described in https://github.com/nestybox/sysbox/issues/269#issuecomment-824755263

It seems that if I take image https://hub.docker.com/r/nestybox/archlinux-systemd it will install - OK But if you ran pacman -Syu, it will not run next time and pacman gonna give out the error:

[root@2842958c9444 /]# pacman
error: failed to initialize alpm library
(could not find or read directory: /var/lib/pacman/)

This is just the tip of the iceberg and most or all of the commands will not work since that point(besides bash I think).

The issue can be minimized to following use-case:

  1. When you enter the container, there's no vim and if one installs it, it gives an error:
    [root@25f4d0b16571 /]# vim
    vim: /usr/lib/libc.so.6: version `GLIBC_2.33' not found (required by vim)
  2. Then run pacman -Sy glibc and install new version
  3. The issue is reproduced

Original glibc package:

[root@2842958c9444 /]# pacman -Qi glibc
Name            : glibc
Version         : 2.32-5
Description     : GNU C Library
Architecture    : x86_64
URL             : https://www.gnu.org/software/libc
Licenses        : GPL  LGPL
Groups          : None
Provides        : None
Depends On      : linux-api-headers>=4.10  tzdata  filesystem
Optional Deps   : gd: for memusagestat
Required By     : argon2  attr  base  bash  bzip2  coreutils  device-mapper  expat  file  findutils  gawk  gcc-libs  gnupg  grep  gzip  iproute2  json-c  kbd  keyutils  kmod
                  less  libcap  libcap-ng  libffi  libgpg-error  libksba  libmnl  libnfnetlink  libnghttp2  libnl  libp11-kit  libpcap  libseccomp  libtasn1  libunistring
                  libxcrypt  lz4  ncurses  openssl  pacman  pam  pciutils  popt  readline  sed  systemd-libs  tar  which  zlib
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 46.16 MiB
Packager        : Jelle van der Waa <jelle@archlinux.org>
Build Date      : Wed 14 Oct 2020 05:00:17 PM UTC
Install Date    : Wed 20 Jan 2021 06:55:58 PM UTC
Install Reason  : Installed as a dependency for another package
Install Script  : Yes
Validated By    : Signature

New package:

[root@2842958c9444 /]# pacman -Si glibc
Repository      : core
Name            : glibc
Version         : 2.33-4
Description     : GNU C Library
Architecture    : x86_64
URL             : https://www.gnu.org/software/libc
Licenses        : GPL  LGPL
Groups          : None
Provides        : None
Depends On      : linux-api-headers>=4.10  tzdata  filesystem
Optional Deps   : gd: for memusagestat
Conflicts With  : None
Replaces        : None
Download Size   : 9.84 MiB
Installed Size  : 46.04 MiB
Packager        : Allan McRae <allan@archlinux.org>
Build Date      : Sat 13 Feb 2021 09:39:21 PM UTC
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Focal has:

libc-ares2/focal,now 1.15.0-1build1 amd64 [installed,automatic]
libc-bin/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed]
libc-dev-bin/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed]
libc6-dbg/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed]
libc6-dev-i386/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed,automatic]
libc6-dev-x32/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed,automatic]
libc6-dev/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed]
libc6-dev/focal-updates,now 2.31-0ubuntu9.2 i386 [installed,automatic]
libc6-i386/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed,automatic]
libc6-x32/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed,automatic]
libc6/focal-updates,now 2.31-0ubuntu9.2 amd64 [installed]
libc6/focal-updates,now 2.31-0ubuntu9.2 i386 [installed,automatic]

If I create a container from the same image but on runc, updating glibc does not lead to such issue(and systemd does not work, obviously).

Any ideas how to get around the issue? @ctalledo @rodnymolina

EDIT: Extra data from original comment:

Welcome to Arch Linux!

Failed to create /init.scope control group: Operation not permitted

Failed to allocate manager object: Operation not permitted

[!!!!!!] Failed to allocate manager object.

Exiting PID 1...
ctalledo commented 3 years ago

Let's track this via issue #273.

Closing here.