# Error when creating an object

**URL:** <https://forum.weaviate.io/t/error-when-creating-an-object/1481>\
**Category:** Support\
**Created:** [February 14, 2024, 4:27pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481 "2024-02-14T16:27:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ananthan-123](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/ananthan-123/32/451_2.png) [@ananthan-123](https://forum.weaviate.io/u/ananthan-123)\
**Post date:** [February 14, 2024, 4:27pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/1 "2024-02-14T16:27:51Z")

</div>

below is the code I am using to to add objects to a class.

```auto
    splitter = RecursiveCharacterTextSplitter(
        chunk_size=3000,
        chunk_overlap=0
    )
    splitted_docs_list = splitter.split_documents(encrypted_docs)

    for doc_content in splitted_docs_list:
        doc_object = {
            "content": doc_content.page_content,
            "source": doc_content.metadata['source']
        }

        client.data_object.create(data_object=doc_object, class_name="Data")

```

Sometimes OpenAI returns an error

`WeaviateBaseError("Creating object! Unexpected status code: 500, with response body: {'error': [{'message': 'update vector: unmarshal response body: json: cannot unmarshal number into Go struct field openAIApiError.error.code of type string'}]}.")`

What might be causing this error ? Any way to view the error returned by openAI ?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 14, 2024, 11:44pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/2 "2024-02-14T23:44:22Z")

</div>

Hi @ananthan-123

That’s strange.

Will it happens with a smaller chunk\_size?  
What version are you running?

Have you triede with the python client v4? (Altough, this may not be related to the client)

And finally, can you create a complete script that reproduces this with a content you could share?

Thanks!

---

<div class="post-metadata">

**Author:** ![ananthan-123](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/ananthan-123/32/451_2.png) [@ananthan-123](https://forum.weaviate.io/u/ananthan-123)\
**Post date:** [February 15, 2024, 12:16pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/3 "2024-02-15T12:16:33Z")

</div>

I tried to run it today and I am not getting the error. I’ll update if it gives error again.

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 15, 2024, 1:06pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/4 "2024-02-15T13:06:21Z")

</div>

This smells like openai returning some unmapped error, so Weaviate couldn’t use it as response to your query.

My suggestion is to use pyv4 (it really improves performance, specially for ingestion) and use batch, making sure to properly handle errors, like so:

> **[Python | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/client-libraries/python#batching)**
>
> Overview

---

<div class="post-metadata">

**Author:** ![manuharari](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/manuharari/32/4097_2.png) [@manuharari](https://forum.weaviate.io/u/manuharari)\
**Post date:** [May 14, 2025, 11:38pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/5 "2025-05-14T23:38:22Z")

</div>

Did you have any luck fixing this? Been trying for the last two weeks

---

<div class="post-metadata">

**Author:** ![manuharari](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/manuharari/32/4097_2.png) [@manuharari](https://forum.weaviate.io/u/manuharari)\
**Post date:** [May 14, 2025, 11:40pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/6 "2025-05-14T23:40:45Z")

</div>

For me it happens in any size

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [May 15, 2025, 6:55pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/7 "2025-05-15T18:55:17Z")

</div>

hi @manuharari!

Your issue is a different one, check the answer here:

> [@Weaviate "update vector: unmarshal error response body: Not Found" on Object Creation with text2vec-huggingface](https://forum.weaviate.io/t/weaviate-update-vector-unmarshal-error-response-body-not-found-on-object-creation-with-text2vec-huggingface/21059/2):
>
> Hi @manuharari !! I believe this issue is related to this PR: Note that this PR was backported only to 1.28.15: I noticed you are using a really old version, 1.26.0 So I suggest you to upgrade path: 1.26.0 → 1.26.latest → restart → 1.27.latest → restart → 1.28.latest in between each restart, wait all the data get loaded and the cluster stabilized. Or, of your data is not too big, you can copy your data over to a new cluster running the latest version or the target version. Let me know …

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [May 15, 2025, 6:55pm UTC](https://forum.weaviate.io/t/error-when-creating-an-object/1481/8 "2025-05-15T18:55:23Z")

</div>


