שגיאות 500 תכופות מאוד לאחר התקנה מחדש של השרת

סיכום מבוסס בינה מלאכותית

SilviaB reported frequent 500 errors after restoring a Discourse site from backup on a new Ubuntu 18.04 server, having previously run Ubuntu 19.04 with an older Discourse version. The errors included NoMethodError for slow_mode_seconds and default_list_filter, suggesting schema or model mismatches. Falco asked whether the installation followed the official Standard Installation guide and requested the site URL. SilviaB confirmed they had skipped the initial discourse-setup step and instead reused an old config with launcher rebuild. After running discourse-setup to regenerate the config from scratch, then reapplying custom paths and plugins before rebuilding, the site returned to normal operation. The root cause was an incomplete or mismatched configuration during migration, resolved by following the standard setup procedure.

Hello everyone,

I had to rebuild a Discourse server only from the backup file after having lost the initial server and its snapshots (in a fire on the hosting site, God bless backups off-site!). The initial server was on Ubuntu 19.04 and not with the latest version of Discourse on it (maybe a couple of months behind, I do not recall the exact version). I have now installed the newest version of Discourse on an Ubuntu 18.04 and had restored the database from the UI using the last backup file.

The site is now experiencing frequent 500 errors and I see two types of error messages in the production log. Could you please help me with some ideas of what I could do next? Many thanks!

Started GET “/t/en-2019-des-frontaliers-imposes-a-la-source-en-france/8675” for xx.xx.xx.xx at 2021-03-12 07:57:02 +0000
Processing by TopicsController#show as HTML
Parameters: {“slug”=>“en-2019-des-frontaliers-imposes-a-la-source-en-france”, “topic_id”=>“8675”}
Completed 500 Internal Server Error in 145ms (ActiveRecord: 0.0ms | Allocations: 30586)
NoMethodError (undefined method slow_mode_seconds' for #<Topic:0x00007f9f56b4c1f0>) (eval):2:in slow_mode_seconds’
(eval):33:in _fast_attributes' app/controllers/topics_controller.rb:1109:in block (2 levels) in perform_show_response’
app/controllers/topics_controller.rb:1104:in perform_show_response' app/controllers/topics_controller.rb:162:in show’
app/controllers/application_controller.rb:358:in block in with_resolved_locale' app/controllers/application_controller.rb:358:in with_resolved_locale’
lib/middleware/omniauth_bypass_middleware.rb:68:in call' lib/content_security_policy/middleware.rb:12:in call’
lib/middleware/anonymous_cache.rb:353:in call' config/initializers/100-quiet_logger.rb:23:in call’
config/initializers/100-silence_logger.rb:31:in call' lib/middleware/enforce_hostname.rb:23:in call’
lib/middleware/request_tracker.rb:177:in `call’

Started GET “/” for xx.xx.xx.xx at 2021-03-12 07:55:24 +0000
Processing by CategoriesController#index as HTML
Completed 500 Internal Server Error in 313ms (ActiveRecord: 0.0ms | Allocations: 69745)
NoMethodError (undefined method default_list_filter' for #<Category:0x00007f9f520dc778> Did you mean? default_view) (eval):29:in _fast_attributes’
lib/freedom_patches/ams_include_without_root.rb:57:in include!' app/controllers/categories_controller.rb:42:in block (2 levels) in index’
app/controllers/categories_controller.rb:40:in index' app/controllers/application_controller.rb:358:in block in with_resolved_locale’
app/controllers/application_controller.rb:358:in with_resolved_locale' lib/middleware/omniauth_bypass_middleware.rb:68:in call’
lib/content_security_policy/middleware.rb:12:in call' lib/middleware/anonymous_cache.rb:353:in call’
config/initializers/100-quiet_logger.rb:23:in call' config/initializers/100-silence_logger.rb:31:in call’
lib/middleware/enforce_hostname.rb:23:in call' lib/middleware/request_tracker.rb:177:in call’

How did you install Discourse itself? Was it following [Discourse official Standard Installation](Install Discourse in production with the official supported instructions)?

Can you link the site?

Thanks a lot, @Falco! Your suggestion took me to the solution.
Indeed I was not following the installation procedure, more precisely I was not passing through the initial discourse setup (with the discourse-setup command).
I was just using a “launcher rebuild” command with the configuration file taken from the previous install.

Using discourse-setup allowed me to recreate the config file from scratch and then I modified it to add my custom paths and plugins, did a rebuild and everything worked as before.

Thanks again for your help!