Start page broken for admins & moderators

(Jonas) #1


We have a discourse forum where admins and moderators currently can’t visit the start page, because it renders a 500 Internal Server Error page. It works fine for normal users and logged-out users.

Separate thread and category views work fine for all users (including admins/moderators), and the admin page works fine.

Discourse version: v2.0.0.beta2

The error in the logs:

/var/www/discourse/app/models/category.rb:439:in `url'
/var/www/discourse/app/helpers/topics_helper.rb:16:in `categories_breadcrumb'
/var/www/discourse/app/views/topics/show.html.erb:5:in `_app_views_topics_show_html_erb___1372095578456862489_70244849918320'
/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.1.4/lib/action_view/template.rb:157:in `block in render'

The line where it blows up:
url << "/#{parent_category.slug}" if parent_category_id

Looking at the backtrace and the code (I am not a ruby dev) it seems it’s building a list of topics for the start page. The parent_category variable is null but the parent_category_id is set, so I think there’s a topic with a reference to a non-existing category?

In that case there’s a broken topic with a non-existing category that only admins and moderators can see.

Has anyone seen this error before?
Or maybe a suggestion how to find this broken topic in the database?


(Jonas) #2

Resolved. A category was created with a non-existing parent category ID.

(Joshua Rosenfeld) #3

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