我无法启动 Discourse

 failed with return #<Process::Status: pid 147 exit 128>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132: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.
a3cbcdb4f69959188529ca50ea2c2c507929ee0eb917fabc18102efd9a16862f
root@37:/home/discourse# 

执行失败,返回 #<Process::Status: pid 147 exit 128>
失败位置:/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn’
执行失败,参数为 {“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”]}
引导失败,退出代码 128
** 引导失败 ** 请向上滚动查找之前的错误消息,可能不止一个。
./discourse-doctor 可能有助于诊断问题。
a3cbcdb4f69959188529ca50ea2c2c507929ee0eb917fabc18102efd9a16862f
root@37:/home/discourse#

我将从这里开始;如果您能检索到,请发布完整的日志以便我们审查。

root@37:/home/discourse# ./launcher start app
检测到 x86_64 架构。

正在启动现有容器
+ /usr/bin/docker start app
app
root@37:/home/discourse# ./launcher rebuild app
检测到 x86_64 架构。
确保 launcher 为最新版本
正在获取 origin
Launcher 已是最新版本
正在停止旧容器
+ /usr/bin/docker stop -t 600 app
app
2.0.20231023-1945: 正在从 discourse/base 拉取
摘要:sha256:2b0eb484d20888cc2daadb690dcfa73522105650c1420212e99345a36a424d77
状态:discourse/base:2.0.20231023-1945 镜像已是最新
docker.io/discourse/base:2.0.20231023-1945
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2023-12-07T21:27:52.867393 #1]  INFO -- : 正在从 stdin 读取
I, [2023-12-07T21:27:52.888810 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2023-12-07T21:27:53.052110 #1]  INFO -- : 正在生成语言环境(这可能需要一些时间)...
生成完成。

I, [2023-12-07T21:27:53.053307 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2023-12-07T21:27:53.068794 #1]  INFO -- : 
I, [2023-12-07T21:27:53.070818 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2023-12-07T21:27:53.087442 #1]  INFO -- : 
I, [2023-12-07T21:27:53.088730 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2023-12-07T21:27:53.100734 #1]  INFO -- : 
I, [2023-12-07T21:27:53.101630 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2023-12-07T21:27:53.111689 #1]  INFO -- : 
I, [2023-12-07T21:27:53.112786 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2023-12-07T21:27:53.129240 #1]  INFO -- : 
I, [2023-12-07T21:27:53.130816 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2023/12/07 21:27:53 socat[19] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): 没有那个文件或目录
I, [2023-12-07T21:27:53.171995 #1]  INFO -- : 
I, [2023-12-07T21:27:53.172733 #1]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2023-12-07T21:27:53.187307 #1]  INFO -- : 
I, [2023-12-07T21:27:53.188651 #1]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2023-12-07T21:27:53.200917 #1]  INFO -- : 
I, [2023-12-07T21:27:53.201966 #1]  INFO -- : > mkdir -p /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-12-07T21:27:53.213670 #1]  INFO -- : 
I, [2023-12-07T21:27:53.214910 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-12-07T21:27:53.227265 #1]  INFO -- : 
I, [2023-12-07T21:27:53.254417 #1]  INFO -- : 文件 > /etc/service/postgres/run  chmod: +x  chown: 
I, [2023-12-07T21:27:53.278747 #1]  INFO -- : 文件 > /etc/service/postgres/log/run  chmod: +x  chown: 
I, [2023-12-07T21:27:53.305447 #1]  INFO -- : 文件 > /etc/runit/3.d/99-postgres  chmod: +x  chown: 
I, [2023-12-07T21:27:53.330755 #1]  INFO -- : 文件 > /root/upgrade_postgres  chmod: +x  chown: 
I, [2023-12-07T21:27:53.331959 #1]  INFO -- : > chown -R root /var/lib/postgresql/13/main
I, [2023-12-07T21:27:55.522162 #1]  INFO -- : 
I, [2023-12-07T21:27:55.523699 #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-12-07T21:27:55.534722 #1]  INFO -- : 
I, [2023-12-07T21:27:55.534966 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2023-12-07T21:27:55.748127 #1]  INFO -- : 
I, [2023-12-07T21:27:55.749312 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2023-12-07T21:27:55.762117 #1]  INFO -- : 
I, [2023-12-07T21:27:55.763943 #1]  INFO -- : > /root/upgrade_postgres
I, [2023-12-07T21:27:55.790468 #1]  INFO -- : 
I, [2023-12-07T21:27:55.791704 #1]  INFO -- : > rm /root/upgrade_postgres
I, [2023-12-07T21:27:55.802614 #1]  INFO -- : 
I, [2023-12-07T21:27:55.803939 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 data_directory = '/var/lib/postgresql/13/main' 为 data_directory = '/shared/postgres_data'
I, [2023-12-07T21:27:55.806088 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?listen_addresses *=.*) 为 listen_addresses = '*'
I, [2023-12-07T21:27:55.807166 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?synchronous_commit *=.*) 为 synchronous_commit = $db_synchronous_commit
I, [2023-12-07T21:27:55.808275 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?shared_buffers *=.*) 为 shared_buffers = $db_shared_buffers
I, [2023-12-07T21:27:55.809777 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?work_mem *=.*) 为 work_mem = $db_work_mem
I, [2023-12-07T21:27:55.811055 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?default_text_search_config *=.*) 为 default_text_search_config = '$db_default_text_search_config'
I, [2023-12-07T21:27:55.812350 #1]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2023-12-07T21:27:55.832907 #1]  INFO -- : 
I, [2023-12-07T21:27:55.834231 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?checkpoint_segments *=.*) 为 checkpoint_segments = $db_checkpoint_segments
I, [2023-12-07T21:27:55.836692 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?logging_collector *=.*) 为 logging_collector = $db_logging_collector
I, [2023-12-07T21:27:55.838620 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/postgresql.conf 中的 (?-mix:#?log_min_duration_statement *=.*) 为 log_min_duration_statement = $db_log_min_duration_statement
I, [2023-12-07T21:27:55.840740 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/pg_hba.conf 中的 (?-mix:^#local +replication +postgres +peer$) 为 local replication postgres  peer
I, [2023-12-07T21:27:55.842479 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/pg_hba.conf 中的 (?-mix:^host.*all.*all.*127.*$) 为 host all all 0.0.0.0/0 md5
I, [2023-12-07T21:27:55.844302 #1]  INFO -- : 正在替换 /etc/postgresql/13/main/pg_hba.conf 中的 (?-mix:^host.*all.*all.*::1\/128.*$) 为 host all all ::/0 md5
I, [2023-12-07T21:27:55.845600 #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-12-07T21:27:55.856257 #1]  INFO -- : > sleep 5
2023-12-07 21:27:56.035 UTC [42] LOG:  正在启动 PostgreSQL 13.12 (Debian 13.12-1.pgdg110+1),架构为 x86_64-pc-linux-gnu,由 gcc (Debian 10.2.1-6) 10.2.1 20210110 编译,64 位
2023-12-07 21:27:56.036 UTC [42] LOG:  正在监听 IPv4 地址 "0.0.0.0",端口 5432
2023-12-07 21:27:56.036 UTC [42] LOG:  正在监听 IPv6 地址 "::",端口 5432
2023-12-07 21:27:56.042 UTC [42] LOG:  正在监听 Unix 套接字 "/var/run/postgresql/.s.PGSQL.5432"
2023-12-07 21:27:56.072 UTC [45] LOG:  数据库系统在 2023-12-07 21:27:34 UTC 已关闭
2023-12-07 21:27:56.094 UTC [42] LOG:  数据库系统已准备好接受连接
I, [2023-12-07T21:28:00.869339 #1]  INFO -- : 
I, [2023-12-07T21:28:00.870667 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
2023-12-07 21:28:01.164 UTC [55] postgres@postgres ERROR:  数据库 "discourse" 已存在
2023-12-07 21:28:01.164 UTC [55] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: 错误:数据库创建失败:ERROR:  数据库 "discourse" 已存在
I, [2023-12-07T21:28:01.171789 #1]  INFO -- : 
I, [2023-12-07T21:28:01.173658 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2023-12-07 21:28:01.409 UTC [59] postgres@discourse ERROR:  角色 "discourse" 已存在
2023-12-07 21:28:01.409 UTC [59] postgres@discourse STATEMENT:  create user discourse;
ERROR:  角色 "discourse" 已存在
I, [2023-12-07T21:28:01.421089 #1]  INFO -- : 
I, [2023-12-07T21:28:01.422390 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
I, [2023-12-07T21:28:01.652351 #1]  INFO -- : GRANT

I, [2023-12-07T21:28:01.653224 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
I, [2023-12-07T21:28:01.848464 #1]  INFO -- : ALTER SCHEMA

I, [2023-12-07T21:28:01.849319 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
NOTICE:  扩展 "hstore" 已存在,跳过
I, [2023-12-07T21:28:02.020169 #1]  INFO -- : CREATE EXTENSION

I, [2023-12-07T21:28:02.021062 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
NOTICE:  扩展 "pg_trgm" 已存在,跳过
I, [2023-12-07T21:28:02.199327 #1]  INFO -- : CREATE EXTENSION

I, [2023-12-07T21:28:02.200424 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists vector;"'
NOTICE:  扩展 "vector" 已存在,跳过
I, [2023-12-07T21:28:02.392996 #1]  INFO -- : CREATE EXTENSION

I, [2023-12-07T21:28:02.394344 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists hstore;"'
NOTICE:  扩展 "hstore" 已存在,跳过
I, [2023-12-07T21:28:02.575096 #1]  INFO -- : CREATE EXTENSION

I, [2023-12-07T21:28:02.576400 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists pg_trgm;"'
NOTICE:  扩展 "pg_trgm" 已存在,跳过
I, [2023-12-07T21:28:02.725992 #1]  INFO -- : CREATE EXTENSION

I, [2023-12-07T21:28:02.726638 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists vector;"'
NOTICE:  扩展 "vector" 已存在,跳过
I, [2023-12-07T21:28:02.908238 #1]  INFO -- : CREATE EXTENSION

I, [2023-12-07T21:28:02.909565 #1]  INFO -- : > sudo -u postgres psql discourse
I, [2023-12-07T21:28:02.921548 #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-12-07T21:28:03.146861 #1]  INFO -- : 文件 > /var/lib/postgresql/take-database-backup  chmod: +x  chown: postgres:postgres
I, [2023-12-07T21:28:03.165891 #1]  INFO -- : 文件 > /var/spool/cron/crontabs/postgres  chmod:   chown: 
I, [2023-12-07T21:28:03.166367 #1]  INFO -- : > echo postgres installed!
I, [2023-12-07T21:28:03.182267 #1]  INFO -- : postgres 已安装!

I, [2023-12-07T21:28:03.213062 #1]  INFO -- : 文件 > /etc/service/redis/run  chmod: +x  chown: 
I, [2023-12-07T21:28:03.244974 #1]  INFO -- : 文件 > /etc/service/redis/log/run  chmod: +x  chown: 
I, [2023-12-07T21:28:03.266706 #1]  INFO -- : 文件 > /etc/runit/3.d/10-redis  chmod: +x  chown: 
I, [2023-12-07T21:28:03.268509 #1]  INFO -- : 正在替换 /etc/redis/redis.conf 中的 daemonize yes 为
I, [2023-12-07T21:28:03.271386 #1]  INFO -- : 正在替换 /etc/redis/redis.conf 中的 (?-mix:^pidfile.*$) 为
I, [2023-12-07T21:28:03.273731 #1]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2023-12-07T21:28:03.288445 #1]  INFO -- : 
I, [2023-12-07T21:28:03.290198 #1]  INFO -- : 正在替换 /etc/redis/redis.conf 中的 (?-mix:^logfile.*$) 为 logfile ""
I, [2023-12-07T21:28:03.292337 #1]  INFO -- : 正在替换 /etc/redis/redis.conf 中的 (?-mix:^bind .*$) 为
I, [2023-12-07T21:28:03.293786 #1]  INFO -- : 正在替换 /etc/redis/redis.conf 中的 (?-mix:^dir .*$) 为 dir /shared/redis_data
I, [2023-12-07T21:28:03.295696 #1]  INFO -- : 正在替换 /etc/redis/redis.conf 中的 (?-mix:^protected-mode yes) 为 protected-mode no
I, [2023-12-07T21:28:03.297288 #1]  INFO -- : 正在替换 /etc/redis/redis.conf 中的 # io-threads 4 为 io-threads $redis_io_threads
I, [2023-12-07T21:28:03.298621 #1]  INFO -- : > echo redis installed
I, [2023-12-07T21:28:03.307352 #1]  INFO -- : redis 已安装

I, [2023-12-07T21:28:03.308311 #1]  INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2023-12-07T21:28:03.327848 #1]  INFO -- : logfile ""

I, [2023-12-07T21:28:03.328908 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-12-07T21:28:03.340064 #1]  INFO -- : > sleep 10
111:C 07 Dec 2023 21:28:03.363 # oO0OoO0OoO0Oo Redis 正在启动 oO0OoO0OoO0Oo
111:C 07 Dec 2023 21:28:03.363 # Redis 版本=7.0.7,位数=64,提交=00000000,已修改=0,进程 ID=111,刚刚启动
111:C 07 Dec 2023 21:28:03.363 # 配置已加载
111:M 07 Dec 2023 21:28:03.366 * 单调时钟:POSIX clock_gettime
111:M 07 Dec 2023 21:28:03.369 * 运行模式=独立,端口=6379。
111:M 07 Dec 2023 21:28:03.369 # 服务器已初始化
111:M 07 Dec 2023 21:28:03.369 # 警告:必须启用内存过度提交!如果不启用,在低内存条件下后台保存或复制可能会失败。如果禁用,即使没有低内存条件也可能导致失败,详见 https://github.com/jemalloc/jemalloc/issues/1328。要修复此问题,请将 'vm.overcommit_memory = 1' 添加到 /etc/sysctl.conf 并重启,或运行命令 'sysctl vm.overcommit_memory=1' 使其生效。
111:M 07 Dec 2023 21:28:03.371 * 正在加载由版本 7.0.7 生成的 RDB
111:M 07 Dec 2023 21:28:03.371 * RDB 年龄 31 秒
111:M 07 Dec 2023 21:28:03.371 * 创建时 RDB 内存使用量为 2.62 Mb
111:M 07 Dec 2023 21:28:03.382 * RDB 加载完成,已加载键:319,已过期键:0。
111:M 07 Dec 2023 21:28:03.382 * 从磁盘加载数据库耗时:0.012 秒
111:M 07 Dec 2023 21:28:03.382 * 已准备好接受连接
I, [2023-12-07T21:28:13.354480 #1]  INFO -- : 
I, [2023-12-07T21:28:13.355715 #1]  INFO -- : > thpoff echo "thpoff is installed!"
I, [2023-12-07T21:28:13.375845 #1]  INFO -- : thpoff 已安装!

I, [2023-12-07T21:28:13.377559 #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-12-07T21:28:13.652534 #1]  INFO -- : 
I, [2023-12-07T21:28:13.653251 #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-12-07T21:28:13.886027 #1]  INFO -- : 
I, [2023-12-07T21:28:13.887325 #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-12-07T21:28:14.154099 #1]  INFO -- : 
I, [2023-12-07T21:28:14.154919 #1]  INFO -- : > rm -f /etc/cron.d/anacron
I, [2023-12-07T21:28:14.165050 #1]  INFO -- : 
I, [2023-12-07T21:28:14.178331 #1]  INFO -- : 文件 > /etc/cron.d/anacron  chmod:   chown: 
I, [2023-12-07T21:28:14.203523 #1]  INFO -- : 文件 > /etc/runit/1.d/copy-env  chmod: +x  chown: 
I, [2023-12-07T21:28:14.231014 #1]  INFO -- : 文件 > /etc/service/unicorn/run  chmod: +x  chown: 
I, [2023-12-07T21:28:14.256600 #1]  INFO -- : 文件 > /etc/service/nginx/run  chmod: +x  chown: 
I, [2023-12-07T21:28:14.285982 #1]  INFO -- : 文件 > /etc/runit/3.d/01-nginx  chmod: +x  chown: 
I, [2023-12-07T21:28:14.314320 #1]  INFO -- : 文件 > /etc/runit/3.d/02-unicorn  chmod: +x  chown: 
I, [2023-12-07T21:28:14.315225 #1]  INFO -- : 正在替换 /etc/service/unicorn/run 中的 # postgres 为 sv start postgres || exit 1
I, [2023-12-07T21:28:14.316771 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-12-07T21:28:14.331121 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git reset --hard
138:C 07 Dec 2023 21:28:14.347 # oO0OoO0OoO0Oo Redis 正在启动 oO0OoO0OoO0Oo
138:C 07 Dec 2023 21:28:14.348 # Redis 版本=7.0.7,位数=64,提交=00000000,已修改=0,进程 ID=138,刚刚启动
138:C 07 Dec 2023 21:28:14.348 # 配置已加载
138:M 07 Dec 2023 21:28:14.349 * 单调时钟:POSIX clock_gettime
138:M 07 Dec 2023 21:28:14.350 # 警告:无法创建服务器 TCP 监听套接字 *:6379: bind: 地址已在使用
138:M 07 Dec 2023 21:28:14.350 # 无法监听端口 6379 (TCP),正在中止。
正在更新文件:100% (33858/33858),完成。
I, [2023-12-07T21:28:29.489189 #1]  INFO -- : HEAD 现在位于 043b4a418 FIX: 用 <DTooltip /> 替换 data-tooltip 用法 (#24062)

I, [2023-12-07T21:28:29.489710 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
I, [2023-12-07T21:28:30.370415 #1]  INFO -- : 
I, [2023-12-07T21:28:30.370684 #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: 无法访问 'https://github.com/discourse/discourse.git/':无法解析主机 github.com
I, [2023-12-07T21:28:42.767417 #1]  INFO -- : 
I, [2023-12-07T21:28:42.769055 #1]  INFO -- : 正在终止异步进程
I, [2023-12-07T21:28:42.769372 #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 进程 ID: 42 发送 INT
I, [2023-12-07T21:28:42.769482 #1]  INFO -- : 正在向 exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf 进程 ID: 111 发送 TERM
2023-12-07 21:28:42.769 UTC [42] LOG:  收到快速关闭请求
111:signal-handler (1701984522) 收到 SIGTERM,正在计划关闭...
2023-12-07 21:28:42.771 UTC [42] LOG:  正在中止任何活动事务
2023-12-07 21:28:42.779 UTC [42] LOG:  后台工作进程 "logical replication launcher" (进程 ID 51) 以退出代码 1 退出
111:M 07 Dec 2023 21:28:42.782 # 用户请求关闭...
111:M 07 Dec 2023 21:28:42.782 * 正在保存退出前的最终 RDB 快照
2023-12-07 21:28:42.785 UTC [46] LOG:  正在关闭
111:M 07 Dec 2023 21:28:42.811 * 数据库已保存到磁盘
111:M 07 Dec 2023 21:28:42.811 # Redis 现在已准备好退出,再见...
2023-12-07 21:28:42.853 UTC [42] LOG:  数据库系统已关闭


失败
--------------------
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
' 执行失败,返回 #<Process::Status: pid 147 exit 128>
失败位置:/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
执行失败,参数为 {"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"]}
引导失败,退出代码 128
** 引导失败 ** 请向上滚动查看更早的错误消息,可能不止一条。
./discourse-doctor 可能有助于诊断问题。
a3cbcdb4f69959188529ca50ea2c2c507929ee0eb917fabc18102efd9a16862f
root@37:/home/discourse# 

看起来你的 Docker 网络已损坏;你需要修复它。

我该如何修复?

从基础开始:

  • 容器内的网络是否正常工作?
  • 容器是否使用了正确的 DNS 服务器?
  • 如果网络工作正常,容器是否可以与 DNS 服务器通信?

我问了很多问题,但如何查看它们?

root@37:/home/discourse# ./discourse-setup
配置文件 containers/app.yml 已存在!

. . . 重新配置 . . .


将旧文件保存为 app.yml.2023-12-07-220015.bak
5 秒后停止现有容器,或按 Control-C 取消。
检测到 x86_64 架构。
+ /usr/bin/docker stop -t 600 app
app

检测到 2GB 内存和 4 个物理 CPU 核心
设置 db_shared_buffers = 256MB
设置 UNICORN_WORKERS = 4
containers/app.yml 内存参数已更新。

您的 Discourse 主机名? [kisacabilgi.net]: 

正在检查您的域名 . . .
警告:似乎无法通过主机名 kisacabilgi.net 访问计算机的 443 端口。
警告:连接到 http://kisacabilgi.net (端口 80) 也失败。

这表明 kisacabilgi.net 解析到的 IP 地址未到达您安装 discourse 的此计算机。

首先要做的是确认 kisacabilgi.net 解析到此服务器的 IP 地址。
您通常在购买域名的同一地点进行此操作。

如果您确定 IP 地址解析正确,则可能是防火墙问题。
搜索“打开端口 YOUR CLOUD SERVICE”可能会有帮助。

此工具仅用于最标准的安装。如果您无法解决上述问题,
则需要自己编辑 containers/app.yml,然后输入

顺便说一句,当我尝试重新调整文件时,我收到了这个错误。

您已经有一个正在运行的 Discourse 实例,并且正在尝试设置一个新的实例。
如果您更改了 containers/app.yml,则需要使用以下命令重建容器:./launcher rebuild app

这次我遇到了初始错误。

我真的很需要帮助,我的服务器不知何故出了问题,已经宕机超过 24 小时了。很快我所有的努力都将付诸东流,我不知道如何自己修复它。

在 Discourse 运行的服务器上,你能 ping github.com 吗?

root@37:~# ping github.com
PING github.com (140.82.121.4) 56(84) 字节数据。
64 字节来自 lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=1 ttl=52 time=37.7 毫秒
64 字节来自 lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=2 ttl=52 time=37.7 毫秒
64 字节来自 lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=3 ttl=52 time=38.9 毫秒

没有人帮忙吗?

您在回复 #8 中将此主题标记为已解决。

如果问题相同,我们可以取消已解决状态,但如果不同,请考虑另开新帖以避免混淆。

如果您仍然有一个可用的构建,能否启动它[1],进入它[2],然后尝试从那里 ping github?


  1. ./launcher start app ↩︎

  2. ./launcher enter app ↩︎

root@37-app:/var/www/discourse# ping github.com
bash: ping: command not found

试试 curl:

curl github.com -v
root@37-app:/var/www/discourse# curl github.com -v
* Could not resolve host: github.com
* Closing connection 0
curl: (6) Could not resolve host: github.com
root@37-app:/var/www/discourse# 

请重复一遍,但不要说谷歌。