code-server: [node.js fs] readdir with filetypes failed with error: [Error: EACCES: permission denied, scandir '/home/coder/project']
OS/Web Information
- Web Browser: Opera
- Local OS: Windows 10
- Remote OS: Synology
- Remote Architecture: Docker
code-server --version: 3.10.2 387b12ef4ca404ffd39d84834e1f0776e9e3c005
Steps to Reproduce
- Create code server
- Create some file in coder/project
- See error in logs
Expected
Files should show up
Actual
Nothing show up but there is file in the file explorer
Logs
[node.js fs] readdir with filetypes failed with error: [Error: EACCES: permission denied, scandir ‘/home/coder/project’] { errno: -13, code: ‘EACCES’, syscall: ‘scandir’, path: ‘/home/coder/project’ }
Screenshot

About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 30 (15 by maintainers)
Alright guys, the same command works perfectly fine on Ubuntu 20.04, but it just won’t work on DSM. I have no idea what the heck is happening…
bruh i miss-click
Yes, thank for your help!
I have just reinstalled the docker… The image works just fine… Even without --pid=host So I guess this is an installation issue?
Strange, maybe wiping Docker clean and re-pulling the images will help?
Interestingly, when I try to install code server out of docker, everything works damn fine, so I guess that’s an issue produced by docker. I will try to debug by reinstalling docker 🙃
Hmm I have no idea why the mounting logic would be different from one image to another. When I try on 3.10.2 with a relative path it breaks just like 3.12.0 does. It seems to be a Docker issue?
Here is what I tried:
If you use an absolute path instead of relative does it work?
Are you running the exact same command while inside the exact same directory except swapping out
code-server:latestforcode-server:3.10.2? This seems more likely to be related to Docker than to code-server based on the results so far but if the reproduction steps have changed please post an update!From what I can tell Docker will only mount the directory if it is an absolute path. However, it will still create the mount path but it will be empty and owned by root (thus permissions are denied).
touch testdir/hello.js also works outside dockerin my case, even in a ubuntu container, but the code-server cannot read the file. But when i try to create a file in code-server, it appears both in the server and the mounted folder
Interesting, using an absolute path works (notice
$PWD/test-dirinstead oftest-dir):Huh, this is weird, I am not getting the permission error in the console but I am unable to view or create files in the project directory.
Replicated in a Coder environment with this:
I am able to
touch test-dir/hellooutside of Docker so I have permissions.Here is full log after startup, with the latest version
The error changes after updating to latest
I hear ya but we cannot reproduce with the information you have provided so more information (like the commands you use to run the code-server Docker images) may help us identify the issue.
Hi there Yes i know it is a perm issue but my another code-server with the same version work perfectly fine