Upgrading v2.2.0.beta4 forum with unknown local changes

This is just a function of what’s in the container, which is a function of what’s in the image.

A rebuild should pull the latest image (if required) and will update and build with the latest image-configured Ruby version.

I’d recommend that you go with @RGJ’s solution.

My best guess is that you have something wrong with the discourse and git, like it’s on the wrong commit or something. You might try something like this:

cd /var
mv discourse discourse-bad
git clone https://github.com/discourse/discourse_docker
mv discourse-bad/containers/* discourse/containers/
mv discourse-bad/shared/* discourse/shared/
cd /var/discourse
./launcher rebuild app
2 Likes

thanks. everything is under /var/idmforums though, so i assume I would change the
cd /var mv idmforums discourse-bad git clone https://github.com/discourse/discourse_docker mv discourse-bad/containers/* discourse/containers/ mv discourse-bad/shared/* discourse/shared/ cd /var/idmforums ./launcher rebuild app

What exactly is this doing? It looks like you are moving the discourse install to another folder called discourse-bad, pulling the repo “discourse_docker” and then moving a few other things around, then rebuilding the discourse install. Is this close? I’m just a little hazy on what’s going on during the “moving a few other things around” bit.

I contacted the owner. He is looking into it, but I think he might just restore the entire machine from backup (he’s not using a VM). This will get us back to an operation state, basically back where we started. From there I will ask him to do the Rsync and fresh install onto a new machine if this is possible.

I do appreciate all the help given here. It will be beneficial once I can engage the owner to re-build

The point was to get a clean copy of Discourse_docker. Since you already have discourse in a directory not called discourse you can skip that step and just make a new come clone if it and move or copy the data there and then try to rebuild in that directory.

Since I don’t have access to the cloud provider, I cannot do a fresh install of Ubuntu 24.04

I did however inline update Ubuntu from 18.04–>20.04–>22.04 successfully and successfully pulled the latest discourse backup .tar file from the server. Along with the ssl certificates.

The systems ruby version is now reporting v3.0.2 but the exact same error prevents discourse from rebuilding.

ERROR: Error installing bundler: bundler-2.5.3 requires Ruby version >= 3.0.0. The current ruby version is 2.7.2.137.

If I request paid help to get this going again, do you think it’s possible from here?

what do you see when you do:

cd /var/discourse
git status

?

are you on master branch by any chance?

you should be on main (it switched over some time ago)

Yes on branch master

On branch master Your branch is up to date with 'origin/master'.

Do I need to change the name from master to main?

using this: - git branch -m master main - git push -u origin main

1 Like

scratch that, it seems that main already exists:

git checkout main

Switched to branch 'main' Your branch and 'origin/main' have diverged, and have 1 and 210 different commits each, respectively. (use "git pull" to merge the remote branch into yours)

not sure what to do from here

try:

git reset --hard origin/main

git checkout main
1 Like

``git reset --hard origin/main

HEAD is now at 964236a FEATURE: Bump base image used by launcher to pull in Ruby 3.3.x take 2 (#805)``

That sounds good?

shall i try the launcher rebuild again?

1 Like

yes, you are out of jail

now rebuild

3 Likes

It has downloaded the Discourse base image and rebuilt mostly. BUT

it still failed due to a ruby gem issue.

URGENT: Failed to initialize site default: ActiveRecord::ConnectionNotEstablished connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:87:in `rescue in new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_handling.rb:280:in `connection'
/var/www/discourse/lib/site_settings/db_provider.rb:58:in `table_exists?'
/var/www/discourse/lib/site_settings/db_provider.rb:14:in `all'
/var/www/discourse/lib/site_settings/defaults_provider.rb:30:in `db_all'
/var/www/discourse/lib/site_setting_extension.rb:295:in `block in refresh!'
/var/www/discourse/lib/site_setting_extension.rb:288:in `synchronize'
/var/www/discourse/lib/site_setting_extension.rb:288:in `refresh!'
/var/www/discourse/config/initializers/005-site_settings.rb:20:in `block (2 levels) in <main>'
/var/www/discourse/lib/freedom_patches/rails_multisite.rb:8:in `block in safe_each_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management/null_instance.rb:36:in `each_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-6.0.0/lib/rails_multisite/connection_management.rb:21:in `each_connection'
/var/www/discourse/lib/freedom_patches/rails_multisite.rb:6:in `safe_each_connection'
/var/www/discourse/config/initializers/005-site_settings.rb:18:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:445:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:445:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:686:in `catch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:686:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:200:in `block in halting'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:106:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/reloader.rb:88:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application/finisher.rb:68:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/local/lib/ruby/3.3.0/tsort.rb:231:in `block in tsort_each'
/usr/local/lib/ruby/3.3.0/tsort.rb:353:in `block (2 levels) in each_strongly_connected_component'
/usr/local/lib/ruby/3.3.0/tsort.rb:434:in `each_strongly_connected_component_from'
/usr/local/lib/ruby/3.3.0/tsort.rb:352:in `block in each_strongly_connected_component'
/usr/local/lib/ruby/3.3.0/tsort.rb:350:in `each'
/usr/local/lib/ruby/3.3.0/tsort.rb:350:in `call'
/usr/local/lib/ruby/3.3.0/tsort.rb:350:in `each_strongly_connected_component'
/usr/local/lib/ruby/3.3.0/tsort.rb:229:in `tsort_each'
/usr/local/lib/ruby/3.3.0/tsort.rb:208:in `tsort_each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:372:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.15/lib/zeitwerk/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:348:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:506:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:241:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:241:in `invoke_prerequisites'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:241:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:241:in `invoke_prerequisites'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:80:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/bin/rake:25:in `load'
/var/www/discourse/vendor/bundle/ruby/3.3.0/bin/rake:25:in `<top (required)>'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
rake aborted!
ActiveRecord::ConnectionNotEstablished: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (ActiveRecord::ConnectionNotEstablished)
        Is the server running locally and accepting connections on that socket?
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:87:in `rescue in new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_handling.rb:280:in `connection'
/var/www/discourse/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:445:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:445:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:686:in `catch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:686:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:200:in `block in halting'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:106:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/reloader.rb:88:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application/finisher.rb:68:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:372:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.15/lib/zeitwerk/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:348:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:506:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'

Caused by:
PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory (PG::ConnectionBad)
        Is the server running locally and accepting connections on that socket?
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg/connection.rb:819:in `connect_start'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg/connection.rb:819:in `connect_to_hosts'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg/connection.rb:759:in `new'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.4/lib/pg.rb:63:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.4/lib/active_record/connection_handling.rb:280:in `connection'
/var/www/discourse/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:445:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:445:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:199:in `block (2 levels) in halting'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:687:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:686:in `catch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:686:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:200:in `block in halting'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:595:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:106:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.0.8.4/lib/active_support/reloader.rb:88:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application/finisher.rb:68:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:372:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/zeitwerk-2.6.15/lib/zeitwerk/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:348:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.0.8.4/lib/rails/application.rb:506:in `block in run_tasks_blocks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
I, [2024-06-11T21:52:02.626877 #1]  INFO -- :
I, [2024-06-11T21:52:02.629304 #1]  INFO -- : Terminating async processes
I, [2024-06-11T21:52:02.629443 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 80
80:signal-handler (1718142722) Received SIGTERM scheduling shutdown...
80:M 11 Jun 2024 21:52:02.694 # User requested shutdown...
80:M 11 Jun 2024 21:52:02.694 * Saving the final RDB snapshot before exiting.
80:M 11 Jun 2024 21:52:02.774 * DB saved on disk
80:M 11 Jun 2024 21:52:02.774 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 739 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
3bcc5db5b47850ae5c88f178404bd21e9e3d9dcec351da206a85e6a48dcb427a

Looks like something is up with your postgres installation.

3 Likes

This is not a ruby gem issue, it’s a database server issue.

2 Likes

Right ok. Another rabbit hole to go down.

I followed these steps to install postgres: How to Install and Use PostgreSQL on Ubuntu 20.04. | Linode Docs

It is successfully running, however the app rebuild still fails with same error. I suspect this is due to the docker-compose file not configured with the correct postgres user.

it’s currently using “root”

psql postgres -c 'SELECT version();'

psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "root" does not exist

Normally Discourse comes with it’s own Postgres. This is the first time you mention docker-compose. Tell us more about your setup please.

1 Like

I think you are better off using time more efficiently and moving to a fresh VPS.

2 Likes

Agreed. It just relies on the owner. He has to reset the Linode server with a fresh 24.04 install. I’ve already put the word out.

Appreciate all your efforts. It’s been educational! At least I’ll know more about how to manage it from the CLI once I spin it up again.

1 Like

Hardships like this are useful experience in the long run.

1 Like