montydb icon indicating copy to clipboard operation
montydb copied to clipboard

Permission denied with empty collections on LMDB

Open pgmillon opened this issue 4 years ago • 2 comments

Hi, I've got a weird lmdb.ReadonlyError: mdb_dbi_open: Permission denied when using a cursor over an empty collection.

How to reproduce:

set_storage('some_file', storage='lightning')
client = MontyClient('some_file')

db = client['my_db']
db.create_collection('my_col')

db['my_col'].find().next()

Even a count raises the same error so I'm still trying to figure out a workaround.

pgmillon avatar Jul 18 '21 07:07 pgmillon

Hi @pgmillon ,

I have just tested it and able to reproduce, looks like there's something wrong when calling db.create_collection explicitly.

But should be fine if you skip that explicit collection creation. This works on my end :

set_storage('some_file', storage='lightning')
client = MontyClient('some_file')
db = client['my_db']
db['my_col'].find().next()
# raise StopIteration

davidlatwe avatar Jul 18 '21 08:07 davidlatwe

Hi, thanks for the quick feedback, I could prevent the creation of the collection completely on my side but the workaround is appreciated.

pgmillon avatar Jul 19 '21 14:07 pgmillon