# CSV download for Saved search is returning error in Kibana

**URL:** <https://forum.opensearch.org/t/csv-download-for-saved-search-is-returning-error-in-kibana/5618>\
**Category:** Reporting Plugin\
**Created:** [April 15, 2021, 2:25am UTC](https://forum.opensearch.org/t/csv-download-for-saved-search-is-returning-error-in-kibana/5618 "2021-04-15T02:25:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![curiousmind](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@curiousmind](https://forum.opensearch.org/u/curiousmind)\
**Post date:** [April 15, 2021, 2:25am UTC](https://forum.opensearch.org/t/csv-download-for-saved-search-is-returning-error-in-kibana/5618/1 "2021-04-15T02:25:39Z")

</div>

Opendistro version 1.12.0  
When I try to download “saved search” in Kibana, it gives me an error in the UI as shown in the below picture.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/5/54102d9ec7bec71e578152e89e9e12b601291438.png)

any idea why this might be happening?

---

<div class="post-metadata">

**Author:** ![jasonrojas](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/jasonrojas/32/4902_2.png) [@jasonrojas](https://forum.opensearch.org/u/jasonrojas)\
**Post date:** [April 16, 2021, 11:33pm UTC](https://forum.opensearch.org/t/csv-download-for-saved-search-is-returning-error-in-kibana/5618/2 "2021-04-16T23:33:50Z")

</div>

I was just looking into this too.  
Looks like there are similar reports here:

> <https://github.com/opendistro-for-elasticsearch/kibana-reports/issues/327>
>
> \## Version
> Opendistro Elasticsearch 1.13.0 standalone linux
> Opendistro Kibana …1.13.0 standalone linux
> 
> \## Error description
> If the saved discover table includes a null value the csv export will fail with the error message:
> \`\`\`
> \[08:16:09.781\] \[error\]\[opendistroReportsKibana\]\[plugins\] Failed to generate report: TypeError: Cannot read property 'toString' of null
> log \[08:16:09.782\] \[error\]\[opendistroReportsKibana\]\[plugins\] TypeError: Cannot read property 'toString' of null
> at sanitize (/srv/opendistroforelasticsearch-kibana/plugins/opendistroReportsKibana/server/routes/utils/dataReportHelpers.ts:227:18)
> at getEsData (/srv/opendistroforelasticsearch-kibana/plugins/opendistroReportsKibana/server/routes/utils/dataReportHelpers.ts:172:34)
> at convertEsDataToCsv (/srv/opendistroforelasticsearch-kibana/plugins/opendistroReportsKibana/server/routes/utils/savedSearchReportHelper.ts:266:18)
> at generateReportData (/srv/opendistroforelasticsearch-kibana/plugins/opendistroReportsKibana/server/routes/utils/savedSearchReportHelper.ts:151:10)
> at process.\_tickCallback (internal/process/next\_tick.js:68:7)
> error \[08:16:07.104\] Error: Internal Server Error
> at HapiResponseAdapter.toError (/srv/opendistroforelasticsearch-kibana/src/core/server/http/router/response\_adapter.js:132:19)
> at HapiResponseAdapter.toHapiResponse (/srv/opendistroforelasticsearch-kibana/src/core/server/http/router/response\_adapter.js:86:19)
> at HapiResponseAdapter.handle (/srv/opendistroforelasticsearch-kibana/src/core/server/http/router/response\_adapter.js:81:17)
> at Router.handle (/srv/opendistroforelasticsearch-kibana/src/core/server/http/router/router.js:164:34)
> at process.\_tickCallback (internal/process/next\_tick.js:68:7)
> 
> \`\`\`

---

<div class="post-metadata">

**Author:** ![CyberGod](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/cybergod/32/617_2.png) [@CyberGod](https://forum.opensearch.org/u/CyberGod)\
**Post date:** [July 14, 2021, 7:08pm UTC](https://forum.opensearch.org/t/csv-download-for-saved-search-is-returning-error-in-kibana/5618/3 "2021-07-14T19:08:52Z")

</div>

Issue fixed and merged to OpenDistro Reporting `dev` branch(not released), as well as released with Openseach-Dashboards 1.0 @jasonrojas @curiousmind
