DeanCording / node-red-contrib-fs-ops

A Node Red node for performing file system operations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: ENOENT: no such file or directory, access

visibilityspots opened this issue · comments

After updating to version 1.2.2 I retried to upload a firmware, the renaming issue #2 has been solved but now I get a

Error: ENOENT: no such file or directory, access '/path/to/configured/directory'

I checked the permissions of the directory which has the same owner as the user which is running the node-red daemon. Tried changing permissions but no luck so far.

Any suggestions how I could tackle this one too?

Hmm, to do a move between devices I need to read the file, pipe it to the destination file,
and then delete the source file. There are many things that can go wrong here regarding
permissions so I need to check that the source and destination file paths are accessible
before attempting the copy, otherwise it can fail part way through the move. This is a
problem with the pipe function because it is written in native code and errors will crash
Node-Red. These checks are where this error is generated.

I would have expected the error message to read:
Error: ENOENT: no such file or directory, access '/path/to/configured/directory/filename'

So it appears that the filename isn't being set properly in your flow.

On Friday, 16 September 2016 4:32:16 AM AEST Jan Collijs wrote:

After updating to version 1.2.2 I retried to upload a firmware, the renaming issue #2[1] has
been solved but now I get a
Error: ENOENT: no such file or directory, access '/path/to/configured/directory'

I checked the permissions of the directory which has the same owner as the user which is
running the node-red daemon. Tried changing permissions but no luck so far.
Any suggestions how I could tackle this one too?
—You are receiving this because you are subscribed to this thread.Reply to this email
directly, view it on GitHub[2], or mute the thread[3].[4]


[1] #2
[2] #3
[3] https://github.com/notifications/unsubscribe-auth/
AAPVIgR5qOm9ox2piMHLk_PdUPqqM7EIks5qqn5AgaJpZM4J-2Ix
[4] https://github.com/notifications/beacon/AAPVItDClIAYEYmPxO-RLiVSJO_XTTOpks5qqn5AgaJpZM4J-2Ix.gif

In the flow I configured the

firmware.directory

value to /storage/wemos/firmware/ and I made sure that directory was created. But I didn't changed anything according to the filename itself..

This issue is caused by a bug on line 90 fs.accessSync(dest, fs.W_OK);.

This is attempting to test the permissions on a file that does not exist yet. You should first check the destination folder permissions before appending the destination file and doing the copy.

I have submitted pull request #4

Merged.