"Error log: raising while migrating the discourse table

I’m trying to install discourse version: 2.8.1, but getting “`connection_pool’: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)”. my database connection details are valid. Databases and tables are created successfully .
Ubuntu: 18.04
Postgresql : 14
redis-server: 6.2.6
ruby version: 2.7.1

**Database table count for discourse_development**
discourse_development-# select count(*) from information_schema.tables;
 count
-------
   378
(1 row)

Here is the detailed Error ,
:this is the exact error Im facing while running the this command: bundle exec rake db:migrate

Seeding theme and color schemes
#<Thread:0x0000559680232280 /home/raghav/discourse/lib/scheduler/defer.rb:79 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        24: from /home/raghav/discourse/lib/scheduler/defer.rb:79:in `block (2 levels) in start_thread'
        23: from /home/raghav/discourse/lib/scheduler/defer.rb:89:in `do_work'
        22: from /home/raghav/.rbenv/versions/2.7.1/lib/ruby/gems/`Preformatted text`2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:80:in `with_connection'
        21: from /home/raghav/discourse/lib/scheduler/defer.rb:94:in `block in do_work'
        20: from /home/raghav/discourse/app/models/post.rb:929:in `block in index_search'
        19: from /home/raghav/discourse/app/services/search_indexer.rb:235:in `index'
        18: from /home/raghav/discourse/app/services/search_indexer.rb:112:in `update_topics_index'
        17: from /home/raghav/discourse/app/services/search_indexer.rb:21:in `scrub_html_for_search'
        16: from /home/raghav/discourse/app/services/search_indexer.rb:342:in `scrub'
        15: from /home/raghav/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/lib/nokogiri/xml/sax/parser.rb:84:in `parse'
        14: from /home/raghav/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/lib/nokogiri/html4/sax/parser.rb:34:in `parse_memory'
        13: from /home/raghav/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/nokogiri-1.12.5-x86_64-linux/lib/nokogiri/html4/sax/parser.rb:34:in `parse_with'
        12: from /home/raghav/discourse/app/services/search_indexer.rb:352:in `start_element'
        11: from /home/raghav/discourse/app/services/search_indexer.rb:352:in `each'
        10: from /home/raghav/discourse/app/services/search_indexer.rb:356:in `block in start_element'


.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_handling.rb:323:in `connection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)