Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] Distrobox v1.2.15 fails during initialization of containers, on OpenSUSE Leap 15.3 and Podman v3.4.4 #287

Closed
massimo-zaniboni opened this issue May 24, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@massimo-zaniboni
Copy link
Contributor

Describe the bug

Distrobox v1.2.15 fails during initialization of containers, on OpenSUSE Leap 15.3 and Podman v3.4.4

I tried also Distrobox v1.2.16 with fix268 branch.

I will include the logs of Distrobox v1.2.16 with fix268 branch, because it is the version I installed now. If a new branch will be provided, I will test it.

To Reproduce

distrobox-create -i registry.opensuse.org/opensuse/tumbleweed:latest -n test3
distrobox-enter --verbose -n test3 2> test3.log

It interrupts the container initialization after 1s, with an error message.

Expected behavior

Correct container initialization.

Logs
test3.log

podman logs test3
Error: initial journal cursor: failed to get cursor: cannot assign requested address

Desktop (please complete the following information):

cat /etc/os-release 
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
podman info
host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.30-150300.8.3.1.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.30, commit: unknown'
  cpus: 2
  distribution:
    distribution: '"opensuse-leap"'
    version: "15.3"
  eventLogger: journald
  hostname: "70"
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 100
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.3.18-150300.59.68-default
  linkmode: dynamic
  logDriver: journald
  memFree: 2062200832
  memTotal: 4116885504
  ociRuntime:
    name: runc
    package: runc-1.0.3-27.1.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.3
      spec: 1.0.2-dev
      go: go1.16.10
      libseccomp: 2.5.3
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_AUDIT_WRITE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_MKNOD,CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /etc/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-0.4.7-3.15.1.x86_64
    version: |-
      slirp4netns version 0.4.7
      commit: unknown
      libslirp: 4.3.1-git
  swapFree: 2148507648
  swapTotal: 2148507648
  uptime: 6m 49.77s
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.opensuse.org
  - docker.io
store:
  configFile: /home/mzan/.config/containers/storage.conf
  containerStore:
    number: 3
    paused: 0
    running: 1
    stopped: 2
  graphDriverName: btrfs
  graphOptions: {}
  graphRoot: /home/mzan/.local/share/containers/storage
  graphStatus:
    Build Version: 'Btrfs v4.19.1 '
    Library Version: "102"
  imageStore:
    number: 1
  runRoot: /run/user/1000/containers
  volumePath: /home/mzan/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.4
  Built: 1653134400
  BuiltTime: Sat May 21 14:00:00 2022
  GitCommit: ""
  GoVersion: go1.13.15
  OsArch: linux/amd64
  Version: 3.4.4

I tried also under ext4. Same problem.

@massimo-zaniboni massimo-zaniboni added the bug Something isn't working label May 24, 2022
@89luca89
Copy link
Owner

@massimo-zaniboni can you try latest fix286 commit?

@89luca89
Copy link
Owner

@massimo-zaniboni a fix has been pushed for #286 to latest main, can you check if it fixes also problems for you?

@89luca89
Copy link
Owner

Ah @massimo-zaniboni seeing this:

podman logs test3
Error: initial journal cursor: failed to get cursor: cannot assign requested address

This is a problem in podman configuration, that's why it exits instantly
Nothing really to do with distrobox, that command should work in order for distrobox to work properly

@89luca89
Copy link
Owner

This issue is similar to this: containers/podman#10987

Create the file ~/.config/containers/containers.conf and add

.config/containers/containers.conf 
[containers]
log_driver = "k8s-file"
[engine]
events_logger = "file"

Then destroy the container test3 and try again, it's working on my Leap VM now

@massimo-zaniboni
Copy link
Contributor Author

Create the file ~/.config/containers/containers.conf and add

Wow!!! This was the solution.

If podman is giving log errors, then distrobox cannot initialize correctly the container. I tried with distrobox lastest fixed version now on GitHub, and also with the official version on SUSE repository.

podman logs test3
Error: initial journal cursor: failed to get cursor: cannot assign requested address

If I fix the error of podman with

.config/containers/containers.conf 
[containers]
log_driver = "k8s-file"
[engine]
events_logger = "file"

then distrobox works correctly. Works correctly both the old version on SUSE repository, and the current version on GitHub with last fixes.

podman logs test4

