Skip to content

NodeJS File System fs.open UNKNOWN: unknown error #19965

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

Closed
kmocorro opened this issue Apr 12, 2018 · 3 comments
Closed

NodeJS File System fs.open UNKNOWN: unknown error #19965

kmocorro opened this issue Apr 12, 2018 · 3 comments
Labels
fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform. wrong repo Issues that should be opened in another repository.

Comments

@kmocorro
Copy link

kmocorro commented Apr 12, 2018

  • Version: v8.11.1
  • Platform: 64-bit (Windows)
  • Subsystem: FS

Hi node!

Few days ago, fs.watch() was still able to work with my path ////networkFolder. But after I restarted the server (hard reset), it gave me an unknown error.

Now for me to check the path I did some troubleshooting, so I used fs.open() but it gave me an error.

fs.open('\\\\networkFolder\\sharedFolder\\p\\a\\t\\h', 'r',  (err, fd) => {
    if(err) throw err;
    fs.close(fd, (err) => {
       if (err) throw err;
    });
});

Error: UNKNOWN: unknown error, open '\\networkFolder\sharedFolder\p\a\t\h'

Then I used fs.stat() to verify:

fs.stat('\\\\networkFolder\\sharedFolder\\p\\a\\t\\h', function(err, stat){
   if(err){
      console.log(err);
   } else {
      console.log(stat);
   }
});
{ Error: UNKNOWN: unknown error, stat '\\networkFolder\sharedFolder\p\a\t\h'
  errno: -4094,
  code: 'UNKNOWN',
  syscall: 'stat',
  path: '\\\\networkFolder\\sharedFolder\\p\\a\\t\\h' }

From what I remember, I've used net use to setup my network folder but I don't know if that actually help/works in my problem. I did it again but still no luck for me

Please let me know your thoughts regarding the issue.

Thank you!

@bzoz
Copy link
Contributor

bzoz commented Apr 12, 2018

Is the network share accessible in any other application?

@kmocorro
Copy link
Author

kmocorro commented Apr 12, 2018

.. accessible in any other application?

I haven't tried it to other application, since it's my only app that listen to a file.

Although I used net use and it works fine then in cmd, I tried C:> dir ////networkFolder//shareFolder no error and also already mapped the network share with and without drive letter.

Few days ago it runs smoothly. The app can listen to the file changes using fs.watch. I don't know why all of a sudden fs.watch(), .stat(), .open() seems not to work right after restarting the server.

@thefourtheye thefourtheye added the fs Issues and PRs related to the fs subsystem / file system. label Apr 12, 2018
@bnoordhuis
Copy link
Member

That 4094 error code is a generic network-or-configuration error, Node.js just passes it on from the operating system.

Apropos fs.watch(), note the caveat from the documentation:

watching files or directories can be unreliable, and in some cases impossible, on network file
systems (NFS, SMB, etc)

I'm closing out the issue since it isn't a bug in Node.js itself. If you have follow-up questions, please post them to the nodejs/help repo. You're probably better off getting in touch with your network administrator, though.

@bnoordhuis bnoordhuis added windows Issues and PRs related to the Windows platform. wrong repo Issues that should be opened in another repository. labels Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform. wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

4 participants