dudintv reported a 500 error after updating their Discourse forum, with safe mode also failing. Moin noted others faced similar issues and linked to a related thread. David suggested checking /logs, which dudintv did, revealing errors like missing database tables and Ember.js files. After running .launcher rebuild app, errors persisted, prompting David to suspect incomplete database migrations. dudintv confirmed logs were from before the rebuild. Fresh logs showed continued NoMethodError and missing ember-source files. David asked to verify ember-source in node_modules, but dudintv found the directory missing. David suspected a failed rebuild, which dudintv confirmed was due to low disk space (under 5GB). After resizing to 35GB, dudintv accidentally deleted /var/discourse while inside the container. David advised exiting the container and rebuilding. The rebuild succeeded, though a 502 error appeared briefly dudintv. Finally, the forum was restored and working dudintv, who thanked David for the help.
.launcher rebuild app worked but I don’t see any difference on the frontend (still have that 500 error)… Should I run any other commands after the “rebuilding”?
I’ve took a look root@forum:/var/discourse/shared/standalone/log/rails# tail -n 60 production.log
and there are some errors, but I’m not a developer to understand what to do with it
Started GET "/.env" for 78.153.140.179 at 2024-05-17 15:16:40 +0000
ActionController::RoutingError (No route matches [GET] "/.env")
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:277:in `call'
Rendered exceptions/not_found.html.erb within layouts/no_ember (Duration: 181.9ms | Allocations: 3554)
Rendered layout layouts/no_ember.html.erb (Duration: 2208.3ms | Allocations: 42766)
Failed to handle exception in exception app middleware : ActionView::Template::Error : No such file or directory @ rb_sysopen - /var/www/discourse/node_modules/ember-source/package.json
Started GET "/" for 143.178.246.7 at 2024-05-17 15:16:44 +0000
NoMethodError (undefined method `custom_homepage' for #<ThemeModifierHelper:0x00007fc09c95c1d0 @theme_ids=[]>)
lib/homepage_helper.rb:5:in `resolve'
lib/homepage_constraint.rb:12:in `matches?'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:391:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:277:in `call'
Started GET "/" for 5.164.29.116 at 2024-05-17 15:17:43 +0000
NoMethodError (undefined method `custom_homepage' for #<ThemeModifierHelper:0x00007fc09c94eb20 @theme_ids=[]>)
lib/homepage_helper.rb:5:in `resolve'
lib/homepage_constraint.rb:12:in `matches?'
lib/middleware/omniauth_bypass_middleware.rb:64:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:391:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:277:in `call'
Job exception: PG::UndefinedTable: ERROR: relation "chat_mention_notifications" does not exist
LINE 1: ...ntions.chat_message_id = c_msg.id LEFT OUTER JOIN chat_menti...
^
start
done
Job exception: PG::UndefinedTable: ERROR: relation "problem_check_trackers" does not exist
LINE 1: SELECT "problem_check_trackers".* FROM "problem_check_tracke...
^
Job exception: PG::UndefinedTable: ERROR: relation "discourse_automation_automations" does not exist
LINE 9: WHERE a.attrelid = '"discourse_automation_automations"'::re...
Are these log timestamps before or after you ran the command line rebuild?
The errors all suggest that database migrations have not been run. Which is strange, because they absolutely should be run as part of a successful command-line rebuild.