-
Notifications
You must be signed in to change notification settings - Fork 773
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
mkdirsSync fails misleadingly if directory exists, but cannot be stat-ed. #625
Comments
Yeah, this is weird, I wonder what error is getting thrown here. Also, what platform is this? |
This is Linux on Raspberry Pi 3. In addition to all, the backing host path
on GlusterFS, which is know to return unusual things from stat operations.
Anyway, why don't we just check of EEXISTS, as we already do for ENOENT?
Why check again with an extra stat? I might be missing something. Is there
a case where EEXISTS does not mean that the job is done?
ср, 19 вер. 2018 о 15:35 Ryan Zimmerman <[email protected]> пише:
… Yeah, this is weird, I wonder what error is getting thrown here. Also,
what platform is this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#625 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABWTIOSOvisj79XqRtmbTgBQb5k1TGoGks5uclYqgaJpZM4Wv5lA>
.
|
The purpose of the stat call is so that we can check if it's actually a directory. If it's a file with the same name, throwing |
|
#619 may fix this. |
If this is still reproducible on Node 10.12+ and latest |
https://github.com/jprichardson/node-fs-extra/blob/master/lib/mkdirs/mkdirs-sync.js#L43
I have a docker container which mounts the directory as a host path bind mount. The operation fails with a misleading error.
There is probably something wrong with the permissions, but the directory fails to be stat-ed. I can investigate deeper to provide what is the exact exception
err1
is swallowed bybut we should make a more fine-grained check here and depending on what is the error, throw either err1 or err0.
The text was updated successfully, but these errors were encountered: