Trouble Rebuilding: gnutls_handshake() failed

We’re having some trouble rebuilding one of our sites. It is hosted in China, which might have something to do with it. In the past we’ve used the web.china template to fix any issues there, but that doesn’t seem to help in this case.

Does anybody have any ideas what we could to do get this to rebuild properly?

Below is the output from discourse-doctor. It looks like this is the error:

fatal: unable to access 'https://github.com/discourse/discourse.git/': gnutls_handshake() failed: Error in the pull function.

discourse-doctor output:

DISCOURSE DOCTOR Fri Sep 8 03:05:13 AM CST 2023
OS: Linux china-forum02 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux


Found containers/app.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=www.DOMAINNAME.cn
SMTP_ADDRESS=smtp.mailgun.org
DEVELOPER_EMAILS=REDACTED
SMTP_PASSWORD=REDACTED
SMTP_PORT=587
SMTP_USER_NAME=postmaster@mg.DOMAINNAME.cn
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 24.0.6, build ed223bc

DOCKER PROCESSES (docker ps -a)

CONTAINER ID   IMAGE                 COMMAND        CREATED       STATUS                      PORTS     NAMES
4134952a7798   local_discourse/app   "/sbin/boot"   10 days ago   Exited (5) 50 minutes ago             app

==================== SERIOUS PROBLEM!!!! ====================
app not running!
Attempting to rebuild
==================== REBUILD LOG ====================
x86_64 arch detected.
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 app
app
2.0.20230825-1850: Pulling from discourse/base
Digest: sha256:3fd7032bbeb6f322ad7138ed154c0fc6177d75ebffba44871abea86620c0c7d5
Status: Image is up to date for discourse/base:2.0.20230825-1850
docker.io/discourse/base:2.0.20230825-1850
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2023-09-07T19:05:39.528484 #1]  INFO -- : Reading from stdin
I, [2023-09-07T19:05:39.535136 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2023-09-07T19:05:39.572012 #1]  INFO -- : Generating locales (this might take a while)...
Generation complete.

I, [2023-09-07T19:05:39.572624 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2023-09-07T19:05:39.575942 #1]  INFO -- :
I, [2023-09-07T19:05:39.576354 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2023-09-07T19:05:39.579069 #1]  INFO -- :
I, [2023-09-07T19:05:39.579476 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2023-09-07T19:05:39.581807 #1]  INFO -- :
I, [2023-09-07T19:05:39.582183 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2023-09-07T19:05:39.584936 #1]  INFO -- :
I, [2023-09-07T19:05:39.585292 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2023-09-07T19:05:39.587710 #1]  INFO -- :
I, [2023-09-07T19:05:39.588063 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2023/09/07 19:05:39 socat[20] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
I, [2023-09-07T19:05:39.595148 #1]  INFO -- :
I, [2023-09-07T19:05:39.595488 #1]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2023-09-07T19:05:39.598324 #1]  INFO -- :
I, [2023-09-07T19:05:39.598751 #1]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2023-09-07T19:05:39.602013 #1]  INFO -- :
I, [2023-09-07T19:05:39.602359 #1]  INFO -- : > mkdir -p /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-09-07T19:05:39.604778 #1]  INFO -- :
I, [2023-09-07T19:05:39.605151 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-09-07T19:05:39.607750 #1]  INFO -- :
I, [2023-09-07T19:05:39.613106 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown:
I, [2023-09-07T19:05:39.618365 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown:
I, [2023-09-07T19:05:39.623595 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown:
I, [2023-09-07T19:05:39.628801 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown:
I, [2023-09-07T19:05:39.629386 #1]  INFO -- : > chown -R root /var/lib/postgresql/13/main
I, [2023-09-07T19:05:51.547791 #1]  INFO -- :
I, [2023-09-07T19:05:51.547992 #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, [2023-09-07T19:05:51.550976 #1]  INFO -- :
I, [2023-09-07T19:05:51.551040 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2023-09-07T19:05:51.574401 #1]  INFO -- :
I, [2023-09-07T19:05:51.574884 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2023-09-07T19:05:51.577101 #1]  INFO -- :
I, [2023-09-07T19:05:51.577390 #1]  INFO -- : > /root/upgrade_postgres
I, [2023-09-07T19:05:51.582588 #1]  INFO -- :
I, [2023-09-07T19:05:51.582869 #1]  INFO -- : > rm /root/upgrade_postgres
I, [2023-09-07T19:05:51.585251 #1]  INFO -- :
I, [2023-09-07T19:05:51.585625 #1]  INFO -- : Replacing data_directory = '/var/lib/postgresql/13/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/13/main/postgresql.conf
I, [2023-09-07T19:05:51.586383 #1]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/13/main/postgresql.conf
I, [2023-09-07T19:05:51.586922 #1]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/13/main/postgresql.conf
I, [2023-09-07T19:05:51.587419 #1]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/13/main/postgresql.conf
I, [2023-09-07T19:05:51.587923 #1]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/13/main/postgresql.conf
I, [2023-09-07T19:05:51.588349 #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, [2023-09-07T19:05:51.588757 #1]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2023-09-07T19:05:51.592069 #1]  INFO -- :
I, [2023-09-07T19:05:51.592629 #1]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/13/main/postgresql.conf
I, [2023-09-07T19:05:51.593240 #1]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/13/main/postgresql.conf
I, [2023-09-07T19:05:51.593749 #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, [2023-09-07T19:05:51.594350 #1]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/13/main/pg_hba.conf
I, [2023-09-07T19:05:51.594976 #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, [2023-09-07T19:05:51.595563 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-09-07T19:05:51.596022 #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, [2023-09-07T19:05:51.597917 #1]  INFO -- : > sleep 5
2023-09-07 19:05:51.726 UTC [43] LOG:  starting PostgreSQL 13.12 (Debian 13.12-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2023-09-07 19:05:51.727 UTC [43] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-09-07 19:05:51.727 UTC [43] LOG:  listening on IPv6 address "::", port 5432
2023-09-07 19:05:51.764 UTC [43] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-09-07 19:05:51.804 UTC [46] LOG:  database system was shut down at 2023-09-07 19:03:24 UTC
2023-09-07 19:05:51.831 UTC [43] LOG:  database system is ready to accept connections
I, [2023-09-07T19:05:56.600801 #1]  INFO -- :
I, [2023-09-07T19:05:56.601207 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
2023-09-07 19:05:56.671 UTC [56] postgres@postgres ERROR:  database "discourse" already exists
2023-09-07 19:05:56.671 UTC [56] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR:  database "discourse" already exists
I, [2023-09-07T19:05:56.675078 #1]  INFO -- :
I, [2023-09-07T19:05:56.675540 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2023-09-07 19:05:56.737 UTC [60] postgres@discourse ERROR:  role "discourse" already exists
2023-09-07 19:05:56.737 UTC [60] postgres@discourse STATEMENT:  create user discourse;
ERROR:  role "discourse" already exists
I, [2023-09-07T19:05:56.739519 #1]  INFO -- :
I, [2023-09-07T19:05:56.739864 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
I, [2023-09-07T19:05:56.797355 #1]  INFO -- : GRANT

I, [2023-09-07T19:05:56.797707 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
I, [2023-09-07T19:05:56.854735 #1]  INFO -- : ALTER SCHEMA

I, [2023-09-07T19:05:56.855095 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
NOTICE:  extension "hstore" already exists, skipping
I, [2023-09-07T19:05:56.920047 #1]  INFO -- : CREATE EXTENSION

I, [2023-09-07T19:05:56.920402 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
NOTICE:  extension "pg_trgm" already exists, skipping
I, [2023-09-07T19:05:56.980436 #1]  INFO -- : CREATE EXTENSION

I, [2023-09-07T19:05:56.980778 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists vector;"'
NOTICE:  extension "vector" already exists, skipping
I, [2023-09-07T19:05:57.035548 #1]  INFO -- : CREATE EXTENSION

I, [2023-09-07T19:05:57.036118 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists hstore;"'
NOTICE:  extension "hstore" already exists, skipping
I, [2023-09-07T19:05:57.090788 #1]  INFO -- : CREATE EXTENSION

I, [2023-09-07T19:05:57.091210 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists pg_trgm;"'
NOTICE:  extension "pg_trgm" already exists, skipping
I, [2023-09-07T19:05:57.147188 #1]  INFO -- : CREATE EXTENSION

I, [2023-09-07T19:05:57.147718 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists vector;"'
NOTICE:  extension "vector" already exists, skipping
I, [2023-09-07T19:05:57.201072 #1]  INFO -- : CREATE EXTENSION

I, [2023-09-07T19:05:57.201528 #1]  INFO -- : > sudo -u postgres psql discourse
I, [2023-09-07T19:05:57.203807 #1]  INFO -- : update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = 'discourse' AND encoding = pg_char_to_encoding('SQL_ASCII');

I, [2023-09-07T19:05:57.266273 #1]  INFO -- : File > /var/lib/postgresql/take-database-backup  chmod: +x  chown: postgres:postgres
I, [2023-09-07T19:05:57.269893 #1]  INFO -- : File > /var/spool/cron/crontabs/postgres  chmod:   chown:
I, [2023-09-07T19:05:57.270088 #1]  INFO -- : > echo postgres installed!
I, [2023-09-07T19:05:57.272715 #1]  INFO -- : postgres installed!

I, [2023-09-07T19:05:57.278180 #1]  INFO -- : File > /etc/service/redis/run  chmod: +x  chown:
I, [2023-09-07T19:05:57.283954 #1]  INFO -- : File > /etc/service/redis/log/run  chmod: +x  chown:
I, [2023-09-07T19:05:57.289501 #1]  INFO -- : File > /etc/runit/3.d/10-redis  chmod: +x  chown:
I, [2023-09-07T19:05:57.290073 #1]  INFO -- : Replacing daemonize yes with  in /etc/redis/redis.conf
I, [2023-09-07T19:05:57.291085 #1]  INFO -- : Replacing (?-mix:^pidfile.*$) with  in /etc/redis/redis.conf
I, [2023-09-07T19:05:57.291770 #1]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2023-09-07T19:05:57.294855 #1]  INFO -- :
I, [2023-09-07T19:05:57.295503 #1]  INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2023-09-07T19:05:57.296367 #1]  INFO -- : Replacing (?-mix:^bind .*$) with  in /etc/redis/redis.conf
I, [2023-09-07T19:05:57.297134 #1]  INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2023-09-07T19:05:57.298031 #1]  INFO -- : Replacing (?-mix:^protected-mode yes) with protected-mode no in /etc/redis/redis.conf
I, [2023-09-07T19:05:57.298889 #1]  INFO -- : Replacing # io-threads 4 with io-threads $redis_io_threads in /etc/redis/redis.conf
I, [2023-09-07T19:05:57.299603 #1]  INFO -- : > echo redis installed
I, [2023-09-07T19:05:57.301889 #1]  INFO -- : redis installed

I, [2023-09-07T19:05:57.302241 #1]  INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2023-09-07T19:05:57.308116 #1]  INFO -- : logfile ""

I, [2023-09-07T19:05:57.308525 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-09-07T19:05:57.310347 #1]  INFO -- : > sleep 10
112:C 07 Sep 2023 19:05:57.318 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
112:C 07 Sep 2023 19:05:57.318 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=112, just started
112:C 07 Sep 2023 19:05:57.318 # Configuration loaded
112:M 07 Sep 2023 19:05:57.319 * monotonic clock: POSIX clock_gettime
112:M 07 Sep 2023 19:05:57.320 * Running mode=standalone, port=6379.
112:M 07 Sep 2023 19:05:57.320 # Server initialized
112:M 07 Sep 2023 19:05:57.320 # 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.
112:M 07 Sep 2023 19:05:57.321 * Loading RDB produced by version 7.0.7
112:M 07 Sep 2023 19:05:57.321 * RDB age 153 seconds
112:M 07 Sep 2023 19:05:57.321 * RDB memory usage when created 3.24 Mb
112:M 07 Sep 2023 19:05:57.331 * Done loading RDB, keys loaded: 994, keys expired: 3.
112:M 07 Sep 2023 19:05:57.331 * DB loaded from disk: 0.010 seconds
112:M 07 Sep 2023 19:05:57.331 * Ready to accept connections
I, [2023-09-07T19:06:07.313079 #1]  INFO -- :
I, [2023-09-07T19:06:07.313933 #1]  INFO -- : > thpoff echo "thpoff is installed!"
I, [2023-09-07T19:06:07.318893 #1]  INFO -- : thpoff is installed!

I, [2023-09-07T19:06:07.319294 #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, [2023-09-07T19:06:07.412973 #1]  INFO -- :
I, [2023-09-07T19:06:07.413543 #1]  INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
I, [2023-09-07T19:06:07.494218 #1]  INFO -- :
I, [2023-09-07T19:06:07.494891 #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, [2023-09-07T19:06:07.576386 #1]  INFO -- :
I, [2023-09-07T19:06:07.576902 #1]  INFO -- : > rm -f /etc/cron.d/anacron
I, [2023-09-07T19:06:07.580291 #1]  INFO -- :
I, [2023-09-07T19:06:07.583896 #1]  INFO -- : File > /etc/cron.d/anacron  chmod:   chown:
I, [2023-09-07T19:06:07.589754 #1]  INFO -- : File > /etc/runit/1.d/copy-env  chmod: +x  chown:
I, [2023-09-07T19:06:07.595777 #1]  INFO -- : File > /etc/service/unicorn/run  chmod: +x  chown:
I, [2023-09-07T19:06:07.601443 #1]  INFO -- : File > /etc/service/nginx/run  chmod: +x  chown:
I, [2023-09-07T19:06:07.607297 #1]  INFO -- : File > /etc/runit/3.d/01-nginx  chmod: +x  chown:
I, [2023-09-07T19:06:07.613140 #1]  INFO -- : File > /etc/runit/3.d/02-unicorn  chmod: +x  chown:
I, [2023-09-07T19:06:07.613601 #1]  INFO -- : Replacing # postgres with sv start postgres || exit 1 in /etc/service/unicorn/run
I, [2023-09-07T19:06:07.614110 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-09-07T19:06:07.616883 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git reset --hard
139:C 07 Sep 2023 19:06:07.623 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
139:C 07 Sep 2023 19:06:07.623 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=139, just started
139:C 07 Sep 2023 19:06:07.624 # Configuration loaded
139:M 07 Sep 2023 19:06:07.624 * monotonic clock: POSIX clock_gettime
139:M 07 Sep 2023 19:06:07.625 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
139:M 07 Sep 2023 19:06:07.625 # Failed listening on port 6379 (TCP), aborting.
Updating files: 100% (33693/33693), done.
I, [2023-09-07T19:06:12.743859 #1]  INFO -- : HEAD is now at 058c8496f DEV: Convert explain-reviewable modal to component-based API (#23274)

I, [2023-09-07T19:06:12.744529 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
I, [2023-09-07T19:06:12.910825 #1]  INFO -- :
I, [2023-09-07T19:06:12.911177 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  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 --tags --prune-tags --prune --force origin
  fi
'
fatal: unable to access 'https://github.com/discourse/discourse.git/': gnutls_handshake() failed: Error in the pull function.
I, [2023-09-07T19:09:14.371593 #1]  INFO -- :
I, [2023-09-07T19:09:14.372884 #1]  INFO -- : Terminating async processes
I, [2023-09-07T19:09:14.373150 #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: 43
I, [2023-09-07T19:09:14.373468 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 112
2023-09-07 19:09:14.373 UTC [43] LOG:  received fast shutdown request
112:signal-handler (1694113754) Received SIGTERM scheduling shutdown...
2023-09-07 19:09:14.390 UTC [43] LOG:  aborting any active transactions
2023-09-07 19:09:14.393 UTC [43] LOG:  background worker "logical replication launcher" (PID 52) exited with exit code 1
2023-09-07 19:09:14.396 UTC [47] LOG:  shutting down
112:M 07 Sep 2023 19:09:14.452 # User requested shutdown...
112:M 07 Sep 2023 19:09:14.453 * Saving the final RDB snapshot before exiting.
112:M 07 Sep 2023 19:09:14.515 * DB saved on disk
112:M 07 Sep 2023 19:09:14.516 # Redis is now ready to exit, bye bye...
2023-09-07 19:09:14.616 UTC [43] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  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 --tags --prune-tags --prune --force origin
  fi
' failed with return #<Process::Status: pid 148 exit 128>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd"=>["sudo -H -E -u discourse git reset --hard", "sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [ $(git rev-parse --is-shallow-repository) == \"true\" ]; then\n      git remote set-branches --add origin main\n      git remote set-branches origin $version\n      git fetch --depth 1 origin $version\n  else\n      git fetch --tags --prune-tags --prune --force origin\n  fi\n'", "sudo -H -E -u discourse bash -c '\n  set -o errexit\n  if [[ $(git symbolic-ref --short HEAD) == $version ]] ; then\n      git pull\n  else\n      git -c advice.detachedHead=false checkout $version\n  fi\n'", "sudo -H -E -u discourse git config user.discourse-version $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p                    /shared/log/rails", "bash -c \"touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\"", "bash -c \"ln    -s           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\"", "bash -c \"mkdir -p           /shared/{uploads,backups}\"", "bash -c \"ln    -s           /shared/{uploads,backups} $home/public\"", "bash -c \"mkdir -p           /shared/tmp/{backups,restores}\"", "bash -c \"ln    -s           /shared/tmp/{backups,restores} $home/tmp\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp", "[ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete"]}
bootstrap failed with exit code 128
** 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.
a61e67a30aa73d8bcb06e3ea6412efc9fc272237ab7fcf5961611ea67b52bd85
==================== END REBUILD LOG ====================
Failed to rebuild app.

Checking your domain name . . .

Connection to www.DOMAINNAME.cn succeeded.
You should probably remove any non-standard plugins and rebuild.
Attempting to restart existing container. . .
x86_64 arch detected.

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: driver failed programming external connectivity on endpoint app (fe208459e298fd974fe776881cef7c3016d3a417a0762c7dbfe0fbef8b34ab45): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use
Error: failed to start containers: app
Failed to restart the container.


==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git

No non-official plugins detected.

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

========================================
Discourse version at www.DOMAINNAME.cn: NOT FOUND
Discourse version at localhost: NOT FOUND


==================== MEMORY INFORMATION ====================
OS: Linux
RAM (MB): 4101

               total        used        free      shared  buff/cache   available
Mem:            3911         310        1611           1        1989        3309
Swap:            979           1         978

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem                      Size  Used Avail Use% Mounted on
/dev/mapper/ec2--user--vg-root   19G  8.5G  9.2G  48% /
/dev/vdc1                       188G   33G  147G  19% /var/lib/docker

==================== DISK INFORMATION ====================
Disk /dev/loop0: 55.66 MiB, 58368000 bytes, 114000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 55.66 MiB, 58363904 bytes, 113992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 63.45 MiB, 66531328 bytes, 129944 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 63.46 MiB, 66547712 bytes, 129976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 91.81 MiB, 96272384 bytes, 188032 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 91.83 MiB, 96292864 bytes, 188072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 40.84 MiB, 42827776 bytes, 83648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 53.26 MiB, 55844864 bytes, 109072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x39636247

Device     Boot Start      End  Sectors Size Id Type
/dev/vda1  *     2048 41940991 41938944  20G 8e Linux LVM


Disk /dev/vdb: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000


Disk /dev/vdc: 192 GiB, 206158430208 bytes, 402653184 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0aeef702

Device     Boot Start       End   Sectors  Size Id Type
/dev/vdc1        2048 402653183 402651136  192G 83 Linux


Disk /dev/mapper/ec2--user--vg-root: 19.04 GiB, 20443037696 bytes, 39927808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ec2--user--vg-swap_1: 980 MiB, 1027604480 bytes, 2007040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Mail test skipped.

==================== DONE! ====================

The :magic_wand: Related topics section below this topic first link is to Upgrade from within China fails due to git issues - #20 by Hyan which contains some instructions.

The gnutls_handshake() is a generic “bad internet connection” problem that can be triggered by things ranging from missing network card drivers to state level MITM interference with your connection.

4 Likes