Thread:0x000055c972f94c78

AI-generated summary

Justman10000 reports encountering a new error after resolving a prior issue: a Ruby thread terminates with ActiveRecord::ConnectionNotEstablished, indicating the app failed to establish a database connection during background job execution. The stack trace points to rails_multisite and discourse.rb handling, suggesting multi-site configuration or connection pooling is involved. In a follow-up post, they reveal a related PostgreSQL error: PG::UndefinedTable, specifically that the 'groups' table does not exist — likely due to missing migrations or an incomplete database setup. Together, these errors suggest the Discourse installation’s database is either not initialized, improperly migrated, or misconfigured for multi-site use.

After the previous problem, now a new one appears!

#<Thread:0x000055c972f94c78 /home/discourse/lib/scheduler/defer.rb:79 run> terminated with exception (report_on_exception is true):
/usr/local/rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:323:in connection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management/rails_61_compat.rb:8:in current’
from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:115:in current_db_hostnames' from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:111:in current_hostname’
from lib/discourse.rb:176:in handle_job_exception' from /home/discourse/lib/scheduler/defer.rb:102:in rescue in do_work’
from /home/discourse/lib/scheduler/defer.rb:101:in do_work' from /home/discourse/lib/scheduler/defer.rb:79:in block (2 levels) in start_thread’
/usr/local/rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.7/lib/active_record/connection_handling.rb:323:in connection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) from /usr/local/rvm/gems/ruby-3.0.2/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:79:in with_connection’
from /home/discourse/lib/scheduler/defer.rb:89:in do_work' from /home/discourse/lib/scheduler/defer.rb:79:in block (2 levels) in start_thread’

Then I have this problem…

# --- Caused by: ---
# PG::UndefinedTable:
#   ERROR: relation 'groups' does not exist
#   LINE 8:  WHERE a.attrelid = '"groups"'::regclass
#                               ^
#   /usr/local/rvm/gems/ruby-3.0.2/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:19:in `exec'