UnexpectedStatusCodeError: Create class! Unexpected status code: 422, with response body: {'error': [{'message': 'vectorizer: no module with name "text2vec-aws" present'}]}

Description

I use aws weaviate api to create class with vectorizer: text2vec-aws,but it said no module with name “text2vec-aws” present’. I mask my url and keys, the client is ready to connect.

Server Setup Information

i am using python 3.12 , have below code to setup weaviate client, and create class:

import weaviate

client = weaviate.Client(
url = “https:// *****”,
auth_client_secret=weaviate.auth.AuthApiKey(api_key=" ****“),
additional_headers= {
“X-AWS-Access-Key”: " ******”,
“X-AWS-Secret-Key”: " *******",
}
)

class_obj = {
“class”: “Document”,
“description”: “A class called document”,
“vectorizer”: “text2vec-aws”,
“vectorIndexConfig”: {
“distance”: “cosine”
},
“moduleConfig”: {
“text2vec-aws”: {
“model”: “amazon.titan-embed-text-v1”,
“region”: “us-west-2”,
“vectorizeClassName”: False,
}
},
“properties”: [
{
“name”: “content”,
“dataType”: [“text”],
“description”: “Content that will be vectorized”,
“moduleConfig”: {
“text2vec-aws”: {
“skip”: False,
“vectorizePropertyName”: False,
}
}
}
]
}
exists = client.schema.exists(“Document”)
# The following created the class Document just once
if (exists == True):
client.schema.delete_class(“Document”)
client.schema.create_class(class_obj)
print(“The class is created again”)

else:
print(“Class ‘Document’ created successfully.”)
client.schema.create_class(class_obj)

  • Weaviate Server Version: AWS Weaviate instance
  • Deployment Method:
  • Multi Node? Number of Running Nodes:
  • Client Language and Version: python 3.12

Any additional Information

UnexpectedStatusCodeException(“Create class”, response) UnexpectedStatusCodeError: Create class! Unexpected status code: 422, with response body: {‘error’: [{‘message’: ‘vectorizer: no module with name “text2vec-aws” present’}]}.

Hi @alisha_liu ! Welcome to our community :hugs:

This most likely because you do not have this module enabled in your Weaviate server.

You can check that by calling:

client.get_meta()

In order to enable a module, you need add it to your ENABLED_MODULE environment variable:

Let me know if this helps :slight_smile:

1 Like

Thanks for your quick response!

I run this command: client.get_meta()

output is:

{‘hostname’: ‘http://[::]:8080’, ‘modules’: {}, ‘version’: ‘1.23.3’}

Yes, I understand there is no module enabled, currently I am working on romote aws weaviate client, so where I add ENABLED_MODULE environment variable, in my local docker-compose.yml? Does this changes affect other users that connect with same client configuration?

You will need to change this in your Weaviate server.

How is it deployed in AWS?

Thanks for your answer, I will connect my team to enable it in Weaviate server, it is deployed by Kubernetes in AWS.