Hi!
I have tried all possible avenues to see if this is a bug on my end, but I do believe this is a Weaviate issue. Please see below. At the end is also a link to github repo with everything needed to reproduce the bug.
To briefly summarize–I have two tenants in my database: ‘main’ and ‘temp.’ Both of these have the same schema and are used to store documents. The schema hierarchy is quite flat: Author → Document → Section → Paragraph.
I am able to retrieve objects with no issue as you can see here:
client.query.get('Author',['name']).with_additional(['id']).with_tenant('main').do()
This returns
{‘data’: {‘Get’: {‘Author’: [{‘_additional’: {‘id’: ‘004ff6ae-b678-5532-9022-4492ad3b0cd7’},
‘name’: ‘PGIM Real Estate’},
{‘_additional’: {‘id’: ‘6af6f587-10ba-5f94-9225-47811045994f’},
‘name’: ‘test author’},
{‘_additional’: {‘id’: ‘c9ca53ff-2ab4-58a0-8a46-731373b57ae7’},
‘name’: ‘Oakley Capital’},
{‘_additional’: {‘id’: ‘eb6b959d-f77e-533c-8d7f-3568caa7f785’},
‘name’: ‘my auth’},
{‘_additional’: {‘id’: ‘fc4ed24e-3575-55dc-9025-7722d322daec’},
‘name’: ‘authoro’}]}}}
However, deleting proves to be impossible, each time returning the same error message:
Of course I am passing in the tenant name:
client.data_object.delete(uuid='6af6f587-10ba-5f94-9225-47811045994f',
consistency_level='ALL',class_name='Author',tenant='main')
Unexpected status code: 422, with response body: {‘error’: [{‘message’: ‘batch delete objects: cannot find objects: class Author has multi-tenancy enabled, but request was without tenant’}]}
with client.batch().configure() as batch:
batch.delete_objects(
class_name="Author",
where={
"path": ["id"],
"operator": "Equal",
"valueText": "fc4ed24e-3575-55dc-9025-7722d322daec",
},
tenant="main",
)
UnexpectedStatusCodeException: Delete object! Unexpected status code: 422, with response body: {‘error’: [{‘message’: ‘check object existence: class Author has multi-tenancy enabled, but request was without tenant’}]}.
client.data_object.reference.delete(from_uuid='6af6f587-10ba-5f94-9225-47811045994f',
from_class_name='Author',
to_class_name='Document',
to_uuid='45bfb74c-a2bc-530e-8671-345804d022c8',
from_property_name='hasDocument',
tenant='main')
UnexpectedStatusCodeException: Delete property reference to object! Unexpected status code: 422, with response body: {‘error’: [{‘message’: ‘msg:source object code:422 err:repo: object by id: search index author: class Author has multi-tenancy enabled, but request was without tenant’}]}.
I even tried just doing a curl and got the same behaviour:
url -X DELETE -H 'Authorization: Bearer [redacted]' https://[redacted]/weaviate/v1/objects/Author/6af6f587-10ba-5f94-9225-47811045994f\?tenant\=main
{“error”:[{“message”:“check object existence: class Author has multi-tenancy enabled, but request was without tenant”}]}
See this github repo on how to recreate the bug: https://github.com/gsVAM/WeaviateBug
Any suggestions are welcome!