# CSV export of reports fails

**URL:** https://meta.discourse.org/t/csv-export-of-reports-fails/71172
**Category:** Bug
**Created:** [October 2, 2017, 10:12am UTC](https://meta.discourse.org/t/csv-export-of-reports-fails/71172 "2017-10-02T10:12:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AxelN](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axeln/32/120662_2.png) [@AxelN](https://meta.discourse.org/u/AxelN)
#### Post date: [October 2, 2017, 10:12am UTC](https://meta.discourse.org/t/csv-export-of-reports-fails/71172/1 "2017-10-02T10:12:16Z")

</div>

Clicking the the “export” button on https://[our-forum]/admin/reports/posts sends a message that it failed. I’m do not know whether it ever worked for us. I see in the error logs:

```plaintext
Job exception: undefined method `data' for nil:NilClass

```

with the backtrace:

```plaintext
/var/www/discourse/app/jobs/regular/export_csv_file.rb:149:in `report_export'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:48:in `each'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:48:in `block in execute'
/usr/local/lib/ruby/2.3.0/csv.rb:1282:in `open'
/var/www/discourse/app/jobs/regular/export_csv_file.rb:46:in `execute'
/var/www/discourse/app/jobs/base.rb:153:in `block (2 levels) in perform'

```

Is that a known issue? Is there something we can do to figure out a config issue on our side? Or can other people reproduce this with `v1.9.0.beta11 +11`?

Cheers, Axel.

---

<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:20am UTC](https://meta.discourse.org/t/csv-export-of-reports-fails/71172/2 "2017-10-02T10:20:20Z")

</div>

Confirmed, same error with `v1.9.0.beta11 +18`

(I am updating to the latest version)

---

<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:53am UTC](https://meta.discourse.org/t/csv-export-of-reports-fails/71172/3 "2017-10-02T10:53:14Z")

</div>

Confirmed again with the very latest version ` v1.9.0.beta11 +33`.  
The error reported in the OP is the same.

---

<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 2, 2017, 2:30pm UTC](https://meta.discourse.org/t/csv-export-of-reports-fails/71172/5 "2017-10-02T14:30:24Z")

</div>

Fixed via:

[https://github.com/discourse/discourse/commit/469c6776c6151f3ae28c9e8b1bf9f4c55e9fefa9](https://github.com/discourse/discourse/commit/469c6776c6151f3ae28c9e8b1bf9f4c55e9fefa9)

Thanks for reporting this issue @AxelN 👍

---

<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 2, 2017, 2:30pm UTC](https://meta.discourse.org/t/csv-export-of-reports-fails/71172/6 "2017-10-02T14:30:29Z")

</div>


