/categories_and_latest and /categories pages shows error

Hello,
our site is throwing 500 error when opening /categories_and_latest or /categories pages.

The error detail is

ArgumentError (comparison of Integer with nil failed)
app/models/category_list.rb:235:in `<='
app/models/category_list.rb:235:in `block in sort_unpinned'
app/models/category_list.rb:234:in `each'
app/models/category_list.rb:234:in `sort_unpinned'
app/models/category_list.rb:42:in `initialize'
app/controllers/categories_controller.rb:648:in `new'
app/controllers/categories_controller.rb:648:in `fetch_category_list'
app/controllers/categories_controller.rb:43:in `index'
app/controllers/application_controller.rb:427:in `block in with_resolved_locale'
app/controllers/application_controller.rb:427:in `with_resolved_locale'

The problem cannot be reproduced in version 3.3.3 (production), but it hits the system in version 3.3.4 or 3.4.1 (staging).

Not sure is it a db inconsistency or a bug.

Best regards,
Jan

Is this a right category to ask this kind of questions, or shall I raise this somewhere else?

Thank you,
Jan

category.some_attribute || 0 # Fallback to 0 if nil do you have a chance to try it?

I think I encountered a similar error recently. I solved it this way.

Hi,
thank you very much for a reply. I will give a try for sure, but it sounds more like a temporary solution.

I would like to understand when the c.num_featured_topics becomes a nil and address that problem somehow.

Jan

1 Like