# NEST Bulk API Validation Error: type is missing

**URL:** <https://discuss.elastic.co/t/nest-bulk-api-validation-error-type-is-missing/243752>\
**Category:** Elasticsearch\
**Created:** [August 4, 2020, 5:10pm UTC](https://discuss.elastic.co/t/nest-bulk-api-validation-error-type-is-missing/243752 "2020-08-04T17:10:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmattingly](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lmattingly](https://discuss.elastic.co/u/lmattingly)\
**Post date:** [August 4, 2020, 5:10pm UTC](https://discuss.elastic.co/t/nest-bulk-api-validation-error-type-is-missing/243752/1 "2020-08-04T17:10:24Z")

</div>

Hi,

I'm experiencing  
"Invalid NEST response built from a unsuccessful (400) low level call on POST: /indexname/\_bulk"  
Bad Request with '{Type: action\_request\_validation\_exception Reason: "Validation Failed: 1: type is missing;2: type is missing;"}'

When I'm attempting to make bulk api calls into our elasticsearch cluster.

NEST Client: 7.8.2  
Elasticsearch Version: 6.5 (AWS hosted Elasticsearch Service)

Setup of the Client:

```auto
            var httpConnection = new AwsHttpConnection(awsRegion);

            var pool = new SingleNodeConnectionPool(new Uri(elasticSearchEndpoint));
            var config = new ConnectionSettings(pool, httpConnection);
            var esclient = new ElasticClient(config);

```

This is just an example, but I've tried multiple different variations of the bulk or index many call all with the same results:

```auto
            var doc= new ProductModel
            {
                Id = 1,
                Quantity = "5",
                Price = "25"
            };

            var docs = new List<DocumentModel>() { doc};

            BulkDescriptor bulkDescriptor = new BulkDescriptor(indexName.ToLowerInvariant()){};
            BulkResponse response = ElasticClient.Bulk(bulkDescriptor.IndexMany(docs));

```

Couple of side notes,

1. We have a working index call below:  
IndexResponse response = ElasticClient.Index(new IndexRequest(doc, indexName));  
I noticed that the IndexRequest object uses the path of " /{index}/\_doc/{id}"

2. We have used postman to make calls into our elasticsearch hitting the bulk endpoint  
POST https:/ClusterUrl/indexname/\_doc/\_bulk

I have a feeling the bulk call is failing because mapping types aren't supported in 7 and I can't supply the 'type' field to any of the bulk/indexmany calls.

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 4, 2020, 11:41pm UTC](https://discuss.elastic.co/t/nest-bulk-api-validation-error-type-is-missing/243752/2 "2020-08-04T23:41:49Z")

</div>

Hi @lmattingly,

You must use NEST 6.x with Elasticsearch 6.x. A major version of the client is compatible with the same major version of Elasticsearch, so you can use the latest 6.x NEST version with Elasticsearch 6.5. [Check out the compatibility docs for more details.](https://github.com/elastic/elasticsearch-net#compatibility-matrix)

---

<div class="post-metadata">

**Author:** ![lmattingly](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lmattingly](https://discuss.elastic.co/u/lmattingly)\
**Post date:** [August 5, 2020, 12:04am UTC](https://discuss.elastic.co/t/nest-bulk-api-validation-error-type-is-missing/243752/3 "2020-08-05T00:04:12Z")

</div>

Hi @forloop,

Thanks. I'll definitely work towards upgrading our Elasticsearch version. Is there an ideal place to look for upgrade process/changes that could affect us when upgrading versions?

I had issues with other ES calls when I downgraded our library. I was able to find a work around though, even though this might not be best practice.

I added a type query string to include the \_doc which allowed the bulk call to be successful.

```auto
                BulkResponse response = ElasticClient.Bulk(bulkDescriptor.IndexMany(docs).TypeQueryString("_doc"));

```

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [August 5, 2020, 12:13am UTC](https://discuss.elastic.co/t/nest-bulk-api-validation-error-type-is-missing/243752/4 "2020-08-05T00:13:03Z")

</div>

I would still recommend using NEST 6.x and fix the issues you came across as you may run across other incompatibilities between Elasticsearch 6.x and NEST 7.x which can't be easily worked around.

> [@lmattingly](#):
>
> Is there an ideal place to look for upgrade process/changes that could affect us when upgrading versions?

It's a good idea to look at both the Elasticsearch changes and client changes when looking at an upgrade:

- [Elasticsearch releases notes](https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-7.0.0.html) and [breaking changes from 6.x to 7.x](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html).
- [NEST and Elasticsearch.Net changes from 6.x to 7.x](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/_breaking_changes.html)

The client changes will include changes that originate from changes in Elasticsearch, in addition to client specific changes.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 2, 2020, 12:13am UTC](https://discuss.elastic.co/t/nest-bulk-api-validation-error-type-is-missing/243752/5 "2020-09-02T00:13:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
