wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
529 stars 75 forks source link

put operation shows No such file or directory error #69

Closed juyuancai closed 6 years ago

juyuancai commented 6 years ago

I am using plyvel to store data. I use pickle to dump python object into binary data, and use db.put to store it as value. however, I randomly got the error below:

Traceback (most recent call last):
  File "/home/cjy/project/mcpt_workflow/Frameset.py", line 267, in run
    current_step,input_pkg=path.passPath(input_pkg,self.database)
  File "/home/cjy/project/mcpt_workflow/Frameset.py", line 104, in passPath
    db.recordPathData(key,input_pkg)
  File "/home/cjy/project/mcpt_workflow/Dbhelper.py", line 26, in recordPathData
    self.db.put(path_key.encode("utf8"),self.s)
  File "plyvel/_plyvel.pyx", line 331, in plyvel._plyvel.DB.put
  File "plyvel/_plyvel.pyx", line 94, in plyvel._plyvel.raise_for_status
Error: NotFound: workflow1.db/000034.ldb: No such file or directory

NotFound: workflow1.db/000034.ldb: No such file or directory

It does not always show this error, and the ldb file is not always the same. However, when I check my database folder, I can see the ldb file. I do not know why. could anyone help me? I am using plyvel 1.01 and python 2.7

wbolster commented 6 years ago

this is not a plyvel issue, it's an issue reported by leveldb. are you sure there's only one process using the db at a time?

juyuancai commented 6 years ago

I think so. I did more test and find that if I use absolute path to create db object, it works just fine, if I use relative path to create db object, it will show this error. Is it anything to do with the data I store in to the database? Or i what case the db project will change the path it find the database? I print the pwd every loop, and they all in the the same pwd. Thank you.

wbolster commented 6 years ago

a minimal test case would help so that i can see if i can reproduce. i've never seen anything like this.