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

AI 生成的摘要

A bug was reported regarding the page view total requests report at /admin/reports/page_view_total_reqs, where selecting a category from the dropdown triggered a 500 Internal Server error steko. While watchmanmonitor initially could not reproduce the error on their instances, steko clarified that the issue occurs specifically when selecting a category and clicking “update view.” techAPJ confirmed the ability to reproduce the bug and committed to fixing it. Upon investigation, techAPJ identified the root cause: the category_id column does not exist in the application_requests table. Consequently, the category filter has been removed from all page view reports to prevent the error, with the fix implemented in commit b4a8cb4. watchmanmonitor noted that without the visual error, they had not realized the graph failed to update when the filter was applied.

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:

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.

2 个赞

Can you repro this @techapj?

1 个赞

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.

1 个赞

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).

2 个赞

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

6 个赞

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)

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.

1 个赞

The category filter was giving error on page view reports because the category_id column does not exist in application_requests table.

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


https://github.com/discourse/discourse/commit/b4a8cb415e1f6168a1f48f6f0aadc7355347bb06

5 个赞