8000 No permissions over home directory (error EACCES: permission denied, mkdir '/home/coder/.config/code-server') · Issue #7353 · coder/code-server · GitHub
[go: up one dir, main page]

Skip to content
8000

No permissions over home directory (error EACCES: permission denied, mkdir '/home/coder/.config/code-server') #7353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
javierspn opened this issue May 22, 2025 · 2 comments
Labels
bug Something isn't working waiting-for-info Waiting for more information from submitter

Comments

@javierspn
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Firefox, Chrome, Edge
  • Local OS: Debian 12, MacOS X Ventura, Windows 11, Windows 10
  • Remote OS: Debian 12
  • Remote Architecture: x86 (64 bits)
  • code-server --version: latest

Steps to Reproduce

  1. Run docker stack
  2. Wait to be up
  3. Doesn't startup (see logs below)

Expected

For the container to start up

Actual

It doesn't start

Logs

code-server  | [2025-05-16T11:04:28.013Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:28.575Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:29.179Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:29.975Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:31.160Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:33.132Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:36.745Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:43.535Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:04:56.756Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:05:22.764Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:06:14.407Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:07:14.828Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'
code-server  | [2025-05-16T11:08:15.240Z] error EACCES: permission denied, mkdir '/home/coder/.config/code-server'

Screenshot/Video

No response

Does this bug reproduce in native VS Code?

I did not test native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

I am trying to run a container (docker compose stack) and it is not working because of a permissions issue. My stack's config:

x-common-logging: &default-logging
  driver: ${LOG_TYPE}
  options:
    max-size: ${LOG_SIZE}
    max-file: ${LOG_FILES}


services:

  code-server:

    image: ${CONTAINER_IMAGE}
    container_name: ${CONTAINER_NAME}

    restart: ${POLICY_RESTART}

    environment:

      TZ: ${TZ}
      PUID: 0
      PGID: 0
      DOCKER_USER: 0

    networks:
      - proxied

    volumes:
      - ${CODE_LOCAL_VOLUME}
      - ${CODE_CONFIG_VOLUME}
      - ${CODE_PROJECT_VOLUME}

    logging: *default-logging


networks:
  proxied:
    name: proxied
CONTAINER_IMAGE=codercom/code-server:latest
CONTAINER_NAME=code-server
# VOLUMES
CODE_LOCAL_VOLUME=/docker/data/code/.local:/home/coder/.local
CODE_CONFIG_VOLUME=/docker/data/code/.config:/home/coder/.config
CODE_PROJECT_VOLUME=/docker/data/code/projects:/home/coder/project
# COMMON ENVIRONMENT VARIABLES
TZ=Europe/Madrid
POLICY_RESTART=unless-stopped
LOG_TYPE=json-file
LOG_SIZE=10M
LOG_FILES=3

I have changed the DOCKER_USER to the actual docker user and the root, none of them work.

@javierspn javierspn added bug Something isn't working triage This issue needs to be triaged by a maintainer labels May 22, 2025
@code-asher
Copy link
Member

It could maybe be an issue with our container image, but it could also be a configuration issue. The directories in /docker/data/code likely have the wrong permissions?

Are you able to put together a full reproduction I can run? I tried adding the above as a docker-compose.yml file then setting the above environment variables. Then I ran:

sudo mkdir -p /docker/data/code/.local
sudo mkdir -p /docker/data/code/.config
sudo mkdir -p /docker/data/code/projects

But, I am not sure what docker stack is or how to use it, so I just ran docker compose up instead. This got me the same "permission denied" error, so then I ran:

sudo chown -R coder: /docker # my user has a UID of 1000

And then code-server started up successfully.

@code-asher code-asher added waiting-for-info Waiting for more information from submitter and removed triage This issue needs to be triaged by a maintainer labels May 22, 2025
@javierspn
Copy link
Author

Sorry, maybe I did not explain myself properly.

For stack I mean a compose file, as per the code above. My docker daemon is running with user GID and UID zero (0).

The compose file and its related env file are above so you can easily reproduce everything with them.

These are the permissions of the binded volume:

server:~$ sudo ls -lahtr /docker/data/code
total 20K
drwxr-xr-x  2 root root 4.0K May 16 13:00 projects
drwxr-xr-x  2 root root 4.0K May 16 13:00 .local
drwxr-xr-x  2 root root 4.0K May 16 13:00 .config
drwxr-xr-x 38 root root 4.0K May 16 13:00 ..
drwxr-xr-x  5 root root 4.0K May 16 13:00 .

Docker is running with root, I run the compose file with a CI/CD docker management tool called Komodo, which uses the docker daemon to execute operations (root user). In essence it uses GID=0.

HOWEVER I did this:
sudo chown -R 1000:1000 /docker/data/code
And now it works.

It seems that internally the container runs with user 1000:1000.

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests

2 participants
0