# BUG: Batcher doesn't upload the objects to the weaviate db

**URL:** https://forum.weaviate.io/t/bug-batcher-doesnt-upload-the-objects-to-the-weaviate-db/4421
**Category:** Support
**Created:** [October 4, 2024, 1:52pm UTC](https://forum.weaviate.io/t/bug-batcher-doesnt-upload-the-objects-to-the-weaviate-db/4421 "2024-10-04T13:52:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jekabsons](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jekabsons/32/2457_2.png) [@Jekabsons](https://forum.weaviate.io/u/Jekabsons)
#### Post date: [October 4, 2024, 1:52pm UTC](https://forum.weaviate.io/t/bug-batcher-doesnt-upload-the-objects-to-the-weaviate-db/4421/1 "2024-10-04T13:52:01Z")

</div>

### Description

In short, when I run automatic object uploader, that attempts to upload a set of objects one after another, my weaviate instance batcher doesn’t upload couple of provided sets. It returns a valid message “resp” in `resp, err := batcher.Do(ctx)` containing all of the fields and vectors for the provided object but doesn’t include the object in the database. Furthermore, when I upload large amounts of objects to the database, at some point I can’t even upload any object sets to the respective collection, but they do successfully upload to any other collection containing less elements.

Here is my code snippet:

```auto
batcher := client.Batch().ObjectsBatcher()

	// uploads data in batches of 20 or less chapters to prevent weaviate timeout
	batchCount := int(math.Ceil(float64(len(ObjectSet)) / batchSize))

	ObjectSetLen := len(ObjectSet)

	for i := 0; i < batchCount; i += 1 {
        // calculates the last object index for the object array that needs to be batched
		lastBatchElementIndex := (i + 1) * batchSize
		if lastBatchElementIndex > ObjectSetLen {
			lastBatchElementIndex = ObjectSetLen
		}

        // sets up the batcher and batches the objects
		for j := (i * batchSize); j < lastBatchElementIndex; j += 1 {
        //To avoid empty content error, makes a content check
			test := strings.ReplaceAll(ObjectSet[j].Content, " ", "")
			if test == "" {
				continue
			}
			dataObj := requests.SetSectionObj{
				Category: ObjectSet[j].Title,
				Content: ObjectSet[j].Content,
			}

			batcherObject := &models.Object{
				Class: class,
				Properties: dataObj,
			}

			batcher.WithObjects(batcherObject)

		}

		resp, err := batcher.Do(ctx)
		if err != nil {
			utils.SetError(ctx, fasthttp.StatusInternalServerError, err.Error())
			return
		}
		log.Print(resp)
	}

	ctx.StatusCode(fasthttp.StatusNoContent)

```

### Server Setup Information

- Weaviate Server Version: 1.25.19
- Deployment Method: Docker
- Multi Node? Number of Running Nodes: 1
- Client Language and Version: Go 1.23
- Multitenancy?: No

### Any additional Information

Weaviate logs do not provide any information in regards to this and does not throw any errors

---

<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: [November 1, 2024, 2:52pm UTC](https://forum.weaviate.io/t/bug-batcher-doesnt-upload-the-objects-to-the-weaviate-db/4421/2 "2024-11-01T14:52:39Z")

</div>

hi @Jekabsons !!

Sorry, we missed this message ☹

Were you able to overcome this?

Thanks!

---

<div class="post-metadata">

### Author: ![Jekabsons](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jekabsons/32/2457_2.png) [@Jekabsons](https://forum.weaviate.io/u/Jekabsons)
#### Post date: [November 8, 2024, 9:12pm UTC](https://forum.weaviate.io/t/bug-batcher-doesnt-upload-the-objects-to-the-weaviate-db/4421/3 "2024-11-08T21:12:09Z")

</div>

Hi, yes, the problem in the end was that I fetched the objects using this method:

```auto
resp, err := client.GraphQL().Get().WithClassName("ABCD").Do(context.Background())

```

And as it turns out I wasn’t familiar with pagination concept before and didn’t now that the maximum amount of objects a GraphQL query return  
is 100. But I fixed the issue by using `.WithOffset(100)` method, and looping through the whole dataset.

---

<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: [November 10, 2024, 11:14am UTC](https://forum.weaviate.io/t/bug-batcher-doesnt-upload-the-objects-to-the-weaviate-db/4421/4 "2024-11-10T11:14:48Z")

</div>

Thanks for sharing!!
