question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

permission denied while creating volume path

See original GitHub issue

Describe the bug

Workspace is not starting and report “timeout” In workspace pod events we can see

Error: Error response from daemon: create b72f86e6ddffd62eaaa51d33db4b993d11c88396309d735678899fddfc10ab2f: error while creating volume path '/var/lib/docker/volumes/b72f86e6ddffd62eaaa51d33db4b993d11c88396309d735678899fddfc10ab2f/_data': mkdir /var/lib/docker/volumes/b72f86e6ddffd62eaaa51d33db4b993d11c88396309d735678899fddfc10ab2f: permission denied

Here is the dockerfile of the container image used:

FROM centos:8
RUN mkdir -p /foo && chmod 777 /foo && chgrp 0 /foo; chmod g+rwX /foo
VOLUME /foo
CMD tail -f /dev/null

The main error is coming with the VOLUME instruction

Che version

  • latest
  • nightly
  • other: please specify : che.openshift.io

Steps to reproduce

https://che.openshift.io/dashboard/#/load-factory?url=https://gist.githubusercontent.com/benoitf/b1ef68e9c9daece33e341a0cd0b1b046/raw/badf0b47da7dd448e80ed5ab8000bd909dc6f6b8/gistfile1.txt

Expected behavior

Workspace is able to start

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: che.openshift.io

Screenshots

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
amisevskcommented, Apr 21, 2020

This is an OpenShift issue – any container that has a VOLUME directive in its dockerfile has to have a corresponding volumeMount.

The solution is to add a volume to the devfile:


apiVersion: 1.0.0

metadata:
  name: fbenoit-test1
  
projects:
  - name: python-hello-world
    source:
      type: git
      location: 'https://github.com/datawire/hello-world-python.git'
components:
  - id: ms-python/python/latest
    type: chePlugin
  - type: dockerimage
    image: docker.io/florentbenoit/test3
    memoryLimit: 512Mi
    volumes:
      - name: foo
        containerPath: /foo

There’s not a whole lot we can do on the Che side automatically here. Without a volumeMount, there’s no good way to determine where to allocate the storage for the container, and without the dockerfile there’s no way to know which volumes we need to add.

0reactions
che-botcommented, Oct 28, 2020

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission denied on accessing host directory in Docker
This happens when the volume is empty and the container is created with the named volume. macOS users now have OSXFS which handles...
Read more >
Docker Files and Volumes: Permission Denied
Encountered a 'Permission Denied' error on a file copied to a Docker image or when accessing a file on a mounted volume within...
Read more >
Permission denied with volumes : r/docker - Reddit
Whenever I try to write a file in the data folder, which is bound to a volume, it errors with permission denied. What...
Read more >
Container permission denied: How to diagnose this error
Usually, the problem is a non-root user inside a container, say the MySQL UID 999, trying to access a volume mounted from the...
Read more >
Troubleshooting Common Problems - Jupyter Docker Stacks
Permission denied when mounting volumes# ; CHOWN_EXTRA=<some-dir>,<some-other-dir> : will change the ownership and group of the specified container directory ( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found