Site fails with unofficial plugins removed, theme-related error

Hello,

I installed 2 plugins today (one official, one not) and hit the “Oops” page. I then removed both of them, rebuilt, and things are still borked.

I’ve since removed all plugins, leaving only docker_manager.git, git pulled to latest, and have rebuilt but still am not getting through. I’ve been able to replicate this behavior on 3 different sites. 2 of them are safe to just restore to a backup, but 1 of them has some recent data I’d rather not lose. :grimacing:

Strangely, I was also able to replicate this a few times by only adding Discourse Push Notifications for Desktop, which is the official plugin I tried before. Same thing there, adding it (with no other plugins present) broke things and removing it didn’t fix. Unfortunately, this is intermittent.

What’s the best way to troubleshoot from here? What should I be looking for to see if things are in a recoverable state? As far as I can tell there are no build errors, and the docker container is up.

Thank you.

It turns out that various .json requests are still loading fine (/latest.json, /categories.json, etc). For regular pages however I am finding the following in the production logs:

Started GET "/latest" for 108.162.215.158 at 2019-01-12 07:57:05 +0000
Processing by ListController#latest as HTML
Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
ArgumentError (comparison of Integer with nil failed)
/var/www/discourse/app/models/theme.rb:130:in `sort!'
Failed to handle exception in exception app middleware : comparison of Integer with nil failed

and for /about

Started GET "/about" for 108.162.215.158 at 2019-01-12 08:10:14 +0000
Processing by AboutController#index as HTML
Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
ArgumentError (comparison of Integer with nil failed)
/var/www/discourse/app/models/theme.rb:130:in `sort!'
Failed to handle exception in exception app middleware : comparison of Integer with nil failed

The same goes on for any page I try.

My data appears to be fine in the json views, but I’m not yet sure why pages are barfing. :man_shrugging: Any pointers are appreciated. :+1: Thanks.

These are all theme errors. Sounds like a bogus theme is in play.

Thanks. Is there a practical way to disable themes via cli? Even /safe-mode is stuck:

Started GET "/safe-mode" for 173.245.48.69 at 2019-01-12 09:26:47 +0000
Processing by SafeModeController#index as HTML
  Rendering safe_mode/index.html.erb within layouts/no_ember
  Rendered safe_mode/index.html.erb within layouts/no_ember (1.0ms)
  Rendered layouts/_head.html.erb (8.2ms)
  Rendered common/_discourse_stylesheet.html.erb (0.2ms)
Completed 500 Internal Server Error in 13ms (ActiveRecord: 5.5ms)
ArgumentError (comparison of Integer with nil failed)
/var/www/discourse/app/models/theme.rb:130:in `sort!'
Failed to handle exception in exception app middleware : comparison of Integer with nil failed

Nevermind, found it here!

Something funky still got me into this mess, but I think I’ll be able to sort it from here. Phew!

4 Likes