multiarch / qemu-user-static

:earth_africa: `/usr/bin/qemu-*-static`
https://hub.docker.com/r/multiarch/qemu-user-static/
MIT License
2.48k stars 230 forks source link

Unclean exit when registering with Docker ZFS storage driver #103

Open nightah opened 4 years ago

nightah commented 4 years ago

Is this a bug report, feature (enhancement) request or question? (leave only one on its own line)

/kind bug

Description:

Steps to reproduce the issue:

  1. Run docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

  2. Observe error:

    Unable to find image 'multiarch/qemu-user-static:latest' locally
    latest: Pulling from multiarch/qemu-user-static
    bdbbaa22dec6: Pull complete
    42399a41a764: Pull complete
    ed8a5179ae11: Pull complete
    1ec39da9c97d: Pull complete
    df7dd9470aac: Pull complete
    Digest: sha256:25d6e8bb037094525cd70da43edc06a62122028cb9ad434605affbd4fffb3a4f
    Status: Downloaded newer image for multiarch/qemu-user-static:latest
    Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
    Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
    Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
    Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
    Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
    Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
    Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
    Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
    Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
    Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
    Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
    Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
    Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
    Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
    Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
    Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
    Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
    Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
    Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
    Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
    Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
    Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
    Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
    Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
    Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
    Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
    Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
    Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
    Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
    ERRO[0024] Error waiting for container: container 8daa8a39dacdae857a57bbebe300c5871efe08626931741205b6e50a0a83dbd4: driver "zfs" failed to remove root filesystem: exit status 1: "/usr/bin/zfs fs destroy -r nerv/ROOT/arch/caeeb050ad4ee9a4c3c9b00e69472f75f09287ac95264dca8863801842880e84" => cannot destroy 'nerv/ROOT/arch/caeeb050ad4ee9a4c3c9b00e69472f75f09287ac95264dca8863801842880e84': dataset is busy

Describe the results you received: Above error is displayed when attempting to clean up the container.

Describe the results you expected: Clean container removal and no error upon running the command.

Environment:

Output of docker version, podman version or singularity version

Client:
 Version:           19.03.5-ce
 API version:       1.40
 Go version:        go1.13.4
 Git commit:        633a0ea838
 Built:             Fri Nov 15 03:19:09 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.5-ce
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.4
  Git commit:       633a0ea838
  Built:            Fri Nov 15 03:17:51 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.2.m
  GitCommit:        d50db0a42053864a270f648048f9a8b4f24eced3.m
 runc:
  Version:          1.0.0-rc9
  GitCommit:        d736ef14f0288d6993a1845745d6756cfc9ddd5a
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Additional information optionally: I have attempted this on multiple machines with a zfs storage driver and they all appear to be experiencing the same issue, I've even attempted older versions of QEMU as far back as v4.1.0-1 and can reproduce this issue.

clarkadamp commented 4 years ago

I have a similar situation

docker ps -a
CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS                      PORTS                                                              NAMES
a5a0856c14c4        multiarch/qemu-user-static                      "/register --reset -…"   15 seconds ago      Removal In Progress                                                                            confident_curran
$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
ERRO[0004] Error waiting for container: container a5a0856c14c4050a9e641d1c5d1ac84ca9f7563a5cfbf5f7778bb9c7ab6fe93b: driver "zfs" failed to remove root filesystem: exit status 1: "/usr/sbin/zfs fs destroy -r rpool/ROOT/ubuntu/35a77fad4a8683c275b5541985f6d85a7495a43071d3e4813f0d4c83c8e993c7" => cannot destroy 'rpool/ROOT/ubuntu/35a77fad4a8683c275b5541985f6d85a7495a43071d3e4813f0d4c83c8e993c7': dataset is busy
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:    20.04
Codename:   focal
docker version
Client:
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.13.8
 Git commit:        afacb8b7f0
 Built:             Tue Jun 23 22:26:12 2020
 OS/Arch:           linux/amd64
 Experimental:      true

Server:
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.8
  Git commit:       afacb8b7f0
  Built:            Thu Jun 18 08:26:54 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.3-0ubuntu2
  GitCommit:
 runc:
  Version:          spec: 1.0.1-dev
  GitCommit:
 docker-init:
  Version:          0.18.0
  GitCommit:

It requires a reboot of the server to allow the container and the underlying filesystems to be removed.

zbwu commented 3 years ago

I have a similar situation, too

docker 20.10.8 zfs 2.1.0 kernel 5.10 qemu 6.1.0

wasdee commented 2 years ago

I faced the same issue with Ubuntu 22.04 with ZFS.

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
Setting /usr/bin/qemu-hexagon-static as binfmt interpreter for hexagon
ERRO[0000] Error waiting for container: container 6906db6ce7955198f9ee791bc6b0ad203f88bcd28da90b0f55c4acd5e3e882f5: driver "zfs" failed to remove root filesystem: exit status 1: "/usr/sbin/zfs fs destroy -r rpool/ROOT/ubuntu_xoha67/var/lib/8d1b0ad3efa60ec72147b54bc3a2c2ae1aa3787c25ee6dc179448e3b3bcc159a" => cannot destroy 'rpool/ROOT/ubuntu_xoha67/var/lib/8d1b0ad3efa60ec72147b54bc3a2c2ae1aa3787c25ee6dc179448e3b3bcc159a': dataset is busy 
error: Recipe `setup-qemu` failed on line 250 with exit code 125
marcindulak commented 1 year ago

Ubuntu 22.04. I'm not sure it's relevant but I selected "Encrypt the new ubuntu installation for security" during the on-zfs installation. I've not encountered problems with other docker run --rm --privileged containers.

9cvele3 commented 1 year ago

Are there any updates on this ?