[...]
+ mkdir -p /home/mzan/.local/share/themes
+ mkdir -p /home/mzan/.local/share/icons
+ mkdir -p /home/mzan/.local/share/fonts
+ chown 1000:100 /home/mzan/.local
+ chown 1000:100 /home/mzan/.local/share
+ chown 1000:100 /home/mzan/.local/share/themes
+ chown 1000:100 /home/mzan/.local/share/icons
+ chown 1000:100 /home/mzan/.local/share/fonts
+ mount_bind /run/host/usr/share/themes /home/mzan/.local/share/themes rw
+ source_dir=/run/host/usr/share/themes
+ target_dir=/home/mzan/.local/share/themes
+ mount_flags=rw
+ '[' -d /run/host/usr/share/themes ']'
+ '[' -d /run/host/usr/share/themes ']'
+ mkdir -p /home/mzan/.local/share/themes
+ '[' rw = '' ']'
+ mount --rbind -o rw /run/host/usr/share/themes /home/mzan/.local/share/themes
+ return 0
+ mount_bind /run/host/usr/share/icons /home/mzan/.local/share/icons rw
+ source_dir=/run/host/usr/share/icons
+ target_dir=/home/mzan/.local/share/icons
+ mount_flags=rw
+ '[' -d /run/host/usr/share/icons ']'
+ '[' -d /run/host/usr/share/icons ']'
+ mkdir -p /home/mzan/.local/share/icons
+ '[' rw = '' ']'
+ mount --rbind -o rw /run/host/usr/share/icons /home/mzan/.local/share/icons
+ return 0
+ mount_bind /run/host/usr/share/fonts /home/mzan/.local/share/fonts rw
+ source_dir=/run/host/usr/share/fonts
+ target_dir=/home/mzan/.local/share/fonts
+ mount_flags=rw
+ '[' -d /run/host/usr/share/fonts ']'
+ '[' -d /run/host/usr/share/fonts ']'
+ mkdir -p /home/mzan/.local/share/fonts
+ '[' rw = '' ']'
+ mount --rbind -o rw /run/host/usr/share/fonts /home/mzan/.local/share/fonts
+ return 0
+ eval
+ printf 'container_setup_done\n'
container_setup_done
+ '[' 0 -eq 0 ']'
+ sleep infinity

If I perform podman info these are the differences

diff -uN podman-log-error.info podman-log-correct.info

--- podman-log-error.info       2022-05-24 15:21:56.601128466 +0200
+++ podman-log-correct.info     2022-05-24 15:25:24.461420348 +0200
@@ -12,7 +12,7 @@
   distribution:
     distribution: '"opensuse-leap"'
     version: "15.3"
-  eventLogger: journald
+  eventLogger: file
   hostname: "70"
   idMappings:
     gidmap:
@@ -31,8 +31,8 @@
       size: 65536
   kernel: 5.3.18-150300.59.68-default
   linkmode: dynamic
-  logDriver: journald
-  memFree: 2793336832
+  logDriver: k8s-file
+  memFree: 2353111040
   memTotal: 4116885504
   ociRuntime:
     name: runc
@@ -63,7 +63,7 @@
       libslirp: 4.3.1-git
   swapFree: 2148507648
   swapTotal: 2148507648
-  uptime: 15m 22.39s
+  uptime: 18m 50.25s
 plugins:
   log:
   - k8s-file
@@ -81,9 +81,9 @@
 store:
   configFile: /home/mzan/.config/containers/storage.conf
   containerStore:
-    number: 1
+    number: 2
     paused: 0
-    running: 1
+    running: 2
     stopped: 0
   graphDriverName: btrfs
   graphOptions: {}

@89luca89
Copy link
Owner

Perfect, I'll close this and open a bug on Opensuse leap bug tracker to check if they can set this behavior as default

@massimo-zaniboni
Copy link
Contributor Author

Summing up:

  • older and newer version of Distrobox are running correctly if the podman logger is well configured;
  • in a plain installation on SUSE Leap, the problem is still present, because podman logging is not configured correctly;
  • on SUSE Tumbleweed, in a plain installation, the podman log is correctly configured;
  • probably in Tumbleweed, it was not working for @dfaggioli because the podman log was misconfigured;

@89luca89
Copy link
Owner

Yes, it was a similar but different problem for TW, which I could play around making distrobox more resilient

Could not do much for this one on Leap

I saw you already opened a bug to Opensuse: https://bugzilla.opensuse.org/show_bug.cgi?id=1199790

I've opened a new one regarding general Podman here: https://bugzilla.opensuse.org/show_bug.cgi?id=1199871

Solvind mine, should solve yours

@dfaggioli
Copy link
Collaborator

* probably in Tumbleweed, it was not working for @dfaggioli because the podman log was misconfigured;

I see the same behavior on (my) Tumbleweed. Fact is (and now, I even remember having done that) I did switch manually to k8s-file.

Problem is that, with k8s-file, it's rootless podman logs -f <container> that does not work :-(

@89luca89
Copy link
Owner

* probably in Tumbleweed, it was not working for @dfaggioli because the podman log was misconfigured;

I see the same behavior on (my) Tumbleweed. Fact is (and now, I even remember having done that) I did switch manually to k8s-file.

Problem is that, with k8s-file, it's rootless podman logs -f <container> that does not work :-(

Yea, you also have to set the events_logger to file to make it work, but you need to recreate the containers which is a bummer...

Anyway now with latest fix at least distrobox does not rely on --follow anymore 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants