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

LOCK: No such file or directory #677

Closed
esindger opened this issue Jun 6, 2018 · 6 comments
Closed

LOCK: No such file or directory #677

esindger opened this issue Jun 6, 2018 · 6 comments
Labels

Comments

@esindger
Copy link

esindger commented Jun 6, 2018

Case

Bug

Issue

Error occur if a collection has a slash / in the name folder/collection:

OpenError: IO error: /path/to/store/data/db-rxdb-0-folder/collection/LOCK: No such file or directory
    at /path/to/node_modules/levelup/lib/levelup.js:91:23
    at /path/to/node_modules/deferred-leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16
    at /path/to/node_modules/deferred-leveldown/deferred-leveldown.js:19:21
    at /path/to/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16

I guess the problem is here: https://github.com/pubkey/rxdb/blob/master/src/rx-database.js#L545 and the next code can fix the error:

const pouchLocation = dbName + '-rxdb-' + schemaVersion + '-' + collectionName.replace(/\//g, '');

Info

  • Environment: Node.js
  • Adapter: LevelDB
  • Stack: JavaScript
@pubkey
Copy link
Owner

pubkey commented Jun 6, 2018

Hi @esindger
This looks like a valid bug. Can you make a PR with a test-case?

@esindger
Copy link
Author

esindger commented Jun 6, 2018

Done.

@pubkey
Copy link
Owner

pubkey commented Jun 11, 2018

@esindger
If you use a fs-adapter, set the folder starting with ./. So in the test you should use ./folder/crawlstate
The proposed fix will will remove all backslashes. This is not an option.
Can you ensure that the folder you specifiy as adapter-location, exists.

@esindger
Copy link
Author

I am using the pouchdb-adapter-leveldb adapter. I've tried to replace folder/crawlstate to ./folder/crawlstate in the test and got an error:
OpenError: IO error: vfqttsdjmk-rxdb-0-./folder/crawlstate/LOCK: No such file or directory

What I do wrong? Can you provide complete example?

@pubkey
Copy link
Owner

pubkey commented Jun 20, 2018

Does the folder/ exist or do you assume that it will be created when the database is spawned?

@pubkey
Copy link
Owner

pubkey commented Jun 25, 2018

@esindger sry for the late answer. I understood this now, this is a bug. Fix will come soon.

@pubkey pubkey closed this as completed in 1424359 Jun 26, 2018
pubkey added a commit that referenced this issue Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants