Skip to content

[1.7.0-rc*] Data written to ZFS mounts isn't visible in host mounts #13775

Closed

Description

@burke

This is a weird one. I'll keep digging into this and flesh out the issue as I discover more, but:

I have this directory. It's a ZFS dataset.

root@borg2:/u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01# stat -f . | awk '/Type/ { print $NF }'
zfs
# zfs list | grep a929 | grep week
locutus/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01                                             47K   144G    28K  /u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01
locutus/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01/6ecddc3dd27d5645ec1a2153e7806f99fc1727e0    19K   144G    19K  /u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01/6ecddc3dd27d5645ec1a2153e7806f99fc1727e0

When I mount it into a container, the behaviour is quite different on 1.6.0 and 1.7.0, probably due to the Volumes refactor:

1.6.0:
root@0beae52c57ab:/app# grep zfs /proc/mounts
locutus/shopify-f744a0801011b8a849807d3b53df91e719e1bd5ad8523015d984be663482480f/weekof-2015-06-01 /test zfs rw,relatime,xattr,noacl 0 0
locutus/shopify-f744a0801011b8a849807d3b53df91e719e1bd5ad8523015d984be663482480f/weekof-2015-06-01/03f195f2b7f552b7fa8093364fcb4fc0727b574a /test/03f195f2b7f552b7fa8093364fcb4fc0727b574a zfs rw,relatime,xattr,noacl 0 0
root@0beae52c57ab:/app#

Note that here, we see nested volumes.

1.7.0:

For some volumes, depending on circumstances I haven't yet been able to figure out, we get this:

# grep zfs /proc/mounts
locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4 /test zfs rw,relatime,xattr,noacl 0 0
locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-01 /test/weekof-2015-06-01 zfs rw,relatime,xattr,noacl 0 0

i.e.: the same, and there is no issue.

In other cases, and again, no idea what causes this:

root@borg2:/u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01# docker run -it --entrypoint=/bin/bash -v $(pwd):/test:rw ba5e -l
root@1469d291f2af:/app# grep zfs /proc/mounts
locutus /test zfs rw,relatime,xattr,noacl 0 0
root@1469d291f2af:/app#

So note, here, that this directory is mounted on the host as a ZFS dataset, with the same behaviour on my 1.6.0 nodes and my 1.7.0 nodes. However, the 1.7.0 nodes sometimes bind it inside the containers as locutus (my zpool name) rather than the full dataset name.

There is some very interesting behaviour as a result of this:

root@borg2:/u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01# ls
6ecddc3dd27d5645ec1a2153e7806f99fc1727e0
root@borg2:/u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01# docker run -it --entrypoint=/bin/bash -v $(pwd):/test:rw ba5e -l
root@bde4abe26612:/app# touch /test/what
root@bde4abe26612:/app# logout
root@borg2:/u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01# ls
6ecddc3dd27d5645ec1a2153e7806f99fc1727e0
root@borg2:/u/apps/locutus/shared/zfs/shopify-a929cf7d522b5f094635fadbec2fbf96fc973c96764e35303e4bc80dc6974dea/weekof-2015-06-01# docker run -it --entrypoint=/bin/bash -v $(pwd):/test:rw ba5e -l
root@2ee6bbc4d492:/app# ls /test
6ecddc3dd27d5645ec1a2153e7806f99fc1727e0  what  wip-6ecddc3dd27d5645ec1a2153e7806f99fc1727e0.10704
root@2ee6bbc4d492:/app#

To summarize what's happened above:

  1. List files in dataset on host. Get ds/{a}.
  2. Mount dataset in new container. See ds/{a}. Create ds/{b} Now container sees ds/{a,b}.
  3. Exit container. List files on host. See ds/{a}.
  4. Start another container with the same mount. See ds/{a,b}.

What I would expect to see is that the writes from (2) are visible on the host in step 3. I think this is somehow very related to the incorrect-looking mount name in /proc/mounts. I would normally blame ZFS for this, but we have strong empirical evidence that this happens only on docker 1.7.0.

/cc @calavera

