Specifying properties with multi-tenancy causes bug

Description

When I just specify multi-tenancy, all my insert / updates work.

However, when I just add properties to the schema declaration, I start to get this error:

weaviate.exceptions.UnexpectedStatusCodeError: Object was not updated.! Unexpected status code: 422, with response body: {‘error’: [{‘message’: ‘msg:repo.object code:422 err:search index nodes: class Nodes has multi-tenancy disabled, but request was with tenant’}]}.

This is the code:

nodes_collection = client.collections.create(
		name="Nodes",
		vectorizer_config=wvc.config.Configure.Vectorizer.none(),
		vector_index_config=Configure.VectorIndex.hnsw(
			distance_metric=VectorDistances.COSINE
		),
		# Multi tenancy to separate each user's data
		multi_tenancy_config=Configure.multi_tenancy(enabled=True, auto_tenant_creation=True, auto_tenant_activation=True),
		# Specify some properties beforehand to set right data type (i.e. obj[] instead of string[])
		properties=[
			Property(name="tags", data_type=DataType.OBJECT_ARRAY),
		]
	)

If I remove the properties field, then it will work again.

This is an example insert code:

def get_tenant_collection(name):
	try:
		return nodes_collection.with_tenant(name)
	except:
		nodes_collection.tenants.create(name)
		return nodes_collection.with_tenant(name)

tenant_collection = get_tenant_collection(tenant_name)
	
tenant_collection.data.insert(
	vector=record.vector,
	properties=record.properties,
	uuid=record.uniqueid
)

Even update / delete, all operations trigger the multi-tenancy error. I can confirm the rest of the code is working including getting the tenant collection because just commenting out properties, will make everything start working

nodes_collection = client.collections.create(
		name="Nodes",
		vectorizer_config=wvc.config.Configure.Vectorizer.none(),
		vector_index_config=Configure.VectorIndex.hnsw(
			distance_metric=VectorDistances.COSINE
		),
		# Multi tenancy to separate each user's data
		multi_tenancy_config=Configure.multi_tenancy(enabled=True, auto_tenant_creation=True, auto_tenant_activation=True),
		# Commenting this out makes all operations work again
		# properties=[
		# 	Property(name="tags", data_type=DataType.OBJECT_ARRAY),
		# ]
	)

Server Setup Information

  • Weaviate Server Version: Cloud
  • Multi Node? Number of Running Nodes: No
  • Client Language and Version: Python v4
  • Multitenancy?: Yes

hi @Tejas_Sharma !!

I believe you are facing this issue:

Please, make sure to leave a :+1: on that issue so we can prioritize it.

THanks!

Hi @DudaNogueira ,

I think mine is completely different because their bug is about multi-tenant to non-tenant but mine is that there is a bug in the SDK that if both multi tenancy and properties are specified, then everything breaks

Oh, sorry.

Do you think you can create a reproducible python code?

With that we better understand the issue by reproducing or fixing any code or assumptions along the way.

That issue has a python code that can server as starting point.

Thanks!

Okay thanks Duda, will try to get it out soon