# Unable to generate CSV from Discover query -\> \[index\_closed\_exception\]

**URL:** <https://discuss.elastic.co/t/unable-to-generate-csv-from-discover-query-index-closed-exception/213350>\
**Category:** Kibana\
**Created:** [December 30, 2019, 12:32pm UTC](https://discuss.elastic.co/t/unable-to-generate-csv-from-discover-query-index-closed-exception/213350 "2019-12-30T12:32:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Donohue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_donohue/32/45665_2.png) [@Mike\_Donohue](https://discuss.elastic.co/u/Mike_Donohue)\
**Post date:** [December 30, 2019, 12:32pm UTC](https://discuss.elastic.co/t/unable-to-generate-csv-from-discover-query-index-closed-exception/213350/1 "2019-12-30T12:32:43Z")

</div>

we are using Kibana 7.3.0

I'm trying to download CSV output from a Discover query.

I saved the query, went to Share -\> CSV Reports -\> Generate CSV ... it spins for a few seconds and then returns an error that it can't generate the CSV.

When I navigate to Management -\> Reporting, I see the failed report.

The full error message is

Unable to generate report

[index\_closed\_exception] closed, with { index\_uuid="MshOUSAbTmiJnTYgxz5keA" & index="reindexed-v7-prod-metrics-2019.02.12" } :: {"path":"/prod-metrics-\*/\_search","query":{"scroll":"30s","size":500},"body":"{"stored\_fields":["@timestamp","vendor","message"],"query":{"bool":{"filter":[{"multi\_match":{"query":"dhcp","type":"best\_fields","lenient":true}}],"must\_not":,"should":,"must":[{"range":{"@timestamp":{"format":"strict\_date\_optional\_time","gte":"2019-12-30T11:00:00.000Z","lte":"2019-12-30T11:30:00.000Z"}}}]}},"script\_fields":{},"\_source":{"excludes":,"includes":["@timestamp","vendor","message"]},"docvalue\_fields":,"sort":[{"@timestamp":{"unmapped\_type":"boolean","order":"desc"}}],"version":true}","statusCode":400,"response":"{"error":{"root\_cause":[{"type":"index\_closed\_exception","reason":"closed","index\_uuid":"MshOUSAbTmiJnTYgxz5keA","index":"reindexed-v7-prod-metrics-2019.02.12"}],"type":"index\_closed\_exception","reason":"closed","index\_uuid":"MshOUSAbTmiJnTYgxz5keA","index":"reindexed-v7-prod-metrics-2019.02.12"},"status":400}"}

any help is appreciated.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [December 30, 2019, 1:36pm UTC](https://discuss.elastic.co/t/unable-to-generate-csv-from-discover-query-index-closed-exception/213350/2 "2019-12-30T13:36:53Z")

</div>

It seems like your CSV report is hitting closed indices - are there closed indices included in the index pattern you used in Discover? If yes please create an index pattern that only includes the open indices you actually want to look into or [open all indices](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html) matching your index pattern - e.g. `POST /reindexed-v7-prod-metrics-2019.02.12/_open` (but there might be others).

---

<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 27, 2020, 1:37pm UTC](https://discuss.elastic.co/t/unable-to-generate-csv-from-discover-query-index-closed-exception/213350/3 "2020-01-27T13:37:00Z")

</div>

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