فشل إعادة البناء لخادم غير مُحَافَظ عليه بشكل جيد ومشكلة ملكية - أبحث عن مساعدة

Hello, and thanks for reading! Our community lost its primary technical administrator, and because of that they have created a single point of failure for us in a number of ways. Recently, one of the admins noticed that transactional emails were no longer being delivered, and I am the only active person remaining with any systems administration experience.

However, one member had ownership of our cloud server and was responsible for payments so we were able to gain root access to our Discourse server.

We originally thought that we could make a local backup, but S3 is configured so the local backups steps wouldn’t work and our last local backup is 2019.

While backups on S3 are as recent as last week we do not have access to the S3 bucket. Our remaining admin supposedly gets the emails, but whether he can download them without authentication to S3 is an open question.

At this point, we decided we could either attempt a rebuild, or reconfigure the mail services to a new SendGrid account - we were already using SendGrid but didn’t know the info.

I decided to attempt a rebuild since, for whatever reason in my mind, it seemed like a more reliable option for potentially resolving errors and was inevitably needed.

It failed with the following output:

==================== REBUILD LOG ====================
x86_64 arch detected.
WARNING: containers/app.yml file is world-readable. You can secure this file by running: chmod o-rwx containers/app.yml
Ensuring launcher is up to date
Fetching origin
Launcher has diverged source, this is only expected in Dev mode
Stopping old container
+ /usr/bin/docker stop -t 60 app
app
2.0.20230313-1023: Pulling from discourse/base
Digest: sha256:f7467469ab9e39c3548d4478e3f416c05b34a0ee58eb6e40b963e562005669cc
Status: Image is up to date for discourse/base:2.0.20230313-1023
docker.io/discourse/base:2.0.20230313-1023
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-03-23T00:18:18.600612 #1]  INFO -- : Reading from stdin
I, [2025-03-23T00:18:18.607987 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2025-03-23T00:18:18.693415 #1]  INFO -- : Generating locales (this might take a while)...
Generation complete.

I, [2025-03-23T00:18:18.693711 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2025-03-23T00:18:18.699738 #1]  INFO -- :
I, [2025-03-23T00:18:18.700585 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2025-03-23T00:18:18.705669 #1]  INFO -- :
I, [2025-03-23T00:18:18.706036 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2025-03-23T00:18:18.710603 #1]  INFO -- :
I, [2025-03-23T00:18:18.710840 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2025-03-23T00:18:18.715934 #1]  INFO -- :
I, [2025-03-23T00:18:18.716265 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2025-03-23T00:18:18.720901 #1]  INFO -- :
I, [2025-03-23T00:18:18.721141 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2025/03/23 00:18:18 socat[19] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2025-03-23T00:18:18.735107 #1]  INFO -- :
I, [2025-03-23T00:18:18.735305 #1]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2025-03-23T00:18:18.741065 #1]  INFO -- :
I, [2025-03-23T00:18:18.741225 #1]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2025-03-23T00:18:18.747157 #1]  INFO -- :
I, [2025-03-23T00:18:18.747321 #1]  INFO -- : > mkdir -p /shared/postgres_run/13-main.pg_stat_tmp
I, [2025-03-23T00:18:18.752360 #1]  INFO -- :
I, [2025-03-23T00:18:18.752671 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run/13-main.pg_stat_tmp
I, [2025-03-23T00:18:18.758084 #1]  INFO -- :
I, [2025-03-23T00:18:18.768877 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown:
I, [2025-03-23T00:18:18.778907 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown:
I, [2025-03-23T00:18:18.788505 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown:
I, [2025-03-23T00:18:18.799277 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown:
I, [2025-03-23T00:18:18.799808 #1]  INFO -- : > chown -R root /var/lib/postgresql/13/main
I, [2025-03-23T00:18:19.007579 #1]  INFO -- :
I, [2025-03-23T00:18:19.007806 #1]  INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/13/bin/initdb -D /shared/postgres_data || exit 0
I, [2025-03-23T00:18:19.010768 #1]  INFO -- :
I, [2025-03-23T00:18:19.010931 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2025-03-23T00:18:19.047929 #1]  INFO -- :
I, [2025-03-23T00:18:19.048161 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2025-03-23T00:18:19.051531 #1]  INFO -- :
I, [2025-03-23T00:18:19.051974 #1]  INFO -- : > /root/upgrade_postgres
I, [2025-03-23T00:18:19.062513 #1]  INFO -- :
I, [2025-03-23T00:18:19.062718 #1]  INFO -- : > rm /root/upgrade_postgres
I, [2025-03-23T00:18:19.065696 #1]  INFO -- :
I, [2025-03-23T00:18:19.066378 #1]  INFO -- : Replacing data_directory = '/var/lib/postgresql/13/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.067338 #1]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.067801 #1]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.068343 #1]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.068760 #1]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.069202 #1]  INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.069589 #1]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2025-03-23T00:18:19.075219 #1]  INFO -- :
I, [2025-03-23T00:18:19.075772 #1]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.076190 #1]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.076722 #1]  INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/13/main/postgresql.conf
I, [2025-03-23T00:18:19.077185 #1]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/13/main/pg_hba.conf
I, [2025-03-23T00:18:19.077661 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2025-03-23T00:18:19.078027 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2025-03-23T00:18:19.078404 #1]  INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main
I, [2025-03-23T00:18:19.080855 #1]  INFO -- : > sleep 5
2025-03-23 00:18:19.198 UTC [42] LOG:  starting PostgreSQL 13.10 (Debian 13.10-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2025-03-23 00:18:19.199 UTC [42] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2025-03-23 00:18:19.199 UTC [42] LOG:  listening on IPv6 address "::", port 5432
2025-03-23 00:18:19.205 UTC [42] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-03-23 00:18:19.214 UTC [45] LOG:  database system was shut down at 2025-03-23 00:03:12 UTC
2025-03-23 00:18:19.229 UTC [42] LOG:  database system is ready to accept connections
I, [2025-03-23T00:18:24.084187 #1]  INFO -- :
I, [2025-03-23T00:18:24.084488 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
2025-03-23 00:18:24.204 UTC [55] postgres@postgres ERROR:  database "discourse" already exists
2025-03-23 00:18:24.204 UTC [55] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR:  database "discourse" already exists
I, [2025-03-23T00:18:24.207833 #1]  INFO -- :
I, [2025-03-23T00:18:24.208363 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2025-03-23 00:18:24.305 UTC [59] postgres@discourse ERROR:  role "discourse" already exists
2025-03-23 00:18:24.305 UTC [59] postgres@discourse STATEMENT:  create user discourse;
ERROR:  role "discourse" already exists
I, [2025-03-23T00:18:24.309053 #1]  INFO -- :
I, [2025-03-23T00:18:24.309640 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
I, [2025-03-23T00:18:24.419882 #1]  INFO -- : GRANT

I, [2025-03-23T00:18:24.420493 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
I, [2025-03-23T00:18:24.517946 #1]  INFO -- : ALTER SCHEMA

I, [2025-03-23T00:18:24.518418 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
NOTICE:  extension "hstore" already exists, skipping
I, [2025-03-23T00:18:24.625671 #1]  INFO -- : CREATE EXTENSION

I, [2025-03-23T00:18:24.626326 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
NOTICE:  extension "pg_trgm" already exists, skipping
I, [2025-03-23T00:18:24.725233 #1]  INFO -- : CREATE EXTENSION

I, [2025-03-23T00:18:24.725801 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists hstore;"'
NOTICE:  extension "hstore" already exists, skipping
I, [2025-03-23T00:18:24.827529 #1]  INFO -- : CREATE EXTENSION

I, [2025-03-23T00:18:24.828107 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists pg_trgm;"'
NOTICE:  extension "pg_trgm" already exists, skipping
I, [2025-03-23T00:18:24.931702 #1]  INFO -- : CREATE EXTENSION

I, [2025-03-23T00:18:24.932258 #1]  INFO -- : > sudo -u postgres psql discourse
I, [2025-03-23T00:18:24.935282 #1]  INFO -- : update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = 'discourse' AND encoding = pg_char_to_encoding('SQL_ASCII');

I, [2025-03-23T00:18:25.031195 #1]  INFO -- : File > /var/lib/postgresql/take-database-backup  chmod: +x  chown: postgres:postgres
I, [2025-03-23T00:18:25.037342 #1]  INFO -- : File > /var/spool/cron/crontabs/postgres  chmod:   chown:
I, [2025-03-23T00:18:25.037745 #1]  INFO -- : > echo postgres installed!
I, [2025-03-23T00:18:25.042262 #1]  INFO -- : postgres installed!

I, [2025-03-23T00:18:25.052240 #1]  INFO -- : File > /etc/service/redis/run  chmod: +x  chown:
I, [2025-03-23T00:18:25.061161 #1]  INFO -- : File > /etc/service/redis/log/run  chmod: +x  chown:
I, [2025-03-23T00:18:25.070080 #1]  INFO -- : File > /etc/runit/3.d/10-redis  chmod: +x  chown:
I, [2025-03-23T00:18:25.070956 #1]  INFO -- : Replacing daemonize yes with  in /etc/redis/redis.conf
I, [2025-03-23T00:18:25.072697 #1]  INFO -- : Replacing (?-mix:^pidfile.*$) with  in /etc/redis/redis.conf
I, [2025-03-23T00:18:25.073799 #1]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2025-03-23T00:18:25.077931 #1]  INFO -- :
I, [2025-03-23T00:18:25.078752 #1]  INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2025-03-23T00:18:25.080205 #1]  INFO -- : Replacing (?-mix:^bind .*$) with  in /etc/redis/redis.conf
I, [2025-03-23T00:18:25.081472 #1]  INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2025-03-23T00:18:25.082868 #1]  INFO -- : Replacing (?-mix:^protected-mode yes) with protected-mode no in /etc/redis/redis.conf
I, [2025-03-23T00:18:25.084108 #1]  INFO -- : Replacing # io-threads 4 with io-threads $redis_io_threads in /etc/redis/redis.conf
I, [2025-03-23T00:18:25.085201 #1]  INFO -- : > echo redis installed
I, [2025-03-23T00:18:25.088466 #1]  INFO -- : redis installed

I, [2025-03-23T00:18:25.088953 #1]  INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2025-03-23T00:18:25.095957 #1]  INFO -- : logfile ""

I, [2025-03-23T00:18:25.096489 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2025-03-23T00:18:25.099538 #1]  INFO -- : > sleep 10
103:C 23 Mar 2025 00:18:25.116 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
103:C 23 Mar 2025 00:18:25.116 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=103, just started
103:C 23 Mar 2025 00:18:25.116 # Configuration loaded
103:M 23 Mar 2025 00:18:25.118 * monotonic clock: POSIX clock_gettime
103:M 23 Mar 2025 00:18:25.120 * Running mode=standalone, port=6379.
103:M 23 Mar 2025 00:18:25.120 # Server initialized
103:M 23 Mar 2025 00:18:25.120 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
103:M 23 Mar 2025 00:18:25.121 * Loading RDB produced by version 7.0.7
103:M 23 Mar 2025 00:18:25.121 * RDB age 913 seconds
103:M 23 Mar 2025 00:18:25.121 * RDB memory usage when created 29.75 Mb
103:M 23 Mar 2025 00:18:25.266 * Done loading RDB, keys loaded: 18090, keys expired: 3.
103:M 23 Mar 2025 00:18:25.266 * DB loaded from disk: 0.145 seconds
103:M 23 Mar 2025 00:18:25.266 * Ready to accept connections
I, [2025-03-23T00:18:35.105146 #1]  INFO -- :
I, [2025-03-23T00:18:35.107388 #1]  INFO -- : > thpoff echo "thpoff is installed!"
I, [2025-03-23T00:18:35.117140 #1]  INFO -- : thpoff is installed!

I, [2025-03-23T00:18:35.118070 #1]  INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
I, [2025-03-23T00:18:35.260647 #1]  INFO -- :
I, [2025-03-23T00:18:35.261530 #1]  INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
I, [2025-03-23T00:18:35.379994 #1]  INFO -- :
I, [2025-03-23T00:18:35.380922 #1]  INFO -- : > /usr/local/bin/ruby -e 'if (ENV["DISCOURSE_CDN_URL"] || "")[0..1] == "//"; puts "Aborting! CDN must have a protocol specified. Once fixed you should rebake your posts now to correct all posts."; exit 1; end'
I, [2025-03-23T00:18:35.520434 #1]  INFO -- :
I, [2025-03-23T00:18:35.521804 #1]  INFO -- : > rm -f /etc/cron.d/anacron
I, [2025-03-23T00:18:35.527278 #1]  INFO -- :
I, [2025-03-23T00:18:35.533681 #1]  INFO -- : File > /etc/cron.d/anacron  chmod:   chown:
I, [2025-03-23T00:18:35.544400 #1]  INFO -- : File > /etc/runit/1.d/copy-env  chmod: +x  chown:
I, [2025-03-23T00:18:35.555450 #1]  INFO -- : File > /etc/service/unicorn/run  chmod: +x  chown:
I, [2025-03-23T00:18:35.565315 #1]  INFO -- : File > /etc/service/nginx/run  chmod: +x  chown:
I, [2025-03-23T00:18:35.575445 #1]  INFO -- : File > /etc/runit/3.d/01-nginx  chmod: +x  chown:
I, [2025-03-23T00:18:35.586497 #1]  INFO -- : File > /etc/runit/3.d/02-unicorn  chmod: +x  chown:
I, [2025-03-23T00:18:35.586705 #1]  INFO -- : Replacing # postgres with sv start postgres || exit 1 in /etc/service/unicorn/run
I, [2025-03-23T00:18:35.587163 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2025-03-23T00:18:35.590588 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git reset --hard
130:C 23 Mar 2025 00:18:35.612 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
130:C 23 Mar 2025 00:18:35.612 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=130, just started
130:C 23 Mar 2025 00:18:35.612 # Configuration loaded
130:M 23 Mar 2025 00:18:35.613 * monotonic clock: POSIX clock_gettime
130:M 23 Mar 2025 00:18:35.614 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
130:M 23 Mar 2025 00:18:35.614 # Failed listening on port 6379 (TCP), aborting.
Updating files: 100% (32972/32972), done.
I, [2025-03-23T00:18:40.370921 #1]  INFO -- : HEAD is now at 59e548540 Build(deps): Bump sass from 1.58.3 to 1.59.2 in /app/assets/javascripts (#20656)

I, [2025-03-23T00:18:40.371398 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
I, [2025-03-23T00:18:40.710584 #1]  INFO -- :
I, [2025-03-23T00:18:40.711030 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  if [ $(git rev-parse --is-shallow-repository) == "true" ]; then
      git remote set-branches --add origin main
      git remote set-branches origin tests-passed
      git fetch --depth 1 origin tests-passed
  else
      git fetch --prune --prune-tags origin tests-passed
  fi
'
From https://github.com/discourse/discourse
 * branch                tests-passed -> FETCH_HEAD
   05e713d09..e7c3abb94  tests-passed -> origin/tests-passed
I, [2025-03-23T00:18:42.586103 #1]  INFO -- :
I, [2025-03-23T00:18:42.586534 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  if [[ $(git symbolic-ref --short HEAD) == tests-passed ]] ; then
      git pull
  else
      git -c advice.detachedHead=false checkout tests-passed
  fi
'
Switched to a new branch 'tests-passed'
I, [2025-03-23T00:18:51.833256 #1]  INFO -- : Branch 'tests-passed' set up to track remote branch 'tests-passed' from 'origin'.

I, [2025-03-23T00:18:51.834334 #1]  INFO -- : > cd /var/www/discourse && mkdir -p tmp
I, [2025-03-23T00:18:51.841544 #1]  INFO -- :
I, [2025-03-23T00:18:51.841855 #1]  INFO -- : > cd /var/www/discourse && chown discourse:www-data tmp
I, [2025-03-23T00:18:51.847601 #1]  INFO -- :
I, [2025-03-23T00:18:51.847953 #1]  INFO -- : > cd /var/www/discourse && mkdir -p tmp/pids
I, [2025-03-23T00:18:51.855859 #1]  INFO -- :
I, [2025-03-23T00:18:51.856222 #1]  INFO -- : > cd /var/www/discourse && mkdir -p tmp/sockets
I, [2025-03-23T00:18:51.863615 #1]  INFO -- :
I, [2025-03-23T00:18:51.863977 #1]  INFO -- : > cd /var/www/discourse && touch tmp/.gitkeep
I, [2025-03-23T00:18:51.869796 #1]  INFO -- :
I, [2025-03-23T00:18:51.870182 #1]  INFO -- : > cd /var/www/discourse && mkdir -p                    /shared/log/rails
I, [2025-03-23T00:18:51.876106 #1]  INFO -- :
I, [2025-03-23T00:18:51.876454 #1]  INFO -- : > cd /var/www/discourse && bash -c "touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log"
I, [2025-03-23T00:18:51.888118 #1]  INFO -- :
I, [2025-03-23T00:18:51.888454 #1]  INFO -- : > cd /var/www/discourse && bash -c "ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log /var/www/discourse/log"
I, [2025-03-23T00:18:51.897590 #1]  INFO -- :
I, [2025-03-23T00:18:51.898001 #1]  INFO -- : > cd /var/www/discourse && bash -c "mkdir -p           /shared/{uploads,backups}"
I, [2025-03-23T00:18:51.906190 #1]  INFO -- :
I, [2025-03-23T00:18:51.906512 #1]  INFO -- : > cd /var/www/discourse && bash -c "ln    -s           /shared/{uploads,backups} /var/www/discourse/public"
I, [2025-03-23T00:18:51.917159 #1]  INFO -- :
I, [2025-03-23T00:18:51.917467 #1]  INFO -- : > cd /var/www/discourse && bash -c "mkdir -p           /shared/tmp/{backups,restores}"
I, [2025-03-23T00:18:51.927203 #1]  INFO -- :
I, [2025-03-23T00:18:51.927487 #1]  INFO -- : > cd /var/www/discourse && bash -c "ln    -s           /shared/tmp/{backups,restores} /var/www/discourse/tmp"
I, [2025-03-23T00:18:51.937966 #1]  INFO -- :
I, [2025-03-23T00:18:51.938298 #1]  INFO -- : > cd /var/www/discourse && chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp
I, [2025-03-23T00:18:52.001123 #1]  INFO -- :
I, [2025-03-23T00:18:52.001476 #1]  INFO -- : > cd /var/www/discourse && [ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete
I, [2025-03-23T00:18:52.010734 #1]  INFO -- :
I, [2025-03-23T00:18:52.011660 #1]  INFO -- : Replacing # redis with sv start redis || exit 1 in /etc/service/unicorn/run
I, [2025-03-23T00:18:52.013337 #1]  INFO -- : > cd /var/www/discourse/plugins && mkdir -p plugins
I, [2025-03-23T00:18:52.019369 #1]  INFO -- :
I, [2025-03-23T00:18:52.019704 #1]  INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/discourse/docker_manager.git
Cloning into 'docker_manager'...
I, [2025-03-23T00:18:53.224801 #1]  INFO -- :
I, [2025-03-23T00:18:53.225328 #1]  INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/discourse/discourse-spoiler-alert.git
Cloning into 'discourse-spoiler-alert'...
I, [2025-03-23T00:18:53.893263 #1]  INFO -- :
I, [2025-03-23T00:18:53.893765 #1]  INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/discourse/discourse-data-explorer.git
Cloning into 'discourse-data-explorer'...
I, [2025-03-23T00:18:54.647629 #1]  INFO -- :
I, [2025-03-23T00:18:54.647998 #1]  INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/merefield/discourse-onebox-assistant.git
Cloning into 'discourse-onebox-assistant'...
I, [2025-03-23T00:18:55.121580 #1]  INFO -- :
I, [2025-03-23T00:18:55.122655 #1]  INFO -- : > cp /var/www/discourse/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf
I, [2025-03-23T00:18:55.127568 #1]  INFO -- :
I, [2025-03-23T00:18:55.128317 #1]  INFO -- : > rm /etc/nginx/sites-enabled/default
I, [2025-03-23T00:18:55.133169 #1]  INFO -- :
I, [2025-03-23T00:18:55.133494 #1]  INFO -- : > mkdir -p /var/nginx/cache
I, [2025-03-23T00:18:55.137201 #1]  INFO -- :
I, [2025-03-23T00:18:55.137985 #1]  INFO -- : Replacing pid /run/nginx.pid; with daemon off; in /etc/nginx/nginx.conf
I, [2025-03-23T00:18:55.139546 #1]  INFO -- : Replacing (?m-ix:upstream[^\}]+\}) with upstream discourse { server 127.0.0.1:3000; } in /etc/nginx/conf.d/discourse.conf
I, [2025-03-23T00:18:55.140371 #1]  INFO -- : Replacing (?-mix:server_name.+$) with server_name _ ; in /etc/nginx/conf.d/discourse.conf
I, [2025-03-23T00:18:55.141165 #1]  INFO -- : Replacing (?-mix:client_max_body_size.+$) with client_max_body_size $upload_size ; in /etc/nginx/conf.d/discourse.conf
I, [2025-03-23T00:18:55.142058 #1]  INFO -- : Replacing (?-mix:worker_connections.+$) with worker_connections $nginx_worker_connections ; in /etc/nginx/nginx.conf
I, [2025-03-23T00:18:55.142716 #1]  INFO -- : > echo "done configuring web"
I, [2025-03-23T00:18:55.145799 #1]  INFO -- : done configuring web

I, [2025-03-23T00:18:55.146504 #1]  INFO -- : > cd /var/www/discourse && gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
I, [2025-03-23T00:18:56.661918 #1]  INFO -- : Successfully installed bundler-2.6.4
1 gem installed

I, [2025-03-23T00:18:56.662443 #1]  INFO -- : > cd /var/www/discourse && find /var/www/discourse ! -user discourse -exec chown discourse {} \+
I, [2025-03-23T00:18:58.289649 #1]  INFO -- :
I, [2025-03-23T00:18:58.290115 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'yarn install --production --frozen-lockfile && yarn cache clean'
error discourse@: The engine "node" is incompatible with this module. Expected version ">= 20". Got "18.15.0"
error discourse@: The engine "yarn" is incompatible with this module. Expected version "please-use-pnpm". Got "1.22.19"
warning discourse@: The engine "pnpm" appears to be invalid.
error Found incompatible module.
I, [2025-03-23T00:18:58.802017 #1]  INFO -- : yarn install v1.22.19
info No lockfile found.
[1/5] Validating package.json...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

I, [2025-03-23T00:18:58.803434 #1]  INFO -- : Terminating async processes
I, [2025-03-23T00:18:58.803753 #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/13/bin/postmaster -D /etc/postgresql/13/main pid: 42
I, [2025-03-23T00:18:58.804011 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103
103:signal-handler (1742689138) Received SIGTERM scheduling shutdown...
2025-03-23 00:18:58.804 UTC [42] LOG:  received fast shutdown request
103:M 23 Mar 2025 00:18:58.806 # User requested shutdown...
103:M 23 Mar 2025 00:18:58.806 * Saving the final RDB snapshot before exiting.
2025-03-23 00:18:58.863 UTC [42] LOG:  aborting any active transactions
2025-03-23 00:18:58.868 UTC [42] LOG:  background worker "logical replication launcher" (PID 51) exited with exit code 1
2025-03-23 00:18:58.871 UTC [46] LOG:  shutting down
2025-03-23 00:18:58.960 UTC [42] LOG:  database system is shut down
103:M 23 Mar 2025 00:18:59.184 * DB saved on disk
103:M 23 Mar 2025 00:18:59.184 # Redis is now ready to exit, bye bye...

I am assuming that these errors are the primary reason?

error discourse@: The engine "node" is incompatible with this module. Expected version ">= 20". Got "18.15.0"
error discourse@: The engine "yarn" is incompatible with this module. Expected version "please-use-pnpm". Got "1.22.19"
warning discourse@: The engine "pnpm" appears to be invalid.

I then attempted to update these modules using npm. I installed npm on the discourse server, and tried to upgrade yarn, but needed node as a dependency. I tried to upgrade node, and received an error that a particular file required administrative access during the install, and I needed to run a chown command to change privileges. I did that, but it made no difference.

That’s ultimately where we stopped.

Here’s my ask:

  1. If we do get this yarn / node thing situation updated, will that resolve the rebuild error? How do we do that?

  2. Is there any way I can compel the server to make a local backup now, outside of S3? If I can do that, we may just abandon ship and restore to a new Discourse hosted server.

  3. Are there paid discourse services that could help us? My time is almost non-existent and I want our community to be saved even if it costs us a bit.

Lastly, the server is running Ubuntu 20.04. Additionally, we have this as our plugin list -

==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/discourse/discourse-data-explorer.git
          - git clone https://github.com/merefield/discourse-onebox-assistant.git

WARNING:
You have what appear to be non-official plugins.
If you are having trouble, you should disable them and try rebuilding again.

See https://github.com/discourse/discourse/blob/main/lib/plugin/metadata.rb for the official list.

But I am presuming these have nothing to do with the failed rebuild.

Thank you for your help.

إذا كانت النسخ الاحتياطي تذهب إلى هناك، فلديك وصول إليها. ونعم، وكذلك أي شخص يمتلك تلك الحاوية.

لا تتردد في فتح موضوع في Marketplace إذا كنت ترغب في استكشاف خدمات طرف ثالث مدفوعة.

4 إعجابات

هذا موقف صعب - أتعاطف معك.

شخصيًا، سأرغب بشدة في الحصول على نسخة احتياطية قبل محاولة إعادة البناء. إذا لم تكن عملية النسخ الاحتياطي المنتظمة مفيدة لك (لأنها ترسل النسخ الاحتياطية إلى مكان غير متاح)، فسأحاول بطريقة ما الحصول على نسخة احتياطية من قاعدة البيانات باستخدام سطر الأوامر، لكنني لست متأكدًا تمامًا من كيفية القيام بذلك. ربما pg_dump داخل docker؟

أو ربما يمكنك استخدام وصولك إلى سطر الأوامر لإعادة توجيه النسخ الاحتياطية إلى القرص المحلي بدلاً من S3.

ولكن في كلتا الحالتين ستحتاج إلى مساحة قرص محلية كافية.

تعديل: تم النشر بالتزامن مع جاي.

5 إعجابات

شكرًا لك - فكرتي العامة إذا كان بإمكاننا إجراء نسخة احتياطية هي بالفعل إعادة توجيه النسخة الاحتياطية إلى قرص محلي بدلاً من S3 وسيكون لدينا مساحة لها.

إنه خطئي لأنني لم أكتشف النسخة الاحتياطية المحلية الليلة الماضية بدلاً من إعادة البناء - البصيرة بأثر رجعي واضحة تمامًا في هذا الشأن. لقد قللت من تقدير تأثير إعادة البناء.

هل يمكنك مساعدتي في فهم هذا؟ هل تقصد أن بيانات الاعتماد يجب أن تكون موجودة إذا تم توجيه النسخ الاحتياطية إلى هناك؟ (لقد أكدنا ظهور نسخة جديدة في لوحة تحكم Discourse الخاصة بنا)

المشكلة هي، إذا كنا بحاجة إلى بيانات الاعتماد للوصول إلى النسخة الاحتياطية، فأنا لا أعتقد أن أي شخص لديه تلك البيانات باستثناء الشخص الذي اختفى.

هل يمكن لـ literatecomputing الحصول على نسخة احتياطية محلية واستعادة موقعنا الحالي إلى خادم جديد مُدار إذا تولوا العمل؟

إذا كان S3 bucket يحتوي على نسخ احتياطية حديثة مثل الأسبوع الماضي، فإن Discourse لديه بيانات الاعتماد الخاصة بالـ bucket. من المحتمل أن تكون في app.yml أو في إعدادات الموقع.

ولكن، لست بحاجة إلى الوصول إلى S3 bucket بنفسك، يجب أن تكون قادرًا على تنزيل النسخة الاحتياطية من خلال Discourse.

هل ترى النسخ الاحتياطية في /admin/backups؟
إذا كان الأمر كذلك، فماذا يحدث عندما تحاول تنزيلها؟

يمكنك أيضًا تغيير إعدادات الموقع - النسخ الاحتياطية - موقع النسخ الاحتياطي إلى “التخزين المحلي”.

5 إعجابات

نعم. إذا كنت تقوم بالنسخ الاحتياطي إلى S3، فإن بيانات الاعتماد موجودة في قاعدة البيانات الخاصة بك أو في ملف yml.

نعم. إما في SiteSettings أو في ملف yml يوجد الإعداد backup_location. إذا كان في SiteSettings وليس في قاعدة البيانات، فسيكون الأمر أصعب، ولكنه ليس مستحيلاً التغيير.

إعجاب واحد (1)

أنا مجرد مبتدئ ولكن هل يمكن أن يكون

من الموضوع الأخير الذي تم الإبلاغ عنه عن مشكلة ملكية ملف عند إعادة البناء

إذا كان لديك وصول سطر الأوامر، فلماذا لا تقوم بعمل نسخة احتياطية من سطر الأوامر؟

لدي وصول جذري. لقد قمت بعمل نسخة احتياطية من سطر الأوامر، لكنها تم دفعها إلى S3. بفضل تعليقات @pfaffman، أدرك الآن أنه يمكنني محاولة سحب النسخة الاحتياطية من S3 إلى الجهاز المحلي - أحتاج فقط إلى الوقت لمحاولة ذلك.

هل ترى الإعداد backup_location في الإعدادات في واجهة المستخدم (أم أن الخادم معطل لذلك لا يمكنك الرؤية؟)

إعجابَين (2)

هل تقصد هذا التحذير؟

تحذير: الملف containers/app.yml قابل للقراءة من قبل الجميع. يمكنك تأمين هذا الملف عن طريق تشغيل: chmod o-rwx containers/app.yml

إنه تحذير. لسنوات عديدة، كان الإعداد الافتراضي هو جعل هذا الملف قابلاً للقراءة من قبل الجميع (بافتراض أن معظم المستضيفين الذاتيين سيسجلون الدخول كـ root ولن يكون لديهم مستخدمون آخرون)، ولكن في مرحلة ما تقرر أن وجود الأسرار في هذا الملف قابلة للقراءة من قبل الجميع ليس من أفضل الممارسات. نظرًا لأنك تقوم بتشغيل المشغل كـ root، سيتمكن root دائمًا من قراءة الملف.

إعجاب واحد (1)

لا أرى admin/backups أين هذا؟ المكان الوحيد الذي رأيت فيه backups هو /var/discourse/shared/standalone/backups/default، ولكن هذه كلها نسخ احتياطية محلية قديمة.

سأتابع موقف إعدادات الموقع لاحقًا عندما يستيقظ الشخص الذي يمكنه الوصول إليها (إنهم على التوقيت البريطاني). أفترض أنه ليس لديهم وصول لأن الموقع معطل.

لا أرى إعدادًا محددًا لـ backup_location في ملف app.yml.

أيضًا، الشريط الجانبي ولكني رأيت في قسم “نبذة عنا” في شركتك أنك مدرس سابق في مادة الحاسوب. هذه هي وظيفتي اليومية حاليًا :smiley:

ليس هذا. عندما تتاح لي الفرصة، سأنشر الخطأ المحدد، ولكنه كان من محاولة ترقية العقدة، كما قلت، وليس أثناء إعادة البناء.

إعجابَين (2)

أضف هذا إلى عنوان URL الخاص بالمنتديات لديك. يجب أن تكون قادرًا على رؤية النسخ الاحتياطية الخاصة بك في واجهة المستخدم.

أوه، فهمت. كنت أبحث عن هذا على الخادم نفسه. الموقع معطل تمامًا لذلك ليس لدي وصول إلى الصفحة.

إعجاب واحد (1)

مجرد سؤال عام. ما هي مواصفات الخادم؟ بما في ذلك إصدار نظام التشغيل.

هذه صورة قديمة [1] ومن المحتمل أن تكون مصدر هذه الأخطاء:

ربما تحتاج إلى git pull دليل discourse_docker (الدليل الذي تقوم منه بتشغيل launcher).

كالعادة، قم بعمل نسخة احتياطية للخادم أولاً لأنك في حالة متدهورة.


  1. في وقت الإنترنت ↩︎

إعجاب واحد (1)

تمكنا من الحصول على نسخة احتياطية محلية جديدة مرتبة اليوم، لذا أقوم بتنزيلها محليًا الآن.

إذًا، سأقوم فقط بـ pull في /var/discourse، ثم أحاول إعادة البناء للتحديث؟

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

diverged هو بالفعل أقل من الواقع :smile:

إعجاب واحد (1)

أفترض أنك كنت تقوم بتثبيت تكوينات الحاوية الخاصة بك، لذا قد يؤدي git pull أو git pull --rebase إلى وصولك إلى ما تحتاجه، يمكنك تجربته :+1:

صديقي، ليس لدي أدنى فكرة عما كان يحدث، لكنني سأرى ما سنحصل عليه بسحب أو إعادة تأسيس إذا لزم الأمر. سأقوم بإنشاء نافذة صيانة جديدة لأنه، لسبب ما، عاد الموقع للعمل بالإصدار القديم. سأقوم بتحديثكم جميعًا بالنتائج.

أنا أقدر حقًا كل هذه الحكمة!

إعجابَين (2)