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

Bug: Python error: RuntimeError: Opening RocksDB #434

Open
3 tasks done
espdev opened this issue Nov 8, 2023 · 2 comments
Open
3 tasks done

Bug: Python error: RuntimeError: Opening RocksDB #434

espdev opened this issue Nov 8, 2023 · 2 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@espdev
Copy link

espdev commented Nov 8, 2023

Describe the bug

Hello,

I try to use embedded RocksDB data engine with ustore package in Python (3.10) and I get an error: RuntimeError: Opening RocksDB

I try to use an example from the Readme:

from ustore import rocksdb

db = rocksdb.DataBase('/home/user/tmp/try_ustore/rocksdb/')  # the error is here
db.main[42] = 'hello!

The directory /home/user/tmp/try_ustore/rocksdb/ is exist.

If I use open=False I get an error: RuntimeError: DataBase is uninitialized.

db = rocksdb.DataBase('/home/user/tmp/try_ustore/rocksdb/', open=False) 
db.main[42] = 'hello!  # the error is here

There are no any logs or debug info, so I do not understand what is happening and why the database cannot be created and opened. Maybe are some additional dependencies needed, or do I need to set some config? But in the Readme or the documentation I cannot find anything about this.

Steps to reproduce

# pip install ukv

from ustore import rocksdb

db = rocksdb.DataBase('/path/to/db/directory/')
db.main[42] = "hello"

Expected behavior

A database is created/opened and can be used

UStore version

0.12.1

Operating System

Ubuntu 20.04, Mint 21.2

Hardware architecture

x86

Are you using an embedded version?

  • I use the embedded version

Which interface are you using?

Official Python bindings

Which engine are you using?

RocksDB

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@espdev espdev added bug Something isn't working invalid This doesn't seem right labels Nov 8, 2023
@espdev
Copy link
Author

espdev commented Nov 8, 2023

I just try to open the database with the following code:

db = rocksdb.DataBase('{"create_if_missing": true, "version": "1.0", "directory": "./rocksdb/"}')

And it works! Guys, could you please update the readme and documentation? This is very unobvious. Thanks!
Also the same for LevelDB data engine.

@ashvardanian
Copy link
Contributor

Hey @espdev! Thank you for noticing it! Would you be able to open a patch for docs? Happy to merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants