Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Error: ENOENT: no such file or directory #351

Closed
haadcode opened this issue Jul 7, 2016 · 8 comments
Closed

Error: ENOENT: no such file or directory #351

haadcode opened this issue Jul 7, 2016 · 8 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@haadcode
Copy link
Member

haadcode commented Jul 7, 2016

As of 0.14.1 I'm seeing this fairly constantly:

Error: ENOENT: no such file or directory, open '/tmp/orbit-tests/blocks/1220a892/1220a89239577c1a6763066dd2ff7ed57078efcb951ad5f94fc7262ea673d3e938da.data'

This happens when I do ipfs.object.put and then try to get it immediately after. Adding a timeout before .get seems to get rid of the problem, so my suspicion is that we're returning from put before the data has been written to "disk" (disk being wherever we write the data blocks).

@haadcode haadcode added the kind/bug A bug in existing code (including security flaws) label Jul 7, 2016
@haadcode
Copy link
Member Author

haadcode commented Jul 7, 2016

To emphasise the urgency: this breaks pretty much all tests for Orbit and down the line in orbit-db.

@dignifiedquire
Copy link
Member

And another bug due to node streams 😢

@daviddias
Copy link
Member

@dignifiedquire there are some layers of indirection, because of the streams to {indexedDB, fs}, but IIRC, we fixed that in IndexedDB, but I guess that fs-blob-store never got the love required since we never noticed a bug there (which probably was just because fs was way faster).

Do you see this problem in orbit in the browser or in a Node.js process?

We have locks for writing https://github.com/ipfs/js-ipfs-repo/blob/master/src/stores/datastore.js#L34 so that we don't step into concurrent processes toes, we might want to add them to reads (wait for the write to finish). Also, seems like it is the time to add LRU caching to blocks, it will improve perf and would mitigate this issue.

@haadcode do you feel like tackling these?

@dignifiedquire
Copy link
Member

I am not sure the fix will actually work on fs-blob-store, all my tries have failed so far.

@daviddias
Copy link
Member

This should be fixed once #403 is done

@dignifiedquire
Copy link
Member

#403 was merged and released, so this should be fixed now. Please reopen if this still happens.

@daviddias
Copy link
Member

@haadcode please, verify :)

@SignpostMarv
Copy link

seeing this under { version: '0.41.2', repo: 7, commit: '' } on node 13.9.0 on win10.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

4 participants