Moving to New Server woes

I am moving my discourse installation to a new server, DNS etc is all already patched up, valid SSL certificates on the server I copied the /var/discourse folder from server A to server B and trying to rebuild it but i’m having some issues.

I looked at the install notes which recommend The default of 1 GB RAM works fine for small Discourse communities. We recommend 2 GB RAM for larger communities. which all lines up with my server.

I have a 4GB DO instance that’s using about 30% of RAM right now so should have plenty of RAM, though this is dying on building the container.

Any help would be appreciated.

/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:35:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:29:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/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.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:69:in `rescue in new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:57:in `new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:982:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:994:in `reconnect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:662:in `block in reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:661:in `reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:763:in `block in verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:754:in `verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:771:in `connect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:977:in `block in with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:976:in `with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:128:in `quote_string'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/quoting.rb:76:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1099:in `quoted_scope'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1076:in `data_source_sql'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:60:in `table_exists?'
/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.2.2.1/lib/active_support/callbacks.rb:407:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:179:in `block in call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:668:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `catch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:180:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:109:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/reloader.rb:96:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:435:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/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.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:411:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:559: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.9/lib/pg/connection.rb:837:in `connect_start'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg/connection.rb:837:in `connect_to_hosts'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg/connection.rb:772:in `new'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg.rb:63:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:58:in `new_client'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:982:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:994:in `reconnect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:662:in `block in reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:661:in `reconnect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:763:in `block in verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:754:in `verify!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:771:in `connect!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:977:in `block in with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:976:in `with_raw_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:128:in `quote_string'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/quoting.rb:76:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/quoting.rb:122:in `quote'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1099:in `quoted_scope'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:1076:in `data_source_sql'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:60:in `table_exists?'
/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.2.2.1/lib/active_support/callbacks.rb:407:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:179:in `block in call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:668:in `block (2 levels) in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `catch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `block in default_terminator'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:180:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:109:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/activesupport-7.2.2.1/lib/active_support/reloader.rb:96:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:435:in `initialize!'
/var/www/discourse/config/environment.rb:7:in `<main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/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.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:411:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/railties-7.2.2.1/lib/rails/application.rb:559: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, [2025-03-09T13:54:08.054466 #1]  INFO -- : gem install ruby-openid -v 2.9.2 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed ruby-openid-2.9.2
1 gem installed
gem install rack-openid -v 1.4.2 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed rack-openid-1.4.2
1 gem installed
gem install omniauth-openid -v 2.0.1 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed omniauth-openid-2.0.1
1 gem installed
gem install omniauth-steam -v 1.0.6 -i /var/www/discourse/plugins/discourse-steam-login/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed omniauth-steam-1.0.6
1 gem installed

I, [2025-03-09T13:54:08.055390 #1]  INFO -- : Terminating async processes
I, [2025-03-09T13:54:08.055580 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 89
89:signal-handler (1741528448) Received SIGTERM scheduling shutdown...
89:M 09 Mar 2025 13:54:08.131 # User requested shutdown...
89:M 09 Mar 2025 13:54:08.131 * Saving the final RDB snapshot before exiting.
89:M 09 Mar 2025 13:54:08.166 * DB saved on disk
89:M 09 Mar 2025 13:54:08.166 # 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 1159 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.
b4a4fd37f9af5ae13eba2baa024dd57c418ad1279e34d59ed7aae45f08d8128c

It complains about the PSQL server socket, and the redis port but I have a feeling that neither of those is the root of the problem. Any suggestion on what to look at?

I’m using a web socket pattern, if that makes any difference.

app.yml snippet

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#  - "templates/web.ssl.template.yml"
#  - "templates/web.letsencrypt.ssl.template.yml"
  - "templates/web.socketed.template.yml"

I’m not sure this is the root of your issue, but I believe that after moving to a server with different specs, it’s advised to run ./discourse-setup again so it can configure some stuff accordingly to the new specs (swap, shared buffers, unicorn workers…).
Experts will correct me if I’m wrong :face_with_peeking_eye:

2 Likes

Interesting, that would be unexpected but I’ll give that a go and see.

Okay – Update:

Running the setup didn’t change anything. I simply prompted me for the host and adjusted some minor settings. So far still no go. Same error on rebuild. I also tried running the doctor to no avail.

The setup did complain that the host was unreachable on the given port which isn’t true.

I am serving via nginx proxy:


  location / {
    error_page 502 =502 /errors/discourse-offline.html;
    proxy_intercept_errors on;
    proxy_headers_hash_max_size 1024;
    proxy_headers_hash_bucket_size 128;
    proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
    proxy_set_header Host $http_host;
    proxy_http_version 1.1;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Real-IP $remote_addr;
  }
}

That might need some tweaking potentially but If it’s failing to build it shouldn’t even be a web server issue yet.

I’m no expert, but is there any conflicting nginx stuff or outdated redirects in your app.yml?

2 Likes

I mean, the discourse folder is a direct copy from what used to work. I recognize that it’s a different server, resources, versions of docker, etc. I’m assuming most of that should be abstracted away into the docker container where the only real difference between the two env is docker and resource/mem.

Even if nginx isn’t working the build of the container should work. I’m just trying to think through it, but the port conflicts on 80 or 443 should be a later issue if that’s not configured properly. This isn’t allowing me to even try to start the containers.

The config I have for nginx looks like is from a discourse example, so I’ll try to find a new updated version to see if that changes anything.

Oh for reference, I’m using ubuntu, 24.10, Oracular Oriole.

Linux forumhost 6.11.0-19-generic #19-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 21:43:43 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

You really want to use an LTS version like 24.10, else you’ll be doing this again pretty soon.

Is there another postgres on the server?

Did you rsync postgres over or are you starting with a clean install? If it’s clean, maybe delete /shared/standalone/postgres_* and start again. Then restore the database.

1 Like

I’d like to keep the data. As of now I simply copied the entire data in /var/discourse which includes all the data. Postgres, Redis and so on.

Are you running Discourse in Docker as recommended or directly on the server?

I strongly recommend following the official community’s tutorial on migrating servers rather than directly copying the /var/discourse folder.

1 Like

Yes, docker pattern. Hence the issue rebuilding the container comments.

Do you have a reference to that doc? I thought this worked last time, so I’m surprised at how much trouble this is giving me this time around.

Your installation of a fresh Discourse instance on your new server, followed by the restoration of your backup, will ensure everything operates seamlessly. I have followed this method, adhering to the official guidelines, to migrate servers at least five times without encountering any issues.

1 Like

See Move a Discourse site to another VPS with rsync

But if you don’t copy the database and instead make a backup on the old server and restore it to the new one you won’t next to have two copies of it.

2 Likes

I think there’s something else going on.

step 1. stop nginx to avoid port conflict (eventually nginx will proxy to the socket but keeping it simple)
step 2. git clone GitHub - discourse/discourse_docker: A Docker image for Discourse /var/discourse
step 3. cd /var/discourse && chmod 700 containers
step 4. ./discourse-setup
step 5. build failure

...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
I, [2025-03-10T14:17:49.762301 #1]  INFO -- : Building
Environment: production
The setting 'staticAddonTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTrees: true' in your Embroider config.
The setting 'staticAddonTestSupportTrees' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticAddonTestSupportTrees: true' in your Embroider config.
building... 
undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command was killed with SIGKILL (Forced termination): ember build -prod

I, [2025-03-10T14:17:49.768097 #1]  INFO -- : Terminating async processes
I, [2025-03-10T14:17:49.768368 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/15/bin/postmaster -D /etc/postgresql/15/main pid: 59
126:signal-handler (1741616269) Received SIGTERM scheduling shutdown...
I, [2025-03-10T14:17:49.769541 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 126
2025-03-10 14:17:49.774 UTC [59] LOG:  received fast shutdown request
2025-03-10 14:17:49.779 UTC [59] LOG:  aborting any active transactions
2025-03-10 14:17:49.812 UTC [59] LOG:  background worker "logical replication launcher" (PID 73) exited with exit code 1
126:M 10 Mar 2025 14:17:49.812 # User requested shutdown...
126:M 10 Mar 2025 14:17:49.812 * Saving the final RDB snapshot before exiting.
2025-03-10 14:17:49.817 UTC [68] LOG:  shutting down
126:M 10 Mar 2025 14:17:49.819 * DB saved on disk
2025-03-10 14:17:49.820 UTC [68] LOG:  checkpoint starting: shutdown immediate
126:M 10 Mar 2025 14:17:49.820 # Redis is now ready to exit, bye bye...
2025-03-10 14:17:50.013 UTC [68] LOG:  checkpoint complete: wrote 2461 buffers (1.9%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.082 s, sync=0.098 s, total=0.196 s; sync files=2470, longest=0.002 s, average=0.001 s; distance=17659 kB, estimate=17659 kB
2025-03-10 14:17:50.038 UTC [59] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile:build' failed with return #<Process::Status: pid 801 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"=>"build", "hook"=>"assets_precompile_build", "cmd"=>["su discourse -c 'bundle exec rake assets:precompile:build'"]}
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.
ed8a47c0a48fcf3eed3a152f69b7f5730fadb166e331ffff1361c7ee54bb7a81

This is from a brand new install, no state what so ever just trying to setup discourse on the server.

What does

free -h 

say? Do you have swap?

2 Likes

I got this the other day a few times. Tried again later in the day and it worked.

That was it. I ended up creating a file based swap and turning it on and that fixed any of my issues!

I ended up doing a new install and a backup restore to get it all working, but everything is working now. I appreciate the help.

5 Likes