# Failed to execute 'Download CSV'

**URL:** https://discuss.elastic.co/t/failed-to-execute-download-csv/257603
**Category:** Kibana
**Created:** [December 4, 2020, 2:24am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603 "2020-12-04T02:24:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![t98907](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/t98907/32/80243_2.png) [@t98907](https://discuss.elastic.co/u/t98907)
#### Post date: [December 4, 2020, 2:24am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/1 "2020-12-04T02:24:01Z")

</div>

Hi there,

Kibana: 7.8.0

'Download CSV' failed even though I am logged in as 'elastic' user.  
Must '\_source' be enabled on the index to run 'Download CSV'?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 4, 2020, 2:42am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/2 "2020-12-04T02:42:07Z")

</div>

If there was an error, posting that would be helpful.  
Also check your Kibana logs.

---

<div class="post-metadata">

### Author: ![t98907](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/t98907/32/80243_2.png) [@t98907](https://discuss.elastic.co/u/t98907)
#### Post date: [December 4, 2020, 6:26am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/3 "2020-12-04T06:26:38Z")

</div>

I got the following errors below:

```auto
{"type":"log","@timestamp":"2020-12-04T02:14:54Z","tags":["info","reporting","savedobject-csv","csv_from_savedobject","execute-job","immediate"],"pid":6,
 "message":"Executing job from Immediate API using request context"}

{"type":"log","@timestamp":"2020-12-04T02:14:54Z","tags":["error","reporting","savedobject-csv"],"pid":6,
  "message":"{ Error: [illegal_argument_exception] unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\n at respond (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)\n at checkRespForFailure (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)\n at HttpConnector.<anonymous> (/usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)\n at IncomingMessage.wrapper (/usr/share/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)\n at IncomingMessage.emit (events.js:203:15)\n at endReadableNT (_stream_readable.js:1145:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)\n status: 400,\n displayName: 'BadRequest',\n message:\n '[illegal_argument_exception] unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]',\n path: '/job/_search',\n query: { scroll: '30s', size: 500 },\n body:\n { error:\n { root_cause: [Array],\n type: 'search_phase_execution_exception',\n reason: 'all shards failed',\n phase: 'fetch',\n grouped: true,\n failed_shards: [Array],\n caused_by: [Object] },\n status: 400 },\n statusCode: 400,\n response:\n '{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"fetch\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"job-202007201811\",\"node\":\"d36cNRY0QVeWiqXAteFy3g\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\"}}},\"status\":400}',\n toString: [Function],\n toJSON: [Function] }"}

{"type":"log","@timestamp":"2020-12-04T02:14:54Z","tags":["error","reporting","savedobject-csv","csv_from_savedobject","execute-job","immediate"],"pid":6,
  "message":"Generate CSV Error! [illegal_argument_exception] unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811] :: {\"path\":\"/job/_search\",\"query\":{\"scroll\":\"30s\",\"size\":500},\"body\":\"{\\\"_source\\\":{\\\"includes\\\":[\\\"orderDate\\\",\\\"jutakuNo\\\",\\\"company\\\",\\\"head\\\"]},\\\"docvalue_fields\\\":[\\\"orderDate\\\",{\\\"field\\\":\\\"orderDate\\\",\\\"format\\\":\\\"date_time\\\"}],\\\"query\\\":{\\\"bool\\\":{\\\"must\\\":[{\\\"match_all\\\":{}}],\\\"filter\\\":[{\\\"range\\\":{\\\"orderDate\\\":{\\\"format\\\":\\\"strict_date_time\\\",\\\"gte\\\":\\\"2020-11-27T11:14:54+09:00\\\",\\\"lte\\\":\\\"2020-12-04T11:14:54+09:00\\\"}}},{\\\"bool\\\":{\\\"must\\\":[{\\\"match_all\\\":{}},{\\\"match_all\\\":{}}],\\\"filter\\\":[{\\\"range\\\":{\\\"orderDate\\\":{\\\"gte\\\":\\\"2020-11-27T02:14:54.686Z\\\",\\\"lte\\\":\\\"2020-12-04T02:14:54.686Z\\\",\\\"format\\\":\\\"strict_date_optional_time\\\"}}}],\\\"should\\\":[],\\\"must_not\\\":[]}}],\\\"should\\\":[],\\\"must_not\\\":[]}},\\\"script_fields\\\":{},\\\"sort\\\":[{\\\"orderDate\\\":{\\\"order\\\":\\\"desc\\\",\\\"unmapped_type\\\":\\\"boolean\\\"}},{\\\"orderDate\\\":{\\\"order\\\":\\\"desc\\\"}}]}\",\"statusCode\":400,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\\\"}],\\\"type\\\":\\\"search_phase_execution_exception\\\",\\\"reason\\\":\\\"all shards failed\\\",\\\"phase\\\":\\\"fetch\\\",\\\"grouped\\\":true,\\\"failed_shards\\\":[{\\\"shard\\\":0,\\\"index\\\":\\\"job-202007201811\\\",\\\"node\\\":\\\"d36cNRY0QVeWiqXAteFy3g\\\",\\\"reason\\\":{\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\\\"}}],\\\"caused_by\\\":{\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\\\",\\\"caused_by\\\":{\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\\\"}}},\\\"status\\\":400}\"}"}

{"type":"error","@timestamp":"2020-12-04T02:14:54Z","tags":[],"pid":6,"level":"error","error":{
  "message":"[illegal_argument_exception] unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]","name":"Error","stack":"Error: [illegal_argument_exception] unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]\n at respond (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)\n at checkRespForFailure (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)\n at HttpConnector.<anonymous> (/usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)\n at IncomingMessage.wrapper (/usr/share/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)\n at IncomingMessage.emit (events.js:203:15)\n at endReadableNT (_stream_readable.js:1145:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)"},"url":{"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":null,"query":{},"pathname":"/api/reporting/v1/generate/immediate/csv/saved-object/search:901b67a0-25ba-11e8-8735-1dd0f5e7cc80","path":"/api/reporting/v1/generate/immediate/csv/saved-object/search:901b67a0-25ba-11e8-8735-1dd0f5e7cc80","href":"/api/reporting/v1/generate/immediate/csv/saved-object/search:901b67a0-25ba-11e8-8735-1dd0f5e7cc80"},
  "message":"[illegal_argument_exception] unable to fetch fields from _source field: _source is disabled in the mappings for index [job-202007201811]"}

{"type":"response","@timestamp":"2020-12-04T02:14:54Z","tags":["api"],"pid":6,"method":"post","statusCode":500,"req":{"url":"/api/reporting/v1/generate/immediate/csv/saved-object/search:901b67a0-25ba-11e8-8735-1dd0f5e7cc80","method":"post","headers":{"host":"brain.intra.sunflare.co.jp","connection":"upgrade","x-real-ip":"172.16.16.220","x-forwarded-server":"brain.intra.sunflare.co.jp","x-forwarded-for":"172.16.16.220","content-length":"474","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0","accept":"*/*","accept-language":"ja,en-US;q=0.7,en;q=0.3","accept-encoding":"gzip, deflate, br","referer":"https://brain.intra.sunflare.co.jp/kizashi-admin/app/kibana","content-type":"application/json","kbn-version":"7.8.0","origin":"https://brain.intra.sunflare.co.jp"},"remoteAddress":"172.19.0.13","userAgent":"172.19.0.13","referer":"https://brain.intra.sunflare.co.jp/kizashi-admin/app/kibana"},"res":{"statusCode":500,"responseTime":306,"contentLength":9},
  "message":"POST /api/reporting/v1/generate/immediate/csv/saved-object/search:901b67a0-25ba-11e8-8735-1dd0f5e7cc80 500 306ms - 9.0B"}

```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 7, 2020, 1:52am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/4 "2020-12-07T01:52:31Z")

</div>

> [@t98907](#):
>
> `_source is disabled in the mappings for index`

That's why, you need `_source` enabled as you originally asked.

---

<div class="post-metadata">

### Author: ![t98907](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/t98907/32/80243_2.png) [@t98907](https://discuss.elastic.co/u/t98907)
#### Post date: [December 7, 2020, 2:58am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/5 "2020-12-07T02:58:25Z")

</div>

Thanks for reply.

Even if \_source is disabled, the search results are still displayed correctly, so it would be normal to be able to download the CSV as well.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 7, 2020, 4:34am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/6 "2020-12-07T04:34:36Z")

</div>

I can't comment on that, but I would suggest there's architectural requirements for why it's the way it is.

---

<div class="post-metadata">

### Author: ![t98907](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/t98907/32/80243_2.png) [@t98907](https://discuss.elastic.co/u/t98907)
#### Post date: [December 8, 2020, 8:52am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/7 "2020-12-08T08:52:02Z")

</div>

Hmmm, that's too bad.  
Thank you.

---

<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: [January 5, 2021, 8:52am UTC](https://discuss.elastic.co/t/failed-to-execute-download-csv/257603/8 "2021-01-05T08:52:19Z")

</div>

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