# Data Explorer cannot export to CSV

**URL:** https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165
**Category:** Bug
**Created:** [October 2, 2017, 8:25am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165 "2017-10-02T08:25:13Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![imrehg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imrehg/32/119891_2.png) [@imrehg](https://meta.discourse.org/u/imrehg)
#### Post date: [October 2, 2017, 8:25am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/1 "2017-10-02T08:25:14Z")

</div>

We are using Discourse-hosted Discourse, and found that the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin errors out when trying to export the results in CSV format.

We do a query, if we select “download results” in JSON it works, if in CSV, then got a HTTP 500 result…

Any idea what might be going on? Is it a known issue?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 2, 2017, 9:38am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/2 "2017-10-02T09:38:01Z")

</div>

How many rows / results are you attempting to export as CSV?

---

<div class="post-metadata">

### Author: ![imrehg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imrehg/32/119891_2.png) [@imrehg](https://meta.discourse.org/u/imrehg)
#### Post date: [October 2, 2017, 10:38am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/3 "2017-10-02T10:38:05Z")

</div>

Even with a single row we get an error (e.g. running a query with `SELECT .... LIMIT 1`).

I wonder if the othet CSV issue reported, [CSV export of reports fails](https://meta.discourse.org/t/cvs-export-of-reports-fails/71172) is related.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [October 2, 2017, 10:55am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/4 "2017-10-02T10:55:51Z")

</div>

I also believe that they are related.  
Can you check the `/logs` page to see if you have the same error?

---

<div class="post-metadata">

### Author: ![imrehg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imrehg/32/119891_2.png) [@imrehg](https://meta.discourse.org/u/imrehg)
#### Post date: [October 2, 2017, 12:17pm UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/6 "2017-10-02T12:17:22Z")

</div>

Checked, and no new log shows up in the `/logs` when trying to do the Data Exporter. Though have tried to do the “reports” export as mentioned in the other thread, and it fails the same way (no logs then either). So definitely feels related (and that thread is probably duplicate of this one, as this was filed earlier).

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [October 2, 2017, 4:29pm UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/7 "2017-10-02T16:29:32Z")

</div>

Looks like @techAPJ resolved this. Try updating to latest and retest?

> [@CSV export of reports fails](https://meta.discourse.org/t/csv-export-of-reports-fails/71172/5):
>
> Fixed via: Thanks for reporting this issue @AxelN +1

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 2, 2017, 6:41pm UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/8 "2017-10-02T18:41:20Z")

</div>

> [@jomaxro](#):
>
> Looks like @techAPJ resolved this. Try updating to latest and retest?

> [@imrehg](#):
>
> We are using Discourse-hosted Discourse,

Has it been pushed yet?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [October 3, 2017, 2:31am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/9 "2017-10-03T02:31:59Z")

</div>

> [@pfaffman](#):
>
> Has it been pushed yet?

It has now. Apologies, @imrehg, I glossed over that we hosted you.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 3, 2017, 3:40am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/10 "2017-10-03T03:40:38Z")

</div>

Proof that you’re trying to help everyone, not just customers!

---

<div class="post-metadata">

### Author: ![imrehg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imrehg/32/119891_2.png) [@imrehg](https://meta.discourse.org/u/imrehg)
#### Post date: [October 3, 2017, 11:00am UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/11 "2017-10-03T11:00:08Z")

</div>

Hey, tried the other linked issue, that one was fixed (now it’s `.csv.gz` that’s downloaded?). My original report, of the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) does not export to CSV is still erroring out the same way, so this issue is still open.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [October 3, 2017, 5:57pm UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/13 "2017-10-03T17:57:42Z")

</div>

I can repro this issue here on meta. Added on my list to fix. 📝

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [October 4, 2017, 12:24pm UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/14 "2017-10-04T12:24:19Z")

</div>

Fixed via:

[https://github.com/discourse/discourse-data-explorer/commit/07cb0005b02dbddb227d1790f61bd77e0ad52d65](https://github.com/discourse/discourse-data-explorer/commit/07cb0005b02dbddb227d1790f61bd77e0ad52d65)

Thanks for reporting this issue @imrehg 👍

The fix will be deployed on your instance soon.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [October 5, 2017, 12:30pm UTC](https://meta.discourse.org/t/data-explorer-cannot-export-to-csv/71165/15 "2017-10-05T12:30:26Z")

</div>

This topic was automatically closed after 24 hours. New replies are no longer allowed.
