# Import data failed document - Some documents could not be imported

**URL:** <https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572>\
**Category:** Kibana\
**Tags:** ingest-pipeline\
**Created:** [November 7, 2021, 10:28pm UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572 "2021-11-07T22:28:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![corndog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corndog/32/96803_2.png) [@corndog](https://discuss.elastic.co/u/corndog)\
**Post date:** [November 7, 2021, 10:28pm UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572/1 "2021-11-07T22:28:38Z")

</div>

I am in the localhost:5601 GUI on the "Add data / Upload File" page.

I am importing a ndjson file with 86 lines and the following mappings set in "Import data / Advanced"

```auto
"mappings": {
  {
    "properties": {
      "site": {
        "type": "text"
      },
      "geometry": {
        "type": "geo_shape"
        }
      }
  }
}

```

When I create my index name and hit "import" I get the warning:  
"1 out of 86 documents could not be imported. This could be due to lines not matching the Grok pattern."

When I try to expand the "Failed documents", nothing gets shown...

How can I efficiently debug / investigate the failing document?

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [November 9, 2021, 6:48pm UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572/2 "2021-11-09T18:48:39Z")

</div>

Do you see any errors in logs or in browser console?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![corndog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corndog/32/96803_2.png) [@corndog](https://discuss.elastic.co/u/corndog)\
**Post date:** [November 9, 2021, 11:30pm UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572/4 "2021-11-09T23:30:22Z")

</div>

@bhavyarm another run with "test" index and full docker logs since clicking import

```auto
kibana | {"type":"response","@timestamp":"2021-11-09T23:26:56+00:00","tags":[],"pid":1217,"method":"get","statusCode":200,"req":{"url":"/internal/file_upload/has_import_permission?checkCreateIndexPattern=true&checkHasManagePipeline=true&indexName=test","method":"get","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":7,"contentLength":28},"message":"GET /internal/file_upload/has_import_permission?checkCreateIndexPattern=true&checkHasManagePipeline=true&indexName=test 200 7ms - 28.0B"}
elastic_search | {"type": "server", "timestamp": "2021-11-09T23:26:57,834Z", "level": "INFO", "component": "o.e.c.m.MetadataCreateIndexService", "cluster.name": "docker-cluster", "node.name": "f63b0da926aa", "message": "[test] creating index, cause [api], templates [], shards [1]/[1]", "cluster.uuid": "ohvpaAn_QqWkrQ2hrD5mEw", "node.id": "4XmFjIPERPCZ5vYulArxHw" }
kibana | {"type":"response","@timestamp":"2021-11-09T23:26:57+00:00","tags":[],"pid":1217,"method":"post","statusCode":200,"req":{"url":"/internal/file_upload/import","method":"post","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","origin":"http://localhost:5601","content-length":"246","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":649,"contentLength":340},"message":"POST /internal/file_upload/import 200 649ms - 340.0B"}
kibana | {"type":"response","@timestamp":"2021-11-09T23:26:58+00:00","tags":[],"pid":1217,"method":"post","statusCode":200,"req":{"url":"/internal/file_upload/import?id=avzbo0iaq","method":"post","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","origin":"http://localhost:5601","content-length":"836655","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":881,"contentLength":87292},"message":"POST /internal/file_upload/import?id=avzbo0iaq 200 881ms - 85.2KB"}
kibana | {"type":"response","@timestamp":"2021-11-09T23:26:59+00:00","tags":[],"pid":1217,"method":"get","statusCode":200,"req":{"url":"/api/index_patterns/_fields_for_wildcard?pattern=test&meta_fields=_source&meta_fields=_id&meta_fields=_type&meta_fields=_index&meta_fields=_score","method":"get","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":12,"contentLength":969},"message":"GET /api/index_patterns/_fields_for_wildcard?pattern=test&meta_fields=_source&meta_fields=_id&meta_fields=_type&meta_fields=_index&meta_fields=_score 200 12ms - 969.0B"}
kibana | {"type":"response","@timestamp":"2021-11-09T23:26:59+00:00","tags":[],"pid":1217,"method":"get","statusCode":200,"req":{"url":"/api/saved_objects/_find?fields=title&per_page=10&search=%22test%22&search_fields=title&type=index-pattern","method":"get","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":11,"contentLength":53},"message":"GET /api/saved_objects/_find?fields=title&per_page=10&search=%22test%22&search_fields=title&type=index-pattern 200 11ms - 53.0B"}
kibana | {"type":"response","@timestamp":"2021-11-09T23:26:59+00:00","tags":[],"pid":1217,"method":"post","statusCode":200,"req":{"url":"/api/saved_objects/index-pattern","method":"post","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","origin":"http://localhost:5601","content-length":"102","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":645,"contentLength":357},"message":"POST /api/saved_objects/index-pattern 200 645ms - 357.0B"}
kibana | {"type":"response","@timestamp":"2021-11-09T23:26:59+00:00","tags":[],"pid":1217,"method":"get","statusCode":200,"req":{"url":"/api/index_patterns/_fields_for_wildcard?pattern=test&meta_fields=_source&meta_fields=_id&meta_fields=_type&meta_fields=_index&meta_fields=_score","method":"get","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":13,"contentLength":969},"message":"GET /api/index_patterns/_fields_for_wildcard?pattern=test&meta_fields=_source&meta_fields=_id&meta_fields=_type&meta_fields=_index&meta_fields=_score 200 13ms - 969.0B"}
kibana | {"type":"response","@timestamp":"2021-11-09T23:27:37+00:00","tags":[],"pid":1217,"method":"post","statusCode":200,"req":{"url":"/api/ui_counters/_report","method":"post","headers":{"host":"localhost:5601","user-agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate","referer":"http://localhost:5601/app/home","content-type":"application/json","kbn-version":"7.14.2","kbn-system-request":"true","origin":"http://localhost:5601","content-length":"153","connection":"keep-alive","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","dnt":"1","sec-gpc":"1"},"remoteAddress":"172.21.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0","referer":"http://localhost:5601/app/home"},"res":{"statusCode":200,"responseTime":656,"contentLength":15},"message":"POST /api/ui_counters/_report 200 656ms - 15.0B"}

```

---

<div class="post-metadata">

**Author:** ![corndog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corndog/32/96803_2.png) [@corndog](https://discuss.elastic.co/u/corndog)\
**Post date:** [November 9, 2021, 11:43pm UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572/5 "2021-11-09T23:43:27Z")

</div>

@bhavyarm good suggestion on using browser console, I have discovered the problem document! Will investigate and let you know the issue with it.

```auto
{
	"success": true,
	"id": "kpyyjga17",
	"index": "blah",
	"docCount": 86,
	"failures": [
		{
			"item": 38,
			"reason": "failed to parse field [geometry] of type [geo_shape]",
			"doc": "{\"OBJECTID\": 39, \"searchable\": \"field value example\", \"geometry\": {\"type\": \"multipolygon\", \"coordinates\": [[[[etc....]]]]}}"
		}
	]
}

```

But the reason is:  
"failed to parse field [geometry] of type [geo\_shape]

I'm also noticing in the browser console that on the POST import response in network tab, that I get a status:400 type: "parse\_exception", reason: "[processors] required property is missing"  
So I will investigate that too

---

<div class="post-metadata">

**Author:** ![corndog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corndog/32/96803_2.png) [@corndog](https://discuss.elastic.co/u/corndog)\
**Post date:** [November 10, 2021, 12:54am UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572/6 "2021-11-10T00:54:17Z")

</div>

@bhavyarm I have found the issue. That particular document had a multipolygon that was self-intersecting as shown in the image. The failure message could be a bit more transparent though!  
 ![Geo_self_intersection](https://us1.discourse-cdn.com/elastic/original/3X/0/5/0556228031bf9f50b6288460e631339c26e34820.png)

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [November 11, 2021, 2:41pm UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572/7 "2021-11-11T14:41:27Z")

</div>

Great. Thanks for keeping us posted.

I totally agree that error message can be improved. Will log a bug.

Thanks,  
Bhavya

---

<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:** [December 9, 2021, 2:41pm UTC](https://discuss.elastic.co/t/import-data-failed-document-some-documents-could-not-be-imported/288572/8 "2021-12-09T14:41:49Z")

</div>

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