I am getting this weird Error, does anybody know why this is happening and how to solve it

PineconeException: UNKNOWN:Error received from peer ipv4:34.160.88.44:443 {created_time:“2023-11-18T23:32:44.883513453+00:00”, grpc_status:3, grpc_message:“Request size 3MB exceeds the maximum supported size of 2MB”}

this my code, i have traied with different batch size from 50 to 100, but i get the same result.

-------- text_list() return a list of 1498 text elements

batch = 50
id =
vect =
metadata =
for i in tqdm(range(0, len(text_list()), batch)):
end = min(i+batch, len(text_list()))

for x in tqdm(range(i, end)):
id += [f"{x}"]
metadata += [
{
“content”: text_list()
}
]
vect += [model.encode(text_list())]

to_upsert = list(zip(id, vect, metadata))
index.upsert(to_upsert)

You need to either split up your queries or change the descriptiveness of your filtering. You simply are creating too big of a POST body size in the metadata field with your code The max body size is 2MB.

1 Like

As @tim and the error message state. Your request payload is too big. Double check if you need everything you are putting into metadata. If all you have in metadata is pure text, use smaller chunks.

1 Like