Skip to content
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

EPERM: operation not permitted, scandir #284

Closed
oyvindeh opened this issue Aug 24, 2016 · 12 comments
Closed

EPERM: operation not permitted, scandir #284

oyvindeh opened this issue Aug 24, 2016 · 12 comments

Comments

@oyvindeh
Copy link

Hi,

Trying to run a Node app in a Docker image based on mhart/alpine-node:6.4.0, I get the following stack trace which points to Glob:

/node_modules/webdriverio/build/lib/cli.js:369
            throw e;
            ^

Error: EPERM: operation not permitted, scandir '/proc/1/map_files/561b222d4000-561b23a8b000'
    at Error (native)
    at Object.fs.readdirSync (fs.js:951:18)
    at GlobSync._readdir (/node_modules/glob/sync.js:276:41)
    at GlobSync._readdirInGlobStar (/node_modules/glob/sync.js:255:20)
    at GlobSync._readdir (/node_modules/glob/sync.js:264:17)
    at GlobSync._processReaddir (/node_modules/glob/sync.js:136:22)
    at GlobSync._process (/node_modules/glob/sync.js:131:10)
    at GlobSync._processGlobStar (/node_modules/glob/sync.js:368:10)
    at GlobSync._process (/node_modules/glob/sync.js:129:10)
    at GlobSync._processGlobStar (/node_modules/glob/sync.js:371:10)

Is this a bug, and/or is there any known workaround? It occurs also when run as root. Thanks!

@oyvindeh
Copy link
Author

Also seems to happen using the current latest official node docker images (Node 6.4, both regular and slim), but not when using the latest NodeSource docker image (Node 6.3 on Wheezy).

@isaacs
Copy link
Owner

isaacs commented Aug 24, 2016

Well, this is weird. Glob can't very well give you a list of files if it can't list the files in a directory. I'm not sure how I'd even go about addressing that.

@Luftzig
Copy link

Luftzig commented Apr 5, 2017

@oyvindeh have you managed to work around the issue? I have the same problem and I'm quite clueless.

@spemmons
Copy link

spemmons commented Apr 26, 2017

i also am having the problem... in my case there seems to be a locked TMP file in a directory under the scan that is inaccessible... perhaps it is being treated like a directory? my pattern is */ so it is recursive

@spemmons
Copy link

since EPERM means the operation is "not permitted" why not just say "oh, well" and skip to the next item? why fail?

@oyvindeh
Copy link
Author

@Luftzig I think I found some image that solved my initial problem and where this was not an issue.

@spemmons
Copy link

i created a fork and modified the sync.js to treat EPERM errors the same as ENOENT and was able to continue successfully... this would seem to be the same situation (in my case) a trying to do a recursive list of files where you don't have permission for some nested subdirectories... perhaps one could argue that handling for this could be based on an option, but i'm not sure that's really necessary... is this an active project that i could submit a pull request to? it unfortunately looks pretty stale...

@jfstephe
Copy link

I've got the same issue running an Ubuntu docker image on windows 10 (VirtualBox host). @oyvindeh - what image was it that fixed this for you? @isaacs, is it worth @spemmons raising that PR?

@spemmons
Copy link

It's not ideal, but apparently this repository is no longer being maintained, so i have published another NPM module qiot-glob that has this fix. Cheers!

@jfstephe
Copy link

@spemmons thanks!

@ghost
Copy link

ghost commented Jul 11, 2017

Is there a "continue on error"? strict: false worked for me.

@isaacs
Copy link
Owner

isaacs commented Feb 28, 2023

No longer an issue on v9

@isaacs isaacs closed this as completed Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants