# IndexData is returning an error 'The remote server returned an error: (404) Not Found'

**URL:** <https://discuss.elastic.co/t/indexdata-is-returning-an-error-the-remote-server-returned-an-error-404-not-found/86201>\
**Category:** Elasticsearch\
**Created:** [May 18, 2017, 6:25am UTC](https://discuss.elastic.co/t/indexdata-is-returning-an-error-the-remote-server-returned-an-error-404-not-found/86201 "2017-05-18T06:25:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoealex](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@ajoealex](https://discuss.elastic.co/u/ajoealex)\
**Post date:** [May 18, 2017, 6:25am UTC](https://discuss.elastic.co/t/indexdata-is-returning-an-error-the-remote-server-returned-an-error-404-not-found/86201/1 "2017-05-18T06:25:00Z")

</div>

I am using Elasticsearch5.4 and Nest5.4 for creating Index. Its showing an error while executing IndexData

```
 public bool IndexData<T>(T data, string indexName = null, string mappingType = null)
     where T : class, new()
    {
        if (client == null)
        {
            throw new ArgumentNullException("data");
        }
        var result = this.client.Index<T>(data,
          c => c.Index(indexName).Type(mappingType));           
        return result.IsValid;
    }

```

Error showing

```
Invalid NEST response built from a unsuccessful low level call on PUT: /mydocs/indexdocument/2520
# Audit trail of this API call:
- [1] BadResponse: Node: http://elastic:changeme@localhost:9200/ Took: 00:00:00.0370003
 # ServerError: ServerError: 404Type: index_not_found_exception Reason: "no such index and [action.auto_create_index] ([.security,.monitoring*,.watches,.triggered_watches,.watcher-history*]) doesn't match"
# OriginalException: System.Net.WebException: The remote server returned an error: (404) Not Found.
 at System.Net.HttpWebRequest.GetResponse()
at Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData)
# Request:
{"id":2520,"title":"FISMA_Overview.docx","fileExtension":"docx","file":{"_content_length":41040,"_content":"UEsDBBQABgAIAAAAIQBN7NZR0gEAAKAIAAATAMQBW0NvbnRlbnRfVHlwZXNdLnhtbCCiwAEooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}}
# Response:
 {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index and [action.auto_create_index] ([.security,.monitoring*,.watches,.triggered_watches,.watcher-history*]) doesn't match","index_uuid":"_na_","index":"mydocs"}],"type":"index_not_found_exception","reason":"no such index and [action.auto_create_index] ([.security,.monitoring*,.watches,.triggered_watches,.watcher-history*]) doesn't match","index_uuid":"_na_","index":"mydocs"},"status":404}

```

Anyone please help.

---

<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:** [June 15, 2017, 6:25am UTC](https://discuss.elastic.co/t/indexdata-is-returning-an-error-the-remote-server-returned-an-error-404-not-found/86201/2 "2017-06-15T06:25:10Z")

</div>

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