Skip to content

[node.js fs] readdir with filetypes failed with error: [Error: EACCES: permission denied, scandir '/home/coder/project'] #4058

@YueMiyuki

Description

@YueMiyuki

OS/Web Information

  • Web Browser: Opera
  • Local OS: Windows 10
  • Remote OS: Synology
  • Remote Architecture: Docker
  • code-server --version: 3.10.2 387b12e

Steps to Reproduce

  1. Create code server
  2. Create some file in coder/project
  3. 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

image

Activity

jsjoeio

jsjoeio commented on Aug 30, 2021

@jsjoeio
Contributor

Hmm...I can't reproduce this. This seems to be a permissions issue. My hunch says that the user in your Docker container does not have the right permissions.

cc @code-asher how can they fix this?

YueMiyuki

YueMiyuki commented on Aug 30, 2021

@YueMiyuki
Author

Hi there
Yes i know it is a perm issue but my another code-server with the same version work perfectly fine

jsjoeio

jsjoeio commented on Aug 30, 2021

@jsjoeio
Contributor

Ah I see. I didn't realize you were running 3.10.2. Does it happen in the latest version of code-server?

YueMiyuki

YueMiyuki commented on Sep 5, 2021

@YueMiyuki
Author

Same thing happened in the latest version :/
btw i m using a Synology Device

YueMiyuki

YueMiyuki commented on Sep 5, 2021

@YueMiyuki
Author

bruh i miss-click

jsjoeio

jsjoeio commented on Sep 7, 2021

@jsjoeio
Contributor

Hmm...okay so this is a permission issue in your Docker environment 🤔

@code-asher any ideas on how to troubleshoot or fix this?

code-asher

code-asher commented on Sep 8, 2021

@code-asher
Member
YueMiyuki

YueMiyuki commented on Sep 8, 2021

@YueMiyuki
Author

I was creating the container with Docker UI in synology DSM 6.2, and the other code server mounted with same dir works fine like I said before so it should have the right permissions

code-asher

code-asher commented on Sep 10, 2021

@code-asher
Member
YueMiyuki

YueMiyuki commented on Sep 17, 2021

@YueMiyuki
Author

Hi, sorry for the latency
The commands we used to run the code-server is:

docker run -it --name code-server -p 8701:8080 \
  -v "mds/vm1/projects:/home/coder/project"
  codercom/code-server:latest
YueMiyuki

YueMiyuki commented on Sep 17, 2021

@YueMiyuki
Author

Here is full log after startup, with the latest version

[main 2021-09-17T11:04:48.868Z] [File Watcher (chokidar)] Inotify limit reached (ENOSPC)
[main 2021-09-17T11:04:48.875Z] [File Watcher (chokidar)] Inotify limit reached (ENOSPC)
[2021-09-17T11:05:49.376Z] info  code-server 3.12.0 2661a690ac228872e8d1dc28ab6d33e8afc30add
[2021-09-17T11:05:49.386Z] info  Using user-data-dir ~/.local/share/code-server
[2021-09-17T11:05:49.434Z] info  Using config file ~/.config/code-server/config.yaml
[2021-09-17T11:05:49.434Z] info  HTTP server listening on http://0.0.0.0:8080 
[2021-09-17T11:05:49.435Z] info    - Authentication is enabled
[2021-09-17T11:05:49.435Z] info      - Using password from $PASSWORD
[2021-09-17T11:05:49.436Z] info    - Not serving HTTPS 
[2021-09-17T11:05:57.438Z] error vscode is not running Error: vscode is not running
    at VscodeProvider.send (/usr/lib/code-server/out/node/vscode.js:121:19)
    at VscodeProvider.sendWebsocket (/usr/lib/code-server/out/node/vscode.js:117:14)
    at async /usr/lib/code-server/out/node/routes/vscode.js:205:5
[2021-09-17T11:05:57.476Z] error vscode is not running Error: vscode is not running
    at VscodeProvider.send (/usr/lib/code-server/out/node/vscode.js:121:19)
    at VscodeProvider.sendWebsocket (/usr/lib/code-server/out/node/vscode.js:117:14)
    at async /usr/lib/code-server/out/node/routes/vscode.js:205:5
[main 2021-09-17T11:06:06.950Z] [File Watcher (chokidar)] Inotify limit reached (ENOSPC)
[main 2021-09-17T11:06:06.953Z] [File Watcher (chokidar)] Inotify limit reached (ENOSPC)
[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'
}

The error changes after updating to latest

jsjoeio

jsjoeio commented on Sep 17, 2021

@jsjoeio
Contributor

[2021-09-17T11:05:57.438Z] error vscode is not running Error: vscode is not running

Usually this log happens if you left code-server open in a tab or window.

[main 2021-09-17T11:06:06.950Z] [File Watcher (chokidar)] Inotify limit reached (ENOSPC)

I don't recognize this error 🤔 (though I have seen issues with chokidar before).

[node.js fs] readdir with filetypes failed with error: [Error: EACCES: permission denied, scandir '/home/coder/project'] {

same error 🤔

Noob question: is there a way to check if the Docker user running code-server has access to /home/coder/project? And can we give that user access?

code-asher

code-asher commented on Sep 17, 2021

@code-asher
Member

4 remaining items

YueMiyuki

YueMiyuki commented on Oct 26, 2021

@YueMiyuki
Author

Interesting fact: my another code server ( 3.10.2 387b12e ) which I create some months ago works just fine. I have no idea why the new code server wont work even when mounting on the same dir...

Screen shots:

image

code-asher

code-asher commented on Oct 26, 2021

@code-asher
Member
YueMiyuki

YueMiyuki commented on Oct 29, 2021

@YueMiyuki
Author

Yes I am very sure I am running the same command and im in the same dir, I followed the docs 🤔

code-asher

code-asher commented on Oct 29, 2021

@code-asher
Member
YueMiyuki

YueMiyuki commented on Oct 30, 2021

@YueMiyuki
Author

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 🙃

YueMiyuki

YueMiyuki commented on Oct 30, 2021

@YueMiyuki
Author

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...

YueMiyuki

YueMiyuki commented on Nov 2, 2021

@YueMiyuki
Author

It So confusing... I just open a new droplet on digital ocean and test it... it worked totally fine...

code-asher

code-asher commented on Nov 2, 2021

@code-asher
Member
YueMiyuki

YueMiyuki commented on Nov 2, 2021

@YueMiyuki
Author

guys this is interesting
After adding —pid=host into the command, everything works fine!
I have never seen something like this before.. Any idea?

YueMiyuki

YueMiyuki commented on Nov 3, 2021

@YueMiyuki
Author

I have just reinstalled the docker... The image works just fine.. Even without --pid=host
So I guess this is an installation issue?

code-asher

code-asher commented on Nov 3, 2021

@code-asher
Member
jsjoeio

jsjoeio commented on Nov 3, 2021

@jsjoeio
Contributor

Interesting! Should we close this now?

YueMiyuki

YueMiyuki commented on Nov 4, 2021

@YueMiyuki
Author

Yes, thank for your help!

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

    waiting-for-infoWaiting for more information from submitter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jsjoeio@code-asher@YueMiyuki

        Issue actions

          [node.js fs] readdir with filetypes failed with error: [Error: EACCES: permission denied, scandir '/home/coder/project'] · Issue #4058 · coder/code-server