Skip to content

3.11.0 worker restart regression #2162

Closed

Description

@mkrogh

Bug Report

  • Concourse version: 3.11.0
  • Deployment type (BOSH/Docker/binary): docker
  • Infrastructure/IaaS: Ubuntu 16.04 VM
  • Did this used to work? yes in 3.10.0

When restarting a worker (or rebooting the machine), 3.11.0 workers fail to start if the volumes.img already exists.
Removing the file allows the worker to start, but fails on next restart/reboot.

Activity

  1. mkrogh commented on Apr 17, 2018

    @mkrogh
    Author
    {"timestamp":"1523969394.548230410","source":"baggageclaim","message":"baggageclaim.fs.run-command.failed","log_level":2,"data":{"args":["bash","-e","-x","-c","\n\t\tif [ ! -e $IMAGE_PATH ] || [ \"$(stat --printf=\"%s\" $IMAGE_PATH)\" != \"$SIZE_IN_BYTES\" ]; ...
    {"timestamp":"1523969394.548875570","source":"baggageclaim","message":"baggageclaim.failed-to-set-up-driver","log_level":2,"data":{"error":"failed to create btrfs filesystem: exit status 1"}}failed to create btrfs filesystem: exit status 1
    Main process exited, code=exited, status=1/FAILURE
    

    My current workaround it to just run rm on the volumes.img before starting the workers, since the db migrations makes it so you cannot run the older version of the web command.

  2. alistardust commented on Apr 23, 2018

    @alistardust

    I think this is a bug in ubuntu or docker, not in concourse. I had the same issue (at least same log errors) on 3.10.0 this morning. Mine was volumes mounted through overlayfs instead of volumes.img, but it was the same baggage claim errors. The solution for me was to umount the overlayfs, reboot, and I was fine.

  3. billimek commented on Apr 25, 2018

    @billimek

    We've seen this type of error in our installation too. Running in a similar setup:

    • Deployment type (BOSH/Docker/binary): docker
    • Infrastructure/IaaS: Ubuntu 16.04 VM

    We sometimes see this when someone needs to make an update to the docker-compose.yml and/or destroy and re-create the worker for whatever reason. When they start up the new worker, there are problems with the worker not starting properly or error about the volumes.img file. It doesn't seem like a very clean solution to have to delete this file first before starting a new worker.

  4. xylphid commented on May 14, 2018

    @xylphid

    Got the same error each time the worker restart with this configuration :

    • Concourse version : 3.13.0
    • Deployment type (BOSH/Docker/binary): docker
    • Infrastructure:IaaS : Mint 18.3
  5. jondlove commented on May 29, 2018

    @jondlove

    +1
    I have to delete and recreate workers after a host server reboot; or delete the /worker-state volume if I just want to restart a given worker

    Error message is similar to what @mkrogh reports:

    stdout:

    {"timestamp":"1527614154.821579218","source":"baggageclaim","message":"baggageclaim.fs.run-command.failed","log_level":2,"data":{"args":["bash","-e","-x","-c","\n\t\tif [ ! -e $IMAGE_PATH ] || [ \"$(stat --printf=\"%s\" $IMAGE_PATH)\" != \"$SIZE_IN_BYTES\" ]; then\n\t\t\ttouch $IMAGE_PATH\n\t\t\ttruncate -s ${SIZE_IN_BYTES} $IMAGE_PATH\n\t\tfi\n\n\t\tlo=\"$(losetup -j $IMAGE_PATH | cut -d':' -f1)\"\n\t\tif [ -z \"$lo\" ]; then\n\t\t\tlo=\"$(losetup -f --show $IMAGE_PATH)\"\n\t\tfi\n\n\t\tif ! file $IMAGE_PATH | grep BTRFS; then\n\t\t\t/worker-state/3.13.0/assets/btrfs/mkfs.btrfs --nodiscard $IMAGE_PATH\n\t\tfi\n\n\t\tmkdir -p $MOUNT_PATH\n\n\t\tif ! mountpoint -q $MOUNT_PATH; then\n\t\t\tmount -t btrfs $lo $MOUNT_PATH\n\t\tfi\n\t"],"command":"/bin/bash","env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","MOUNT_PATH=/worker-state/volumes","IMAGE_PATH=/worker-state/volumes.img","SIZE_IN_BYTES=90464333824"],"error":"exit status 1","session":"3.1","stderr":"+ '[' '!' -e /worker-state/volumes.img ']'\n++ stat --printf=%s /worker-state/volumes.img\n+ '[' 90464333824 '!=' 90464333824 ']'\n++ losetup -j /worker-state/volumes.img\n++ cut -d: -f1\n+ lo=/dev/loop0\n+ '[' -z /dev/loop0 ']'\n+ file /worker-state/volumes.img\n+ grep BTRFS\nbash: line 11: file: command not found\n+ /worker-state/3.13.0/assets/btrfs/mkfs.btrfs --nodiscard /worker-state/volumes.img\n/worker-state/volumes.img appears to contain an existing filesystem (btrfs).\nERROR: use the -f option to force overwrite of /worker-state/volumes.img\n","stdout":"btrfs-progs v4.15\nSee http://btrfs.wiki.kernel.org for more information.\n\n"}}
    {"timestamp":"1527614154.821689367","source":"baggageclaim","message":"baggageclaim.failed-to-set-up-driver","log_level":2,"data":{"error":"failed to create btrfs filesystem: exit status 1"}}
    

    stderr:

    failed to create btrfs filesystem: exit status 1
    failed to create btrfs filesystem: exit status 1
    failed to create btrfs filesystem: exit status 1
    failed to create btrfs filesystem: exit status 1
    [etc]
    

    This adds significant delay to the startup time of the system if I have to do a complete reboot, while Concourse figures out what workers it actually has: Orange. Orange warnings everywhere. D:

    Details:

    Concourse: 3.13.0
    Deployment: Docker (concourse/concourse:latest / sha256:59c9c...)
    Infrastructure: CentOS 7.4, Docker 17.12.0-ce, build c97c6d6
    
  6. fewknow commented on Jul 2, 2018

    @fewknow

    +1 . I upgraded from 3.9.1 to 3.14.1
    After this upgrade everything turned orange and had this error.

    volume '9f7d378a-fd70-4c0e-412c-36c56364a478' disappeared from worker 'a1380cc4-c7f1-4ad1-84ab-67af113428f9'
    

    screen shot 2018-07-01 at 10 16 40 pm

    screen shot 2018-07-01 at 10 15 57 pm

    I currently run 10 workers. After recreating them with

    bosh -e mgmt recreate -d concourse worker/a0a5b764-9205-4794-97f8-08d1b0ad4b3f
    

    The error went away and everything seems to be fine.

  7. billimek commented on Aug 2, 2018

    @billimek

    Bumping this issue:

    When running via docker-compose, if the worker container crashes and restarts (say due to a OOM error) - or even during any type of restart - we frequently see something like,

    {"timestamp":"1533239376.210015059","source":"baggageclaim","message":"baggageclaim.fs.run-command.failed","log_level":2,"data":{"args":["bash","-e","-x","-c","\n\t\tif [ ! -e $IMAGE_PATH ] || [ \"$(stat --printf=\"%s\" $IMAGE_PATH)\" != \"$SIZE_IN_BYTES\" ]; then\n\t\t\ttouch $IMAGE_PATH\n\t\t\ttruncate -s ${SIZE_IN_BYTES} $IMAGE_PATH\n\t\tfi\n\n\t\tlo=\"$(losetup -j $IMAGE_PATH | cut -d':' -f1)\"\n\t\tif [ -z \"$lo\" ]; then\n\t\t\tlo=\"$(losetup -f --show $IMAGE_PATH)\"\n\t\tfi\n\n\t\tif ! file $IMAGE_PATH | grep BTRFS; then\n\t\t\t/opt/concourse/4.0.0/assets/btrfs/mkfs.btrfs --nodiscard $IMAGE_PATH\n\t\tfi\n\n\t\tmkdir -p $MOUNT_PATH\n\n\t\tif ! mountpoint -q $MOUNT_PATH; then\n\t\t\tmount -t btrfs $lo $MOUNT_PATH\n\t\tfi\n\t"],"command":"/bin/bash","env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","MOUNT_PATH=/opt/concourse/volumes","IMAGE_PATH=/opt/concourse/volumes.img","SIZE_IN_BYTES=94813585408"],"error":"exit status 1","session":"3.1","stderr":"+ '[' '!' -e /opt/concourse/volumes.img ']'\n++ stat --printf=%s /opt/concourse/volumes.img\n+ '[' 94813585408 '!=' 94813585408 ']'\n++ losetup -j /opt/concourse/volumes.img\n++ cut -d: -f1\n+ lo=/dev/loop2\n+ '[' -z /dev/loop2 ']'\n+ file /opt/concourse/volumes.img\nbash: line 11: file: command not found\n+ grep BTRFS\n+ /opt/concourse/4.0.0/assets/btrfs/mkfs.btrfs --nodiscard /opt/concourse/volumes.img\n/opt/concourse/volumes.img appears to contain an existing filesystem (btrfs).\nERROR: use the -f option to force overwrite of /opt/concourse/volumes.img\n","stdout":"btrfs-progs v4.15\nSee http://btrfs.wiki.kernel.org for more information.\n\n"}}
    

    The important part from this seems to be:
    volumes.img appears to contain an existing filesystem (btrfs)

    ... which prevents the worker from ever starting. Requiring the user to manually clean-up this file from the host filesystem in order to get a worker to start.

    Basically, once you create a worker, it looks like you cannot restart the worker without first manually removing the sparse-image file.

    Is there any way to bake-in this cleanup as part of concourse itself?

  8. billimek commented on Aug 2, 2018

    @billimek

    I think this error is actually going to be fixed by concourse/concourse-docker#15

    Removing the volumes.img was probably just masking the check using the missing file command. Can't wait to see this PR included in a release!

  9. OvermindDL1 commented on Dec 9, 2018

    @OvermindDL1

    Still happening in 4.2.1, server reboot causes failed to create btrfs filesystem: exit status 1 to be logged and then the worker dies.

  10. UncleSamSwiss commented on Mar 19, 2019

    @UncleSamSwiss

    @billimek unfortunately it doesn't seem to work.

    We have the same problem with Concourse 5.0 and the following versions:

    # docker -v
    Docker version 18.06.1-ce, build e68fc7a
    # docker-compose -v
    docker-compose version 1.23.2, build 1110ad01
    # uname -a
    Linux seazoet3 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    

    How to reproduce:

    1. Use the official docker-compose at https://concourse-ci.org/docker-compose.yml
    2. Start with docker-compose up
    3. Stop with Ctrl-C
    4. Try to start again with docker-compose up and you get the following error:
    concourse_1     | {"timestamp":"2019-03-19T13:26:25.966851698Z","level":"info","source":"atc","message":"atc.cmd.start","data":{"session":"1"}}
    concourse_1     | {"timestamp":"2019-03-19T13:26:26.019497356Z","level":"info","source":"atc","message":"atc.cmd.finish","data":{"duration":122126,"session":"1"}}
    concourse_1     | {"timestamp":"2019-03-19T13:26:26.246555949Z","level":"error","source":"baggageclaim","message":"baggageclaim.fs.run-command.failed","data":{"args":["bash","-e","-x","-c","\n\t\tif [ ! -e $IMAGE_PATH ] || [ \"$(stat --printf=\"%s\" $IMAGE_PATH)\" != \"$SIZE_IN_BYTES\" ]; then\n\t\t\ttouch $IMAGE_PATH\n\t\t\ttruncate -s ${SIZE_IN_BYTES} $IMAGE_PATH\n\t\tfi\n\n\t\tlo=\"$(losetup -j $IMAGE_PATH | cut -d':' -f1)\"\n\t\tif [ -z \"$lo\" ]; then\n\t\t\tlo=\"$(losetup -f --show $IMAGE_PATH)\"\n\t\tfi\n\n\t\tif ! file $IMAGE_PATH | grep BTRFS; then\n\t\t\tmkfs.btrfs --nodiscard $IMAGE_PATH\n\t\tfi\n\n\t\tmkdir -p $MOUNT_PATH\n\n\t\tif ! mountpoint -q $MOUNT_PATH; then\n\t\t\tmount -t btrfs $lo $MOUNT_PATH\n\t\tfi\n\t"],"command":"/bin/bash","env":["PATH=/usr/local/concourse/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","MOUNT_PATH=/worker-state/volumes","IMAGE_PATH=/worker-state/volumes.img","SIZE_IN_BYTES=200101810176"],"error":"exit status 1","session":"3.1","stderr":"+ '[' '!' -e /worker-state/volumes.img ']'\n++ stat --printf=%s /worker-state/volumes.img\n+ '[' 200101810176 '!=' 200101810176 ']'\n++ cut -d: -f1\n++ losetup -j /worker-state/volumes.img\n+ lo=/dev/loop13\n+ '[' -z /dev/loop13 ']'\n+ file /worker-state/volumes.img\nbash: line 11: file: command not found\n+ grep BTRFS\n+ mkfs.btrfs --nodiscard /worker-state/volumes.img\n/worker-state/volumes.img appears to contain an existing filesystem (btrfs).\nERROR: use the -f option to force overwrite of /worker-state/volumes.img\n","stdout":"btrfs-progs v4.15.1\nSee http://btrfs.wiki.kernel.org for more information.\n\n"}}
    concourse_1     | {"timestamp":"2019-03-19T13:26:26.246649222Z","level":"error","source":"baggageclaim","message":"baggageclaim.failed-to-set-up-driver","data":{"error":"failed to create btrfs filesystem: exit status 1"}}
    concourse_1     | failed to create btrfs filesystem: exit status 1
    concourse_concourse_1 exited with code 1
    
  11. UncleSamSwiss commented on Mar 19, 2019

    @UncleSamSwiss

    For everybody ending up here with the same error I reported, the workaround is:

    1. Run docker-compose down
    2. Remove the volume(s) related to the "concourse" container (for us these were two)
    3. Run docker-compose up -d
    4. Run fly -t myproject workers and prune all workers that are stalled
  12. punalpatel commented on Mar 31, 2019

    @punalpatel

    Thank you @UncleSamSwiss These steps worked for me.

    Run

    docker-compose down; docker system prune --volumes; docker-compose up -d

  13. vito commented on Apr 10, 2019

    @vito
    Contributor

    Pretty sure this was fixed by concourse/concourse-docker#15 but then regressed with 5.0+ - it should be fixed again in v5.1 which we hope to have out this week or next week. 👍

  14. pothos commented on Jul 3, 2019

    @pothos

    Had the same problem with v5.3.0.
    #2162 (comment) solved it.

  15. acarsercan commented on Oct 23, 2019

    @acarsercan

    I'm running v5.3.0 and still having this problem with concourse running inside kubernetes

    volume '9fdd49f5-333e-4838-74b5-27b5d858cb80' disappeared from worker 'concourse-worker-3'

  16. Suvankar123 commented on May 10, 2022

    @Suvankar123

    I am facing same issue with concourse helm chart with image version 7.7.I had deployed previously with baggageclaim driver set to : naive.But it did not work since all went down.Again I redployed the total helm via brtfs & making mkfs.brtfs flag as enabled setting the required binary,but still facing the same issue

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions