# Page view reports: category dropdown does nothing, 500 Server error

**URL:** https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884
**Category:** Bug
**Created:** [May 8, 2016, 4:48pm UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884 "2016-05-08T16:48:30Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![steko](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@steko](https://meta.discourse.org/u/steko)
#### Post date: [May 8, 2016, 4:48pm UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/1 "2016-05-08T16:48:31Z")

</div>

If I go to `mydiscourse.com/admin/reports/page_view_total_reqs` the dashboard lets me optionally select a date interval and a category. However this doesn’t seem to work. The console shows a 500 Server error for the request:

```plaintext
GET https://discorsi.openarchaeology.eu/assets/select2.png [HTTP/2.0 404 Not Found 50ms]
GET XHR https://discorsi.openarchaeology.eu/admin/reports/page_view_total_reqs [HTTP/2.0 500 Internal Server Error 81ms]
s@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:10:29559
e.default.trigger@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:16:9543
h.prototype._onerror@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:16:14568
f@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:16:3984
@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:10:30307
r.prototype.invoke@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:3:30772
r.prototype.flush@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:3:31297
n.prototype.flush@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:3:29448
a.prototype.end@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:3:24647
a.prototype.run@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:3:25025
u@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:8:3186
Discourse.Ajax<.ajax/s/n.error@https://discorsi.openarchaeology.eu/assets/application-1db324383377414784f70c5d1f41b38c0c8b8ccc202dc6a25572fad20b71130e.js:1:970
ae.Callbacks/l@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:2:6435
ae.Callbacks/c.fireWith@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:2:7208
n@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:3:10164
.send/r/<@https://discorsi.openarchaeology.eu/assets/ember_jquery-9c4852b4384fc211bf22de79cc4f7c4188ac0e9465ae13a4d07873dfcd97fd51.js:3:15994

```

That’s the first time I look into this feature so I have no idea if it worked before.

---

<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: [May 8, 2016, 8:25pm UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/2 "2016-05-08T20:25:03Z")

</div>

Can you repro this @techapj?

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [May 9, 2016, 12:52am UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/3 "2016-05-09T00:52:02Z")

</div>

I didn’t even know this existed, but can view `admin/reports/page_view_total_reqs` without error on each of my 4 discourse.

One was just updated to the latest `tests-passed` branch, and this view is fine.

---

<div class="post-metadata">

### Author: ![steko](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@steko](https://meta.discourse.org/u/steko)
#### Post date: [May 9, 2016, 3:53am UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/4 "2016-05-09T03:53:17Z")

</div>

I can load the initial view without error, too. The issue is triggered by selecting a category from the dropdown and clicking on _update view_ (not sure that’s the exact label).

---

<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: [May 9, 2016, 3:59am UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/5 "2016-05-09T03:59:52Z")

</div>

Yes, I can repro this issue. Will fix it today.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [May 9, 2016, 5:29am UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/6 "2016-05-09T05:29:27Z")

</div>

I see.

I didn’t have any problem selecting a category & clicking `Refresh Report`, but it seems like Arpit has it going on.

What I do find interesting is that the first day in the report always seems to have a spike, much like the current day has a drop off. (the drop off seems legit, as the day isn’t complete yet)

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [May 9, 2016, 5:31am UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/7 "2016-05-09T05:31:11Z")

</div>

Ah, I see.. the graph doesn’t change.. I only thought it was OK because I didn’t see an error visually. Only when I wondered why there was no variance would I have wondered what was up.

Anyway, glad you posted, or I may not have discovered this feature for quite some time.

---

<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: [May 9, 2016, 8:27am UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/8 "2016-05-09T08:27:40Z")

</div>

The category filter was giving error on page view reports because the `category_id` column does not exist in [`application_requests`](https://github.com/discourse/discourse/blob/master/app/models/application_request.rb) table.

I have removed the category filter from all page view reports.

* * *

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

---

<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: [May 9, 2016, 10:07am UTC](https://meta.discourse.org/t/page-view-reports-category-dropdown-does-nothing-500-server-error/43884/9 "2016-05-09T10:07:42Z")

</div>


