Getting 401 error with data insertion

Description

We are using an on prem instance of weaviate. We were able to do some data insertion and retrieval but started getting 401 error and unable to identify the root cause. using multi tenancy model here. here are the error logs for reference.

eaviate.exceptions.WeaviateQueryError: Query call with protocol GQL Aggregate failed with message Error in GraphQL response: [
{
“locations”: [
{
“column”: 12,
“line”: 1
}
],
“message”: "shard Tenantname: status code: 401, error: ",
“path”: [
“Aggregate”,
“collection1”
]
}
], for the following query: {Aggregate{NaaS1(tenant: “Tname”){meta{count}}}}.
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=2, type=1, proto=0, laddr=(‘10.110.183.26’, 53626), raddr=(‘173.37.11.56’, 6380

Any guidance on this error is much appreciated.

hi @aparna_raj !!

Welcome to our community!

Please, when asking for support in forums, always fill in the requested infos like version, deployment, etc.

Please, can you share the code used for creating the collection, tenant and ingesting some data?

THanks!

Hi Duda

Please find the details below

Weaviate Server Version: 1.25.7

Deployment Method: k8s

Multi Node? Number of Running Nodes: 3

Client Language and Version: Python 3.12

Multitenancy?: yes

Create multi-tenancy Cluster

def create_collection(client, tenant):
     if client.collections.exists("collname"):
        client.collections.delete("collname ")

coll = client.collections.create(
    name=" collname ",
    multi_tenancy_config=Configure.multi_tenancy(
        enabled=True,
        auto_tenant_activation=True
    ),
    # Enabling the vectorizer
   
    vectorizer_config=wc.Configure.Vectorizer.text2vec_cohere(model="embed-english-v3.0"),
    generative_config=wc.Configure.Generative.cohere(model="command-xlarge-nightly"),

    properties=[
        wc.Property(name="source", data_type=wc.DataType.TEXT),
        wc.Property(name="raw_text", data_type=wc.DataType.TEXT),
    ],
)

# Create a tenant inside a collection
coll.tenants.create(
    tenants=[
        Tenant(name=tenant)
    ]
)
tenants = coll.tenants.get()
print(tenants)

print("Collection created successfully: collname")

Inserting the data in Multi tenant collection

def insert_data(wvc, content, tenant):
uuid_lst =

base_coll = wvc.collections.get("collname")
collection = base_coll.with_tenant(tenant)

# Insert the data objects
with collection.batch.fixed_size(
        batch_size=50,
        # concurrent_requests=1
) as batch:
    batch.add_object(content)

#import pdb; pdb.set_trace()
print("Data inserted successfully: collname ")

if len(collection.batch.failed_objects) > 0:
    print("Failed to insert data")
    for failed_object in collection.batch.failed_objects:
        print(failed_object)

print(collection.aggregate.over_all())

return collection