wbolster / plyvel

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

IOError in Python3.8 with Ubuntu20.04 #119

Closed abersheeran closed 3 years ago

abersheeran commented 3 years ago
Traceback (most recent call last):
  File "leveldb.py", line 3, in <module>
    db = plyvel.DB('./hash-leveldb/', create_if_missing=True)
  File "plyvel/_plyvel.pyx", line 247, in plyvel._plyvel.DB.__init__
  File "plyvel/_plyvel.pyx", line 88, in plyvel._plyvel.raise_for_status
plyvel._plyvel.IOError: b'IO error: ./hash-leveldb/: Invalid argument'

All code.

import plyvel

db = plyvel.DB('./hash-leveldb/', create_if_missing=True)
wbolster commented 3 years ago

this error is reported by leveldb, and does not seem to originate from python.

i can't reproduce with plyvel 1.3.0 on python 3.8 on linux, without an existing database:

$ python -m venv tmpenv

$ ./tmpenv/bin/pip install plyvel
Collecting plyvel
  Using cached plyvel-1.3.0-cp38-cp38-manylinux2010_x86_64.whl (738 kB)
Installing collected packages: plyvel
Successfully installed plyvel-1.3.0

$ ./tmpenv/bin/python
Python 3.8.6 (default, Sep 30 2020, 04:00:38) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import plyvel
>>> import plyvel
>>> db = plyvel.DB('./hash-leveldb/', create_if_missing=True)
>>> db.put(b'hello', b'world')
>>> db.get(b'hello')
b'world'
>>> 

so...

abersheeran commented 3 years ago

Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux

plyvel 1.3.0 Ubuntu20.04 wheel No old database yes, is ok and has permissions. only one process and one threading

wbolster commented 3 years ago

closing this issue since this is likely not a plyvel problem.

your problem is quite likely your file system, e.g. a file system type that doesn't work well with what leveldb expects (e.g. file locking support).

you can confirm this hypothesis by trying with a database in /tmp or a directory residing on a native file system on the same machine with the same program.