Users reported a 500 error when accessing the categories page on mobile for the Discourse site https://community.bcro.org. jonwgeorge initially noted the issue was mobile-specific, and simon confirmed it persisted even in safe-mode, with console errors pointing to /categories.json failing. Further investigation via error logs revealed a StandardError related to accessing a non-preloaded custom field jonwgeorge. simon suspected the discourse-knowledge-base plugin as the culprit and recommended disabling it. After removing the plugin, jonwgeorge confirmed the issue was resolved and plans to seek an alternative. simon encouraged reporting the bug to the plugin’s thread for potential fixes.
I am finding the same problem when I open your site in mobile view. It even happens when I use safe-mode to open the site.
The errors I’m seeing in the console are:
GET https://community.bcro.org/categories.json 500
Error while processing route: discovery.categories
When I open the site in the desktop view, there are no errors on the categories page.
You can load the mobile view of your site on a desktop by going to https://community.bcro.org/?mobile_view=1. If you do this, and open your site’s error log page (Admin / Logs / Error Logs), you should see an error message that will give more details about what is going wrong. To filter the logs, deselect the Debug, Info, and Warning checkboxes from the bottom left of your logs page.
StandardError (Attempting to access a non preloaded custom field, this is disallowed to prevent N+1 queries.) /var/www/discourse/app/models/concerns/has_custom_fields.rb:164:in `’
That seems to indicate that the problem is with the discourse-knowledge-base plugin. You could try removing that plugin from your app.yml file, rebuilding the app, and see if that fixes the issue.