# 502 errors while indexing and querying

**URL:** <https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98>\
**Category:** Support\
**Created:** [May 29, 2023, 6:29am UTC](https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98 "2023-05-29T06:29:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafael\_zilberman](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/rafael_zilberman/32/96_2.png) [@rafael\_zilberman](https://forum.weaviate.io/u/rafael_zilberman)\
**Post date:** [May 29, 2023, 6:29am UTC](https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98/1 "2023-05-29T06:29:54Z")

</div>

Hey,  
I just setup a new cluster (basic) and I am trying to index ~150K documents to it from Google Collab.  
I am getting 502 errors while indexing and the weaviate python package doesn’t handles it correctly.  
It seems that the 502 errors are pretty common, even after retrying my self, after ~3K documents on average I am getting the 502 again.  
Any suggestions?

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/1X/a84650bec3fa14e81266534fe105aa1c62a71419.png)

---

<div class="post-metadata">

**Author:** ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)\
**Post date:** [May 30, 2023, 3:08am UTC](https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98/2 "2023-05-30T03:08:56Z")

</div>

Hi @rafael_zilberman - just wondering, are you using a vectorizer? Or manually specifying your vectors?

The error handling aside, I’m wondering what the root cause of the errors might be.

---

<div class="post-metadata">

**Author:** ![rafael\_zilberman](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/rafael_zilberman/32/96_2.png) [@rafael\_zilberman](https://forum.weaviate.io/u/rafael_zilberman)\
**Post date:** [May 30, 2023, 4:59am UTC](https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98/3 "2023-05-30T04:59:55Z")

</div>

Hey,

Yes, we are using an OpenAI vectorizer with the default model (ada-002).

---

<div class="post-metadata">

**Author:** ![Glockenbeat](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/glockenbeat/32/51_2.png) [@Glockenbeat](https://forum.weaviate.io/u/Glockenbeat)\
**Post date:** [May 30, 2023, 11:32am UTC](https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98/4 "2023-05-30T11:32:46Z")

</div>

Hi @rafael_zilberman!

We had another closer look at this, and found the cause. Actually the connection for the vectorizer to OpenAI took quite long during your import (\>30s), probably because they were under heavy load. This caused

1. Weaviate to take exceptionally long to import your objects
2. The Python client to eventually time out
3. The load balancer to assume that Weaviate was not available, resulting in the 502 code (this should only have lasted for a couple of seconds)

Unfortunately there’s nothing we can do about the external request timing out, this is a scenario that might occur and is out of our control. However we are already making plans to improve the communication and timeout processes around this behaviour on our side, so that you should be able to get better insights right from the responses in the future.

---

<div class="post-metadata">

**Author:** ![rafael\_zilberman](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/rafael_zilberman/32/96_2.png) [@rafael\_zilberman](https://forum.weaviate.io/u/rafael_zilberman)\
**Post date:** [May 30, 2023, 1:44pm UTC](https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98/5 "2023-05-30T13:44:43Z")

</div>

Hey,

Thanks for the reply.

I just suggest handling such timeouts using the retry\_timeouts parameter and improve the error handling in general in the Python library 🙂  
Thanks

---

<div class="post-metadata">

**Author:** ![samthedataman](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/samthedataman/32/685_2.png) [@samthedataman](https://forum.weaviate.io/u/samthedataman)\
**Post date:** [November 27, 2023, 5:27am UTC](https://forum.weaviate.io/t/502-errors-while-indexing-and-querying/98/6 "2023-11-27T05:27:45Z")

</div>

Any updates here I’m confused the entire point of weavite is to loader vectors into a schema and I continue to get 502 errors when I try to upload my data set (about 642k rows ) . How is there not a better solution?
