Skip to content

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

Closed

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

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

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

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

  4. YueMiyuki commented on Sep 5, 2021

    @YueMiyuki
    Author

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

  5. YueMiyuki commented on Sep 5, 2021

    @YueMiyuki
    Author

    bruh i miss-click

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

  7. code-asher commented on Sep 8, 2021

    @code-asher
    Member
  8. 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

  9. code-asher commented on Sep 10, 2021

    @code-asher
    Member
  10. 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
    
  11. 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

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

  13. code-asher commented on Sep 17, 2021

    @code-asher
    Member
  14. 4 remaining items

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

  16. code-asher commented on Oct 26, 2021

    @code-asher
    Member
  17. 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 🤔

  18. code-asher commented on Oct 29, 2021

    @code-asher
    Member
  19. 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 🙃

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

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

  22. code-asher commented on Nov 2, 2021

    @code-asher
    Member
  23. 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?

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

  25. code-asher commented on Nov 3, 2021

    @code-asher
    Member
  26. jsjoeio commented on Nov 3, 2021

    @jsjoeio
    Contributor

    Interesting! Should we close this now?

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

      Issue actions