Activity

  1. burke commented on Jun 5, 2015

    @burke
    ContributorAuthor

    FWIW

    root@borg2:~# docker version
    Client version: 1.7.0-rc2
    Client API version: 1.19
    Go version (client): go1.4.2
    Git commit (client): 7ddecf7
    OS/Arch (client): linux/amd64
    Server version: 1.7.0-rc2
    Server API version: 1.19
    Go version (server): go1.4.2
    Git commit (server): 7ddecf7
    OS/Arch (server): linux/amd64
    
    root@borg2:~# docker info
    Containers: 7
    Images: 201
    Storage Driver: overlay
     Backing Filesystem: extfs
    Execution Driver: native-0.2
    Logging Driver: json-file
    Kernel Version: 3.18.8-031808-generic
    Operating System: Ubuntu 14.04.1 LTS
    CPUs: 16
    Total Memory: 125.9 GiB
    Name: borg2.ash.shopify.com
    ID: 4GMT:C2OP:QOAF:RTEV:CPKJ:CBAJ:ILJ3:FRIP:HKNQ:DLFA:VB5Q:UGLL
    WARNING: No memory limit support
    WARNING: No swap limit support
    
    root@borg2:~# uname -a
    Linux borg2.ash.shopify.com 3.18.8-031808-generic #201502271935 SMP Sat Feb 28 00:36:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    
  2. added this to the 1.7.0 milestone on Jun 5, 2015
  3. added
    kind/bug
    on Jun 5, 2015
  4. self-assigned this
    on Jun 5, 2015
  5. calavera commented on Jun 5, 2015

    @calavera
    Contributor

    oh, this is fun, thanks for open the issue!

    I'm going to have to investigate further because I don't see anything strange at first glance. The fact that the mounting name is incorrect makes me think that it's something beyond the new volumes code, but I'm sure it's affecting the behavior somehow.

  6. amylindburg commented on Jun 5, 2015

    @amylindburg
    Contributor

    burke -- thanks for testing rc2!!!

  7. calavera commented on Jun 8, 2015

    @calavera
    Contributor

    hey @burke I was wondering if you had time to investigate this further. I just ran a very simple test with zfs and I cannot see anything wrong. I'm pretty sure my configuration is very different to yours, so it would be awesome if you had more details about it:

    root@zfs-test:~# zpool create dockertest /tmp/zfs.img
    root@zfs-test:~# ./docker-1.7 run -v /dockertest:/data -it ubuntu bash
    root@b03fc0ed775c:/# touch /data/helo
    root@b03fc0ed775c:/# exit
    root@zfs-test:~# ls /dockertest/
    helo
    root@zfs-test:~# ./docker-1.7 run -v /dockertest:/data -it ubuntu bash
    root@c5e781a87925:/# ls /data/
    helo
    root@c5e781a87925:/#
    
  8. calavera commented on Jun 8, 2015

    @calavera
    Contributor

    I've also created a dataset inside my pool but it looks like it's still mounted as expected 😔

    root@zfs-test:~# zfs create dockertest/usr
    root@zfs-test:~# ls /dockertest/
    helo  usr
    root@zfs-test:~# zfs list
    NAME             USED  AVAIL  REFER  MOUNTPOINT
    dockertest        80K  1.95G    19K  /dockertest
    dockertest/usr    19K  1.95G    19K  /dockertest/usr
    root@zfs-test:~# ./docker-1.7 run -v /dockertest:/data -it ubuntu bash
    root@24de9d2ff5ca:/# grep zfs /proc/mounts
    dockertest /data zfs rw,relatime,xattr,noacl 0 0
    dockertest/usr /data/usr zfs rw,relatime,xattr,noacl 0 0
    root@24de9d2ff5ca:/# ls /data
    helo  usr
    root@24de9d2ff5ca:/#
    
  9. burke commented on Jun 8, 2015

    @burke
    ContributorAuthor

    I'll try to come up with a self-contained reproduction this afternoon.

  10. burke commented on Jun 8, 2015

    @burke
    ContributorAuthor

    This reproduces the problem on my system:

    host:~# truncate -s 100M /tmp/lol
    host:~# zpool create testzpool /tmp/lol
    host:~# stat -f / | awk '/Type:/ { print $NF }'
    ext2/ext3
    host:~# stat -f /testzpool | awk '/Type:/ { print $NF }'
    zfs
    host:~# touch /testzpool/on-host
    host:~# docker run -it -v /testzpool:/test:rw ubuntu:14.04
    container:~# ls -a /test
    . ..
    container:~# touch /test/in-container
    container:~# exit
    host:~# ls -a /testzpool
    . .. on-host
    host:~# umount /testzpool
    host:~# umount /testzpool
    host:~# ls -a /testzpool
    . .. in-container
    

    So it appears that the ZFS mount isn't detected when choosing an FS to bind in to the container FS. Possibly-relevant info:

    host:~# grep testz /proc/mounts
    testzpool /testzpool zfs rw,relatime,xattr,noacl 0 0
    
    container:~# cat /proc/mounts
    rootfs / rootfs rw 0 0
    overlay / overlay rw,relatime,lowerdir=/u/lib/docker/overlay/d0955f21bf24f5bfffd32d2d0bb669d0564701c271bc3dfc64cfc5adfdec2d07/root,upperdir=/u/lib/docker/overlay/dfee76565d733c3c400d2a0eb8c60f96e58da0e8a4970998627beb63495eec05/upper,workdir=/u/lib/docker/overlay/dfee76565d733c3c400d2a0eb8c60f96e58da0e8a4970998627beb63495eec05/work 0 0
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
    tmpfs /dev tmpfs rw,nosuid,mode=755 0 0
    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
    shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k 0 0
    mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
    sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
    /dev/mapper/lvroot-root /test ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
    /dev/mapper/lvroot-u /etc/resolv.conf ext4 rw,noatime,data=ordered 0 0
    /dev/mapper/lvroot-u /etc/hostname ext4 rw,noatime,data=ordered 0 0
    /dev/mapper/lvroot-u /etc/hosts ext4 rw,noatime,data=ordered 0 0
    devpts /dev/console devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
    proc /proc/bus proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/fs proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/irq proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/sys proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/sysrq-trigger proc ro,nosuid,nodev,noexec,relatime 0 0
    tmpfs /proc/kcore tmpfs rw,nosuid,mode=755 0 0
    tmpfs /proc/timer_stats tmpfs rw,nosuid,mode=755 0 0
    
  11. calavera commented on Jun 8, 2015

    @calavera
    Contributor

    mmmm Now I'm wondering if the problem is related to overlay. I just realized that that's the only difference in our setups. I copied your commands and it looks okay in my test vm:

    root@zfs-test:~# truncate -s 100M /tmp/lol
    root@zfs-test:~# zpool create testzpool /tmp/lol
    root@zfs-test:~# zpool create testzpool /tmp/lol
    root@zfs-test:~# stat -f / | awk '/Type:/ { print $NF }'
    ext2/ext3
    root@zfs-test:~# stat -f /testzpool | awk '/Type:/ { print $NF }'
    zfs
    root@zfs-test:~# touch /testzpool/on-host
    root@zfs-test:~# ./docker-1.7 run -it -v /testzpool:/test:rw ubuntu:14.04
    root@8c8c3f80a5bb:/# ls -a /test
    .  ..  on-host
    root@8c8c3f80a5bb:/# touch /test/in-container
    root@8c8c3f80a5bb:/# exit
    root@zfs-test:~# ls -a /testzpool
    .  ..  in-container  on-host
    root@zfs-test:~# umount /testzpool
    root@zfs-test:~# ls -a /testzpool
    .  ..
    root@zfs-test:~#
    
  12. burke commented on Jun 8, 2015

    @burke
    ContributorAuthor

    That did seem likely. However, I tried it and observed the same behaviour. This time:

    container:~# cat /proc/mounts
    rootfs / rootfs rw 0 0
    /dev/mapper/lvroot-u / ext4 rw,noatime,data=ordered 0 0
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
    tmpfs /dev tmpfs rw,nosuid,mode=755 0 0
    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
    shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k 0 0
    mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
    sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
    /dev/mapper/lvroot-root /test ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
    /dev/mapper/lvroot-u /etc/resolv.conf ext4 rw,noatime,data=ordered 0 0
    /dev/mapper/lvroot-u /etc/hostname ext4 rw,noatime,data=ordered 0 0
    /dev/mapper/lvroot-u /etc/hosts ext4 rw,noatime,data=ordered 0 0
    devpts /dev/console devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
    proc /proc/bus proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/fs proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/irq proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/sys proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/sysrq-trigger proc ro,nosuid,nodev,noexec,relatime 0 0
    tmpfs /proc/kcore tmpfs rw,nosuid,mode=755 0 0
    tmpfs /proc/timer_stats tmpfs rw,nosuid,mode=755 0 0
    
    host:~$ docker info
    Containers: 2
    Images: 4
    Storage Driver: vfs
    Execution Driver: native-0.2
    Logging Driver: json-file
    Kernel Version: 3.18.8-031808-generic
    Operating System: Ubuntu 14.04.1 LTS
    CPUs: 16
    Total Memory: 125.9 GiB
    Name: borg2.ash.shopify.com
    ID: 4GMT:C2OP:QOAF:RTEV:CPKJ:CBAJ:ILJ3:FRIP:HKNQ:DLFA:VB5Q:UGLL
    WARNING: No memory limit support
    WARNING: No swap limit support
    
    host:~$ docker version
    Client version: 1.7.0-rc2
    Client API version: 1.19
    Go version (client): go1.4.2
    Git commit (client): 7ddecf7
    OS/Arch (client): linux/amd64
    Server version: 1.7.0-rc2
    Server API version: 1.19
    Go version (server): go1.4.2
    Git commit (server): 7ddecf7
    OS/Arch (server): linux/amd64
    
    host:~$ uname -a
    Linux borg2.ash.shopify.com 3.18.8-031808-generic #201502271935 SMP Sat Feb 28 00:36:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    
    host:~$ grep testz /proc/mounts
    testzpool /testzpool zfs rw,relatime,xattr,noacl 0 0
    
  13. burke commented on Jun 8, 2015

    @burke
    ContributorAuthor

    So the weird thing, more concisely, is:

    invocation
    -v /testzpool:/test:rw
    
    host
    testzpool /testzpool zfs rw,relatime,xattr,noacl 0 0
    
    container
    /dev/mapper/lvroot-root /test ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
    
  14. calavera commented on Jun 8, 2015

    @calavera
    Contributor

    I don't understand anything, it looks like the mount is correct in my vm with overlay, the same kernel, and OS 😢

    root@zfs-test:~# docker version
    Client version: 1.7.0-rc2
    Client API version: 1.19
    Go version (client): go1.4.2
    Git commit (client): 7ddecf7
    OS/Arch (client): linux/amd64
    Server version: 1.7.0-rc2
    Server API version: 1.19
    Go version (server): go1.4.2
    Git commit (server): 7ddecf7
    OS/Arch (server): linux/amd64
    
    
    root@zfs-test:~# docker info
    Containers: 1
    Images: 4
    Storage Driver: overlay
     Backing Filesystem: extfs
    Execution Driver: native-0.2
    Logging Driver: json-file
    Kernel Version: 3.18.8-031808-generic
    Operating System: Ubuntu 14.04.2 LTS
    CPUs: 1
    Total Memory: 489.3 MiB
    Name: zfs-test
    ID: OD3W:F5JA:6FJO:EWUZ:EEVQ:WJYA:ZXQH:KEI4:5Z3I:5ZGD:TZVI:KBMU
    WARNING: No memory limit support
    WARNING: No swap limit support
    
    
    root@zfs-test:~# uname -a
    Linux zfs-test 3.18.8-031808-generic #201502271935 SMP Sat Feb 28 00:36:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    
    
    root@zfs-test:~# grep testz /proc/mounts
    testzpool /testzpool zfs rw,relatime,xattr,noacl 0 0
    
    
    root@zfs-test:~# docker run -it -v /testzpool:/test:rw ubuntu:14.04
    root@43b4629f4fd0:/# grep testz /proc/mounts
    testzpool /test zfs rw,relatime,xattr,noacl 0 0
    
    
    root@b5d12998b6fc:/# cat /proc/mounts
    rootfs / rootfs rw 0 0
    overlay / overlay rw,relatime,lowerdir=/var/lib/docker/overlay/fa81ed084842076d1b39b56d084d99ec0011cd4a5ade1056be359486a8b213e4/root,upperdir=/var/lib/docker/overlay/b5d12998b6fc904ef2e94da1b9c93277b01e83574a75cf85451b781e64f6d082/upper,workdir=/var/lib/docker/overlay/b5d12998b6fc904ef2e94da1b9c93277b01e83574a75cf85451b781e64f6d082/work 0 0
    proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
    tmpfs /dev tmpfs rw,nosuid,mode=755 0 0
    devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
    shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k 0 0
    mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
    sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
    testzpool /test zfs rw,relatime,xattr,noacl 0 0
    /dev/disk/by-uuid/09fbe148-d7d9-4648-8f45-d9376fdb051e /etc/resolv.conf ext4 rw,relatime,data=ordered 0 0
    /dev/disk/by-uuid/09fbe148-d7d9-4648-8f45-d9376fdb051e /etc/hostname ext4 rw,relatime,data=ordered 0 0
    /dev/disk/by-uuid/09fbe148-d7d9-4648-8f45-d9376fdb051e /etc/hosts ext4 rw,relatime,data=ordered 0 0
    devpts /dev/console devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
    proc /proc/bus proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/fs proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/irq proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/sys proc ro,nosuid,nodev,noexec,relatime 0 0
    proc /proc/sysrq-trigger proc ro,nosuid,nodev,noexec,relatime 0 0
    tmpfs /proc/kcore tmpfs rw,nosuid,mode=755 0 0
    tmpfs /proc/timer_stats tmpfs rw,nosuid,mode=755 0 0
    root@b5d12998b6fc:/#
    
  15. 19 remaining items

  16. rhatdan commented on Jun 9, 2015

    @rhatdan
    Contributor

    @burke I think you need only the first --make-rshare. Since it will recusively go through the mount points.

  17. burke commented on Jun 9, 2015

    @burke
    ContributorAuthor

    I'll poke at this and try to get the reproduction isolated out of docker, but here's a script:

    #!/bin/bash
    set -euo pipefail
    
    cleanup() {
      set +e
      sudo umount /bug
      rm /tmp/bug.bin
      sudo rmdir /bug
    }
    trap cleanup EXIT
    
    truncate -s 1M /tmp/bug.bin
    mkfs.ext2 /tmp/bug.bin
    sudo mkdir /bug
    sudo mount -t ext2 /tmp/bug.bin /bug
    
    echo ">> Device for mount source on host"
    awk '$2 == "/bug" {print $1}' /proc/mounts
    
    echo ">> Device for mount destination in container"
    docker run -v /bug:/bug ubuntu:14.04 \
      awk '$2 == "/bug" {print $1}' /proc/mounts

    This is what I get with docker 1.7.0-rc2:

    >> Device for mount source on host
    /dev/loop0
    >> Device for mount destination in container
    /dev/mapper/lvroot-root
    

    And this is on docker 1.6.0:

    >> Device for mount source on host
    /dev/loop0
    >> Device for mount destination in container
    /dev/loop0
    
  18. crosbymichael commented on Jun 10, 2015

    @crosbymichael
    Contributor

    Do we know if this is confined to using zfs or does it affect any graph driver?

    If it affects any graph driver we should look to see if the host has / mounted as rshared and set the Privatefs flag in libcontainer for those who do not have this, effectively reverting back the MS_SLAVE|MS_PRIVATE functionality for 1.6 but only for systems whos hosts don't have that support.

  19. burke commented on Jun 10, 2015

    @burke
    ContributorAuthor

    I did a bit more digging:

    Docker 1.7.0-rc2 has been running since I made this comment, using --storage-driver=overlay.

    Throughout this comment, "docker" refers to docker-1.7.0-rc2, and always one binary identical build. "broken" means this script with DOCKER_HOST set as indicated breaks, i.e. returns two different devices. "works" indicates the returns match.

    1. Initial state, docker has been running for 10 hours, with overlay. Broken.
    2. Started new docker, same command line as (1) except different socket path, and using VFS graphdriver. Works.
    3. Started new docker, same command line as (1) except different socket path (ie. same overlay graph driver). Works.
    4. Restarted 10-hour old docker. Works.

    There were actually a bunch of other things I tried in here that I didn't bother to include -- lots of permutations of graph drivers and graph directories. Nothing was broken except the 10 hour old docker. I was very confused when I made that comment, because the problem kind of stopped happening, and I was starting to doubt whether I had troubleshooted correctly. Now it's clear to me that this is a problem that happens reliably after some condition is triggered in the docker daemon, and is resolved by restarting the daemon.

    I'm leaving docker to run overnight with the graph-driver set to VFS. Next time I see it break, I'll capture a full strace while I spawn the container. Any other ideas how to troubleshoot this?

  20. burke commented on Jun 10, 2015

    @burke
    ContributorAuthor

    I should probably mention that I'm using ZFS for part of my container build workflow, but not actually as a storage-driver. Once the problem is provoked, it appears to be irrelevant whether I'm mounting ZFS or ext2 into the container -- both will exhibit the problem.

  21. crosbymichael commented on Jun 10, 2015

    @crosbymichael
    Contributor

    @burke could you cat /proc/self/mountinfo and paste the output?

  22. burke commented on Jun 10, 2015

    @burke
    ContributorAuthor

    Here it is, but note that in this case, the bug isn't present. I will post again when I can reproduce the problem again.

    host
    15 20 0:15 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw
    16 20 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
    17 20 0:5 / /dev rw,relatime - devtmpfs udev rw,size=65990672k,nr_inodes=16497668,mode=755
    18 17 0:12 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000
    19 20 0:16 / /run rw,nosuid,noexec,relatime - tmpfs tmpfs rw,size=13200308k,mode=755
    20 0 252:0 / / rw,relatime shared:1 - ext4 /dev/mapper/lvroot-root rw,errors=remount-ro,data=ordered
    21 15 0:17 / /sys/fs/cgroup rw,relatime - tmpfs none rw,size=4k,mode=755
    22 15 0:18 / /sys/fs/fuse/connections rw,relatime - fusectl none rw
    23 15 0:6 / /sys/kernel/debug rw,relatime - debugfs none rw
    24 15 0:10 / /sys/kernel/security rw,relatime - securityfs none rw
    25 19 0:19 / /run/lock rw,nosuid,nodev,noexec,relatime - tmpfs none rw,size=5120k
    26 19 0:20 / /run/shm rw,nosuid,nodev,relatime - tmpfs none rw
    27 19 0:21 / /run/user rw,nosuid,nodev,noexec,relatime - tmpfs none rw,size=102400k,mode=755
    28 21 0:22 / /sys/fs/cgroup/cpuset rw,relatime - cgroup cgroup rw,cpuset
    29 15 0:23 / /sys/fs/pstore rw,relatime - pstore none rw
    30 21 0:24 / /sys/fs/cgroup/cpu rw,relatime - cgroup cgroup rw,cpu
    31 21 0:25 / /sys/fs/cgroup/cpuacct rw,relatime - cgroup cgroup rw,cpuacct
    32 21 0:26 / /sys/fs/cgroup/devices rw,relatime - cgroup cgroup rw,devices
    33 21 0:27 / /sys/fs/cgroup/freezer rw,relatime - cgroup cgroup rw,freezer
    34 21 0:28 / /sys/fs/cgroup/net_cls rw,relatime - cgroup cgroup rw,net_cls
    35 21 0:29 / /sys/fs/cgroup/blkio rw,relatime - cgroup cgroup rw,blkio
    36 21 0:30 / /sys/fs/cgroup/perf_event rw,relatime - cgroup cgroup rw,perf_event
    37 21 0:31 / /sys/fs/cgroup/net_prio rw,relatime - cgroup cgroup rw,net_prio
    38 20 9:0 / /boot rw,relatime - ext3 /dev/md0 rw,data=ordered
    39 20 252:1 / /u rw,noatime shared:2 - ext4 /dev/mapper/lvroot-u rw,data=ordered
    40 21 0:32 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime - cgroup systemd rw,name=systemd
    108 39 0:57 / /u/apps/locutus/shared/zfs rw,relatime shared:3 - zfs locutus rw,xattr,noacl
    120 108 0:68 / /u/apps/locutus/shared/zfs/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4 rw,relatime - zfs locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4 rw,xattr,noacl
    74 20 0:33 / /testzpool rw,relatime - zfs testzpool rw,xattr,noacl
    135 120 0:63 / /u/apps/locutus/shared/zfs/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08 rw,relatime - zfs locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08 rw,xattr,noacl
    143 135 0:64 / /u/apps/locutus/shared/zfs/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/c29a8299b032308e560a1d8fc7d65647d005bf5a rw,relatime - zfs locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/c29a8299b032308e560a1d8fc7d65647d005bf5a rw,xattr,noacl
    144 135 0:65 / /u/apps/locutus/shared/zfs/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/fe8d2f153253a8323b7ae711ba5a38d47d3af9ab_final rw,relatime - zfs locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/fe8d2f153253a8323b7ae711ba5a38d47d3af9ab_final rw,xattr,noacl
    129 135 0:71 / /u/apps/locutus/shared/zfs/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/15b80e6d048c41142767ef7daf4beef7810dfa1b rw,relatime - zfs locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/15b80e6d048c41142767ef7daf4beef7810dfa1b rw,xattr,noacl
    131 135 0:72 / /u/apps/locutus/shared/zfs/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/312b4fce172153071da2ed6d96ee7c89bef50904_final rw,relatime - zfs locutus/spy-499d8dac8bb0e5d88a981afb20e1fd26fac699799b72cef71f365376e79e89c4/weekof-2015-06-08/312b4fce172153071da2ed6d96ee7c89bef50904_final rw,xattr,noacl
    84 108 0:69 / /u/apps/locutus/shared/zfs/shopify-1aa0bb873b0e2671e45aebde422ea35e9791bf1a8ffd404860186aaccff725b6 rw,relatime - zfs locutus/shopify-1aa0bb873b0e2671e45aebde422ea35e9791bf1a8ffd404860186aaccff725b6 rw,xattr,noacl
    104 84 0:70 / /u/apps/locutus/shared/zfs/shopify-1aa0bb873b0e2671e45aebde422ea35e9791bf1a8ffd404860186aaccff725b6/weekof-2015-06-08 rw,relatime - zfs locutus/shopify-1aa0bb873b0e2671e45aebde422ea35e9791bf1a8ffd404860186aaccff725b6/weekof-2015-06-08 rw,xattr,noacl
    173 108 0:82 / /u/apps/locutus/shared/zfs/foobar rw,relatime shared:4 - zfs locutus/foobar rw,xattr,noacl
    110 39 0:53 / /u/lib/docker/overlay/88dcabd411979bab90a0f0a698501e8ed5ccc210d7492b44c27fa18fecc59865/merged rw,relatime shared:8 - overlay overlay rw,lowerdir=/u/lib/docker/overlay/0fc853693760a5314f16a3e6161767750fe0173e42fa59474129e74ad0eef704/root,upperdir=/u/lib/docker/overlay/88dcabd411979bab90a0f0a698501e8ed5ccc210d7492b44c27fa18fecc59865/upper,workdir=/u/lib/docker/overlay/88dcabd411979bab90a0f0a698501e8ed5ccc210d7492b44c27fa18fecc59865/work
    122 20 7:0 / /bug rw,relatime shared:9 - ext2 /dev/loop0 rw
    139 39 0:60 / /u/lib/docker/overlay/2b2fd6b1243e626efebfa5e9190a0bd905727c8254880810f056bbe533834320/merged rw,relatime shared:10 - overlay overlay rw,lowerdir=/u/lib/docker/overlay/10186dca14f8a7373019edf1c049c50c10d2d40db75452fb1ee431ff55a45092/root,upperdir=/u/lib/docker/overlay/2b2fd6b1243e626efebfa5e9190a0bd905727c8254880810f056bbe533834320/upper,workdir=/u/lib/docker/overlay/2b2fd6b1243e626efebfa5e9190a0bd905727c8254880810f056bbe533834320/work
    
    container
    214 86 0:44 / / rw,relatime master:5 - overlay overlay rw,lowerdir=/u/lib/docker/overlay/d0955f21bf24f5bfffd32d2d0bb669d0564701c271bc3dfc64cfc5adfdec2d07/root,upperdir=/u/lib/docker/overlay/9ab60bd53f363d322d7d97e764b7cf50535aeb466f41ce88d1b2f161b1f5a64e/upper,workdir=/u/lib/docker/overlay/9ab60bd53f363d322d7d97e764b7cf50535aeb466f41ce88d1b2f161b1f5a64e/work
    215 214 0:46 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
    229 214 0:47 / /dev rw,nosuid - tmpfs tmpfs rw,mode=755
    230 229 0:48 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=666
    231 229 0:49 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw,size=65536k
    232 229 0:45 / /dev/mqueue rw,nosuid,nodev,noexec,relatime - mqueue mqueue rw
    233 214 0:50 / /sys ro,nosuid,nodev,noexec,relatime - sysfs sysfs ro
    234 214 7:0 / /bug rw,relatime master:9 - ext2 /dev/loop0 rw
    235 214 252:1 /lib/docker/containers/9ab60bd53f363d322d7d97e764b7cf50535aeb466f41ce88d1b2f161b1f5a64e/resolv.conf /etc/resolv.conf rw,noatime master:2 - ext4 /dev/mapper/lvroot-u rw,data=ordered
    236 214 252:1 /lib/docker/containers/9ab60bd53f363d322d7d97e764b7cf50535aeb466f41ce88d1b2f161b1f5a64e/hostname /etc/hostname rw,noatime master:2 - ext4 /dev/mapper/lvroot-u rw,data=ordered
    237 214 252:1 /lib/docker/containers/9ab60bd53f363d322d7d97e764b7cf50535aeb466f41ce88d1b2f161b1f5a64e/hosts /etc/hosts rw,noatime master:2 - ext4 /dev/mapper/lvroot-u rw,data=ordered
    112 215 0:46 /bus /proc/bus ro,nosuid,nodev,noexec,relatime - proc proc rw
    114 215 0:46 /fs /proc/fs ro,nosuid,nodev,noexec,relatime - proc proc rw
    115 215 0:46 /irq /proc/irq ro,nosuid,nodev,noexec,relatime - proc proc rw
    116 215 0:46 /sys /proc/sys ro,nosuid,nodev,noexec,relatime - proc proc rw
    117 215 0:46 /sysrq-trigger /proc/sysrq-trigger ro,nosuid,nodev,noexec,relatime - proc proc rw
    118 215 0:47 /null /proc/kcore rw,nosuid - tmpfs tmpfs rw,mode=755
    119 215 0:47 /null /proc/timer_stats rw,nosuid - tmpfs tmpfs rw,mode=755
    
  23. vbatts commented on Jun 10, 2015

    @vbatts
    Contributor

    so the rootfs on the host is shared. Though the container's rootfs has master:5 in its optional fields. This means that it is MS_SLAVE, not MS_PRIVATE.

    Still looking

  24. vbatts commented on Jun 10, 2015

    @vbatts
    Contributor

    @burke is it possible for you to build a docker binary from #13852 and test your use case with it?

    I'm trying your reproducer, and still unable to reproduce your results.

  25. vbatts commented on Jun 10, 2015

    @vbatts
    Contributor

    @burke i can build and sign one for you, if needed.

  26. burke commented on Jun 10, 2015

    @burke
    ContributorAuthor

    No worries. I just built #13854, about to install it on the server. It'll be somewhat difficult to prove whether it still has the problem or not, just because of the unpredictability of when it happens, but I'll update as I have more info

  27. vbatts commented on Jun 10, 2015

    @vbatts
    Contributor

    @burke glad you're testing #13854, but can you test #13852 as well?

  28. burke commented on Jun 10, 2015

    @burke
    ContributorAuthor

    Sure, I'll do that one now

  29. burke commented on Jun 10, 2015

    @burke
    ContributorAuthor

    I'm actually hesitant to restart docker on that server while I have #13847 (comment) broken. I'm going to hold off for a little bit while I debug that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions