Skip to content

runc error, preparing rootfs caused "permission denied" #598

Closed

Description

@MehSha

Hi,
running binary verison 1.6 with following:
./concourse_linux_amd64 web --basic-auth-username myuser --basic-auth-password mypass --session-signing-key keys/session_signing_key --tsa-host-key keys/host_key --tsa-authorized-keys keys/authorized_worker_keys --external-url http://ci.mysite.com --postgres-data-source postgres://postgres:postgres@localhost:5432/atc?sslmode=disable

I cant run simplest commands.
I get this error both on Ubuntu 16:04 docker 1.12.1 and debian 8.5 on Docker 1.11.1:
runc create: exit status 1: rootfs_linux.go:42: preparing rootfs caused "permission denied"

folowing runs perfectly:
docker run busybox /bin/echo hello world

I found folowing bug in docker issues:
moby/moby#25847

but cant you just make a work around or inform me of working setup?

I tried CeontOS 7.2 and docker 1.10, but it gives capability error, searching the web it implies I need kernel 3.19 or higher, latest CentOS comes with 3.13

totally locked up.
how do you run concourse? in which distro and setup that it works?

Activity

  1. concourse-bot commented on Aug 22, 2016

    @concourse-bot

    Hi there!

    We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

    The current status is as follows:

    • #128775851 runc error, preparing rootfs caused "permission denied"

    This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

  2. vito commented on Oct 7, 2016

    @vito
    Contributor

    Is this still an issue or at least one you can debug some more? I'm afraid we won't be able to help much without steps to reproduce.

    We definitely need kernel 3.19+ at least.

  3. sbkg0002 commented on Dec 20, 2016

    @sbkg0002

    This issue still persists on CoreOS 4.7.3-coreos-r2 with Concourse 2.5.0 and Docker version:

    Client:
     Version:      1.11.2
     API version:  1.23
     Go version:   go1.6.3
     Git commit:   bac3bae
     Built:
     OS/Arch:      linux/amd64
    
    Server:
     Version:      1.11.2
     API version:  1.23
     Go version:   go1.6.3
     Git commit:   bac3bae
     Built:
     OS/Arch:      linux/amd64
    
  4. 27 remaining items

  5. vmesh commented on Mar 28, 2017

    @vmesh

    Same problem on Debian 8.7 with 4.9.13 kernel from jessie-backports repository and Concourse 2.7.0.

  6. BrianHicks commented on Mar 31, 2017

    @BrianHicks

    This happens to me on Minikube with the Helm chart too.

    Steps to reproduce

    • minikube start
    • helm init
    • helm install stable/concourse
    • apply the "navi" pipeline from the getting started documentation

    Expected Result

    Container echos "Hey! Listen!"

    Actual Result

    Step fails with this message:

    runc create: exit status 1: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:43: preparing rootfs caused \\\"permission denied\\\"\""
    

    Versions

    • image: concourse/concourse:2.6.0 and concourse/concourse:2.7.0
    • minikube: v0.17.1
    • kubernetes: 1.5.3
    • helm: 2.2.1 on both client and server
    • concourse chart: 0.1.3

    Additional Steps

    I've also tried changing the image to alpine:latest and get the same message.

  7. vito commented on Apr 11, 2017

    @vito
    Contributor

    Make sure you're all running the worker in a "privileged" container, however you do that on your platform of choice.

  8. everpeace commented on Apr 12, 2017

    @everpeace
    Contributor
  9. gregarcara commented on Apr 12, 2017

    @gregarcara
    Contributor

    Hey guys, I ran into what I think is the same issue as well, not sure what the cause is, but I was able to work around this by chmod +x /concourse-work-dir on the worker pods. So I think this is an issue with the helm chart and not concourse.

    Looks like this explains the issue possibly: kubernetes/kubernetes#2630

  10. everpeace commented on Apr 13, 2017

    @everpeace
    Contributor

    @gregarcara Thanks! your workaround did work!!


    However, I tried to dig root causes and realized these facts (I used helm's chart stable/concourse).

    • worker process(PID=6) runs by root user

       $ kubectl exec my-concourse-worker-0 -it /bin/bash
       root@my-concourse-worker-0:/# ps augwx
       USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
       root         1  0.0  0.0    200     4 ?        Ss   08:47   0:00 /usr/local/bin/dumb-init /usr/local/bin/concourse worker
       root         6  0.2  5.8 1075164 238260 ?      Ssl  08:47   0:05 /usr/local/bin/concourse worker
       root       251  0.0  0.1 115788  5768 ?        Ssl  09:12   0:00 /proc/self/exe init
       root       257  0.0  0.2 342204 10272 ?        Sl   09:12   0:00 /concourse-work-dir/2.7.0/linux/bin/runc events 457d5c94-6f3b-40f8-
       root       365  0.0  0.1 107336  5772 ?        Ssl  09:13   0:00 /proc/self/exe init
       root       371  0.0  0.2 268472  8888 ?        Sl   09:13   0:00 /concourse-work-dir/2.7.0/linux/bin/runc events bbd8b2b5-4aef-4290-
       root       967  0.0  0.0  18228  3240 ?        Ss   09:25   0:00 /bin/bash
       root       977  0.0  0.0  34424  2704 ?        R+   09:25   0:00 ps augwx
      
    • concourse-worker-dir is mounted on worker pod with 750

      root@my-concourse-worker-0:/# ls -l
      total 68
      drwxr-xr-x   2 root root 4096 Apr 13 07:49 bin
      drwxr-xr-x   2 root root 4096 Apr 12  2016 boot
      drwxrwxrwt   3 root root  140 Apr 13 08:47 concourse-keys
      drwxr-x---   5 root root 4096 Apr 13 08:47 concourse-work-dir
      drwxr-xr-x  11 root root 2900 Apr 13 08:47 dev
      ...
      
    • however, hello-world in GettingStarted fails

      image

    • after the build failed, several files were output in concourse-worker-dir.

      root@my-concourse-worker-0:/# ls -l concourse-work-dir/
      total 460168
      drwxr-xr-x 3 root root        4096 Apr 13 08:47 2.7.0
      drwxr-xr-x 4 root root        4096 Apr 13 09:13 depot
      drwxr-xr-x 1 root root          24 Apr 13 08:47 volumes
      -rw-r--r-- 1 root root 19163156480 Apr 13 09:35 volumes.img
      

    I hope this would help to inspect root causes. Would somebody figures out them??

  11. gregarcara commented on Apr 13, 2017

    @gregarcara
    Contributor

    @everpeace Check the kubernetes ticket I referenced above. This is an issue with how kubernetes gives permissions to volumes when the pod is created. Tasks in the pipeline that are not run as privileged will be hit by this error, but if privileged is set to true, the task will run because it is then run as root and has the proper permissions.

  12. added a commit that references this issue on Mar 28, 2018
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