特定提交哈希的构建失败

我需要根据特定提交 “dc5b37c01131bfc42eb666ec2bc779433df309cb” 构建 Discourse,但失败了。

# ./launcher rebuild app
设备 "docker0" 不存在。
检测到 x86_64 架构。
警告:containers/app.yml 文件对所有用户可读。您可以通过运行以下命令来保护该文件:chmod o-rwx containers/app.yml
确保启动器是最新的
启动器已是最新
正在停止旧容器
+ /usr/bin/docker stop -t 60 app
app
2.0.20230313-1023: 正在从 discourse/base 拉取
摘要:sha256:f7467469ab9e39c3548d4478e3f416c05b34a0ee58eb6e40b963e562005669cc
状态: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, [2023-04-05T15:11:07.535403 #1]  INFO -- : 正在从 stdin 读取
I, [2023-04-05T15:11:07.537775 #1]  INFO -- : > locale-gen $LANG && update-locale
I, [2023-04-05T15:11:07.572821 #1]  INFO -- : 正在生成语言环境(这可能需要一段时间)...
生成完成。

I, [2023-04-05T15:11:07.572972 #1]  INFO -- : > mkdir -p /shared/postgres_run
I, [2023-04-05T15:11:07.574699 #1]  INFO -- : 
I, [2023-04-05T15:11:07.574816 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run
I, [2023-04-05T15:11:07.576296 #1]  INFO -- : 
I, [2023-04-05T15:11:07.576405 #1]  INFO -- : > chmod 775 /shared/postgres_run
I, [2023-04-05T15:11:07.577600 #1]  INFO -- : 
I, [2023-04-05T15:11:07.577742 #1]  INFO -- : > rm -fr /var/run/postgresql
I, [2023-04-05T15:11:07.579598 #1]  INFO -- : 
I, [2023-04-05T15:11:07.579717 #1]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
I, [2023-04-05T15:11:07.581535 #1]  INFO -- : 
I, [2023-04-05T15:11:07.581607 #1]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
2023/04/05 15:11:07 socat[19] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): 没有那个文件或目录
I, [2023-04-05T15:11:07.599263 #1]  INFO -- : 
I, [2023-04-05T15:11:07.599391 #1]  INFO -- : > rm -fr /shared/postgres_run/.s*
I, [2023-04-05T15:11:07.601296 #1]  INFO -- : 
I, [2023-04-05T15:11:07.601464 #1]  INFO -- : > rm -fr /shared/postgres_run/*.pid
I, [2023-04-05T15:11:07.603233 #1]  INFO -- : 
I, [2023-04-05T15:11:07.603317 #1]  INFO -- : > mkdir -p /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-04-05T15:11:07.604655 #1]  INFO -- : 
I, [2023-04-05T15:11:07.604738 #1]  INFO -- : > chown postgres:postgres /shared/postgres_run/13-main.pg_stat_tmp
I, [2023-04-05T15:11:07.606021 #1]  INFO -- : 
I, [2023-04-05T15:11:07.608870 #1]  INFO -- : 文件 > /etc/service/postgres/run  chmod: +x  chown: 
I, [2023-04-05T15:11:07.611356 #1]  INFO -- : 文件 > /etc/service/postgres/log/run  chmod: +x  chown: 
I, [2023-04-05T15:11:07.614115 #1]  INFO -- : 文件 > /etc/runit/3.d/99-postgres  chmod: +x  chown: 
I, [2023-04-05T15:11:07.616574 #1]  INFO -- : 文件 > /root/upgrade_postgres  chmod: +x  chown: 
I, [2023-04-05T15:11:07.616711 #1]  INFO -- : > chown -R root /var/lib/postgresql/13/main
I, [2023-04-05T15:11:08.725425 #1]  INFO -- : 
I, [2023-04-05T15:11:08.725588 #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-04-05T15:11:08.727170 #1]  INFO -- : 
I, [2023-04-05T15:11:08.727201 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2023-04-05T15:11:08.738009 #1]  INFO -- : 
I, [2023-04-05T15:11:08.738126 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2023-04-05T15:11:08.739967 #1]  INFO -- : 
I, [2023-04-05T15:11:08.740125 #1]  INFO -- : > /root/upgrade_postgres
I, [2023-04-05T15:11:08.743817 #1]  INFO -- : 
I, [2023-04-05T15:11:08.743941 #1]  INFO -- : > rm /root/upgrade_postgres
I, [2023-04-05T15:11:08.745191 #1]  INFO -- : 
I, [2023-04-05T15:11:08.746217 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 data_directory = '/var/lib/postgresql/13/main' 替换为 data_directory = '/shared/postgres_data'
I, [2023-04-05T15:11:08.746641 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?listen_addresses *=.*) 替换为 listen_addresses = '*'
I, [2023-04-05T15:11:08.747008 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?synchronous_commit *=.*) 替换为 synchronous_commit = $db_synchronous_commit
I, [2023-04-05T15:11:08.747165 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?shared_buffers *=.*) 替换为 shared_buffers = $db_shared_buffers
I, [2023-04-05T15:11:08.747294 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?work_mem *=.*) 替换为 work_mem = $db_work_mem
I, [2023-04-05T15:11:08.747425 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?default_text_search_config *=.*) 替换为 default_text_search_config = '$db_default_text_search_config'
I, [2023-04-05T15:11:08.747548 #1]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2023-04-05T15:11:08.750851 #1]  INFO -- : 
I, [2023-04-05T15:11:08.751034 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?checkpoint_segments *=.*) 替换为 checkpoint_segments = $db_checkpoint_segments
I, [2023-04-05T15:11:08.751277 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?logging_collector *=.*) 替换为 logging_collector = $db_logging_collector
I, [2023-04-05T15:11:08.751672 #1]  INFO -- : 在 /etc/postgresql/13/main/postgresql.conf 中将 (?-mix:#?log_min_duration_statement *=.*) 替换为 log_min_duration_statement = $db_log_min_duration_statement
I, [2023-04-05T15:11:08.752098 #1]  INFO -- : 在 /etc/postgresql/13/main/pg_hba.conf 中将 (?-mix:^#local +replication +postgres +peer$) 替换为 local replication postgres  peer
I, [2023-04-05T15:11:08.752249 #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-04-05T15:11:08.752356 #1]  INFO -- : 在 /etc/postgresql/13/main/pg_hba.conf 中将 (?-mix:^host.*all.*all.*::1\/128.*$) 替换为 host all all ::/0 md5
I, [2023-04-05T15:11:08.752459 #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-04-05T15:11:08.753675 #1]  INFO -- : > sleep 5
2023-04-05 15:11:08.866 UTC [42] LOG:  正在启动 PostgreSQL 13.10 (Debian 13.10-1.pgdg110+1),运行在 x86_64-pc-linux-gnu 上,由 gcc (Debian 10.2.1-6) 10.2.1 20210110 编译,64 位
2023-04-05 15:11:08.866 UTC [42] LOG:  正在监听 IPv4 地址 "0.0.0.0",端口 5432
2023-04-05 15:11:08.866 UTC [42] LOG:  正在监听 IPv6 地址 "::",端口 5432
2023-04-05 15:11:08.868 UTC [42] LOG:  正在监听 Unix 套接字 "/var/run/postgresql/.s.PGSQL.5432"
2023-04-05 15:11:08.873 UTC [45] LOG:  数据库系统在 2023-04-05 06:16:39 UTC 关闭
2023-04-05 15:11:08.883 UTC [42] LOG:  数据库系统已准备好接受连接
I, [2023-04-05T15:11:13.755663 #1]  INFO -- : 
I, [2023-04-05T15:11:13.756280 #1]  INFO -- : > su postgres -c 'createdb discourse' || true
2023-04-05 15:11:13.829 UTC [55] postgres@postgres ERROR:  数据库 "discourse" 已存在
2023-04-05 15:11:13.829 UTC [55] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: 错误:数据库创建失败:ERROR:  数据库 "discourse" 已存在
I, [2023-04-05T15:11:13.830921 #1]  INFO -- : 
I, [2023-04-05T15:11:13.831090 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2023-04-05 15:11:13.871 UTC [59] postgres@discourse ERROR:  角色 "discourse" 已存在
2023-04-05 15:11:13.871 UTC [59] postgres@discourse STATEMENT:  create user discourse;
ERROR:  角色 "discourse" 已存在
I, [2023-04-05T15:11:13.873063 #1]  INFO -- : 
I, [2023-04-05T15:11:13.873258 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
I, [2023-04-05T15:11:13.902751 #1]  INFO -- : GRANT

I, [2023-04-05T15:11:13.902932 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
I, [2023-04-05T15:11:13.933017 #1]  INFO -- : ALTER SCHEMA

I, [2023-04-05T15:11:13.933227 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
NOTICE:  扩展 "hstore" 已存在,跳过
I, [2023-04-05T15:11:13.969476 #1]  INFO -- : CREATE EXTENSION

I, [2023-04-05T15:11:13.969619 #1]  INFO -- : > su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
NOTICE:  扩展 "pg_trgm" 已存在,跳过
I, [2023-04-05T15:11:14.001740 #1]  INFO -- : CREATE EXTENSION

I, [2023-04-05T15:11:14.001885 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists hstore;"'
NOTICE:  扩展 "hstore" 已存在,跳过
I, [2023-04-05T15:11:14.031644 #1]  INFO -- : CREATE EXTENSION

I, [2023-04-05T15:11:14.031827 #1]  INFO -- : > su postgres -c 'psql discourse -c "create extension if not exists pg_trgm;"'
NOTICE:  扩展 "pg_trgm" 已存在,跳过
I, [2023-04-05T15:11:14.062186 #1]  INFO -- : CREATE EXTENSION

I, [2023-04-05T15:11:14.062353 #1]  INFO -- : > sudo -u postgres psql discourse
I, [2023-04-05T15:11:14.064363 #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-04-05T15:11:14.111348 #1]  INFO -- : 文件 > /var/lib/postgresql/take-database-backup  chmod: +x  chown: postgres:postgres
I, [2023-04-05T15:11:14.113559 #1]  INFO -- : 文件 > /var/spool/cron/crontabs/postgres  chmod:   chown: 
I, [2023-04-05T15:11:14.113612 #1]  INFO -- : > echo postgres installed!
I, [2023-04-05T15:11:14.114734 #1]  INFO -- : postgres 已安装!

I, [2023-04-05T15:11:14.117530 #1]  INFO -- : 文件 > /etc/service/redis/run  chmod: +x  chown: 
I, [2023-04-05T15:11:14.120181 #1]  INFO -- : 文件 > /etc/service/redis/log/run  chmod: +x  chown: 
I, [2023-04-05T15:11:14.122880 #1]  INFO -- : 文件 > /etc/runit/3.d/10-redis  chmod: +x  chown: 
I, [2023-04-05T15:11:14.123505 #1]  INFO -- : 在 /etc/redis/redis.conf 中将 daemonize yes 替换为
I, [2023-04-05T15:11:14.124199 #1]  INFO -- : 在 /etc/redis/redis.conf 中将 (?-mix:^pidfile.*$) 替换为
I, [2023-04-05T15:11:14.124445 #1]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2023-04-05T15:11:14.126384 #1]  INFO -- : 
I, [2023-04-05T15:11:14.126590 #1]  INFO -- : 在 /etc/redis/redis.conf 中将 (?-mix:^logfile.*$) 替换为 logfile ""
I, [2023-04-05T15:11:14.127138 #1]  INFO -- : 在 /etc/redis/redis.conf 中将 (?-mix:^bind .*$) 替换为
I, [2023-04-05T15:11:14.127515 #1]  INFO -- : 在 /etc/redis/redis.conf 中将 (?-mix:^dir .*$) 替换为 dir /shared/redis_data
I, [2023-04-05T15:11:14.127883 #1]  INFO -- : 在 /etc/redis/redis.conf 中将 (?-mix:^protected-mode yes) 替换为 protected-mode no
I, [2023-04-05T15:11:14.128139 #1]  INFO -- : 在 /etc/redis/redis.conf 中将 # io-threads 4 替换为 io-threads $redis_io_threads
I, [2023-04-05T15:11:14.128483 #1]  INFO -- : > echo redis installed
I, [2023-04-05T15:11:14.130199 #1]  INFO -- : redis 已安装

I, [2023-04-05T15:11:14.130276 #1]  INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2023-04-05T15:11:14.134491 #1]  INFO -- : logfile ""

I, [2023-04-05T15:11:14.134662 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-04-05T15:11:14.135963 #1]  INFO -- : > sleep 10
103:C 05 Apr 2023 15:11:14.149 # oO0OoO0OoO0Oo Redis 正在启动 oO0OoO0OoO0Oo
103:C 05 Apr 2023 15:11:14.149 # Redis 版本=7.0.7, bits=64, commit=00000000, modified=0, pid=103, 刚刚启动
103:C 05 Apr 2023 15:11:14.149 # 配置已加载
103:M 05 Apr 2023 15:11:14.149 * 单调时钟:POSIX clock_gettime
103:M 05 Apr 2023 15:11:14.151 * 运行模式=独立,端口=6379。
103:M 05 Apr 2023 15:11:14.151 # 服务器已初始化
103:M 05 Apr 2023 15:11:14.151 # 警告:必须启用内存超量使用!如果没有启用,在低内存条件下后台保存或复制可能会失败。如果禁用了它,即使在非低内存条件下也可能导致失败,参见 https://github.com/jemalloc/jemalloc/issues/1328。要修复此问题,请将 'vm.overcommit_memory = 1' 添加到 /etc/sysctl.conf 并重启,或运行命令 'sysctl vm.overcommit_memory=1' 使其生效。
103:M 05 Apr 2023 15:11:14.152 * 正在加载由版本 7.0.7 生成的 RDB
103:M 05 Apr 2023 15:11:14.152 * RDB 年龄 32075 秒
103:M 05 Apr 2023 15:11:14.152 * 创建时 RDB 内存使用量 0.82 Mb
103:M 05 Apr 2023 15:11:14.152 * RDB 加载完成,已加载键:0,已过期键:0。
103:M 05 Apr 2023 15:11:14.152 * 从磁盘加载 DB:0.000 秒
103:M 05 Apr 2023 15:11:14.152 * 已准备好接受连接
I, [2023-04-05T15:11:24.137467 #1]  INFO -- : 
I, [2023-04-05T15:11:24.137853 #1]  INFO -- : > thpoff echo "thpoff is installed!"
I, [2023-04-05T15:11:24.149387 #1]  INFO -- : thpoff 已安装!

I, [2023-04-05T15:11:24.149681 #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-04-05T15:11:24.200993 #1]  INFO -- : 
I, [2023-04-05T15:11:24.201152 #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-04-05T15:11:24.243718 #1]  INFO -- : 
I, [2023-04-05T15:11:24.243859 #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-04-05T15:11:24.281161 #1]  INFO -- : 
I, [2023-04-05T15:11:24.281311 #1]  INFO -- : > rm -f /etc/cron.d/anacron
I, [2023-04-05T15:11:24.288045 #1]  INFO -- : 
I, [2023-04-05T15:11:24.289881 #1]  INFO -- : 文件 > /etc/cron.d/anacron  chmod:   chown: 
I, [2023-04-05T15:11:24.293565 #1]  INFO -- : 文件 > /etc/runit/1.d/copy-env  chmod: +x  chown: 
I, [2023-04-05T15:11:24.296532 #1]  INFO -- : 文件 > /etc/service/unicorn/run  chmod: +x  chown: 
I, [2023-04-05T15:11:24.299442 #1]  INFO -- : 文件 > /etc/service/nginx/run  chmod: +x  chown: 
I, [2023-04-05T15:11:24.301992 #1]  INFO -- : 文件 > /etc/runit/3.d/01-nginx  chmod: +x  chown: 
I, [2023-04-05T15:11:24.305284 #1]  INFO -- : 文件 > /etc/runit/3.d/02-unicorn  chmod: +x  chown: 
I, [2023-04-05T15:11:24.305369 #1]  INFO -- : 在 /etc/service/unicorn/run 中将 # postgres 替换为 sv start postgres || exit 1
I, [2023-04-05T15:11:24.305639 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2023-04-05T15:11:24.307095 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git reset --hard
130:C 05 Apr 2023 15:11:24.310 # oO0OoO0OoO0Oo Redis 正在启动 oO0OoO0OoO0Oo
130:C 05 Apr 2023 15:11:24.310 # Redis 版本=7.0.7, bits=64, commit=00000000, modified=0, pid=130, 刚刚启动
130:C 05 Apr 2023 15:11:24.310 # 配置已加载
130:M 05 Apr 2023 15:11:24.310 * 单调时钟:POSIX clock_gettime
130:M 05 Apr 2023 15:11:24.310 # 警告:无法创建服务器 TCP 监听套接字 *:6379: bind: 地址已在使用中
130:M 05 Apr 2023 15:11:24.310 # 监听端口 6379 (TCP) 失败,正在中止。
正在更新文件:100% (32972/32972),完成。
I, [2023-04-05T15:11:26.455124 #1]  INFO -- : HEAD 现在位于 59e548540 Build(deps): 将 /app/assets/javascripts 中的 sass 从 1.58.3 升级到 1.59.2 (#20656)

I, [2023-04-05T15:11:26.455203 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
I, [2023-04-05T15:11:26.537625 #1]  INFO -- : 
I, [2023-04-05T15:11:26.537707 #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 dc5b37c01131bfc42eb666ec2bc779433df309cb
      git fetch --depth 1 origin dc5b37c01131bfc42eb666ec2bc779433df309cb
  else
      git fetch --prune --prune-tags origin dc5b37c01131bfc42eb666ec2bc779433df309cb
  fi
'
fatal: 远程错误:upload-pack: 不是我们的引用 dc5b37c01131bfc42eb666ec2bc779433df309cb
I, [2023-04-05T15:11:28.603419 #1]  INFO -- : 
I, [2023-04-05T15:11:28.604132 #1]  INFO -- : 正在终止异步进程
I, [2023-04-05T15:11:28.604192 #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 pid: 42 发送 INT
2023-04-05 15:11:28.604 UTC [42] LOG:  收到快速关闭请求
I, [2023-04-05T15:11:28.604310 #1]  INFO -- : 向 exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 103 发送 TERM
103:signal-handler (1680707488) 收到 SIGTERM,正在计划关闭...
2023-04-05 15:11:28.610 UTC [42] LOG:  中止任何活跃事务
2023-04-05 15:11:28.613 UTC [42] LOG:  后台工作进程 "logical replication launcher" (PID 51) 以退出代码 1 退出
2023-04-05 15:11:28.614 UTC [46] LOG:  正在关闭
2023-04-05 15:11:28.653 UTC [42] LOG:  数据库系统已关闭
103:M 05 Apr 2023 15:11:28.692 # 用户请求关闭...
103:M 05 Apr 2023 15:11:28.692 * 正在保存退出前的最终 RDB 快照。
103:M 05 Apr 2023 15:11:28.695 * DB 已保存到磁盘
103:M 05 Apr 2023 15:11:28.695 # Redis 现在已准备好退出,再见...


失败
--------------------
Pups::ExecError: 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 dc5b37c01131bfc42eb666ec2bc779433df309cb
      git fetch --depth 1 origin dc5b37c01131bfc42eb666ec2bc779433df309cb
  else
      git fetch --prune --prune-tags origin dc5b37c01131bfc42eb666ec2bc779433df309cb
  fi
' 失败,返回 #<Process::Status: pid 138 exit 128>
失败位置:/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117: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  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 --prune --prune-tags origin $version\n  fi\n'", "sudo -H -E -u discourse bash -c '\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'", "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 可能有助于诊断问题。
2b9af6c1f823c44dc011edda5c4aa2512a29545fecf926eb47e6dbcb078ab79b

你确定这是正确的提交吗?

https://github.com/discourse/discourse/commit/dc5b37c01131bfc42eb666ec2bc779433df309cb 是一个 404

这是一个 discourse_docker 提交。Fix checksums · discourse/discourse_docker@dc5b37c · GitHub

你需要固定到一个 discourse/discourse 提交。

而且,也许需要一个兼容的 discourse_docker 提交,因为您想要的任何 Discourse 可能与当前的 Discourse 基础映像不兼容。

discourse_docker 安装在 /var/discourse 中有点令人困惑。

我在 container/app.yml 中设置了版本,并且也检出了该提交

params:
    version: 'dc5b37c01131bfc42eb666ec2bc779433df309cb'

我还需要做什么?

将 discourse commit 放在你的 yml 文件中,和你放 discourse_docker commit 的地方一样,并且,我猜,在重建之前,在 /var/discourse/ 中检出那个 commit。

但看起来你不知道你想要哪个 Discourse commit,只知道你想要的 discourse_docker commit。如果你想匹配一个正在运行的站点,你可以查看源代码并查看 Discourse commit 的 meta 标签。

将其更改为一个存在的提交? Fix checksums · discourse/discourse@dc5b37c · GitHub 是一个 404。

我设置了正确的提交哈希,但它又失败了:

I, [2023-04-10T08:33:27.495565 #1]  INFO -- : cd /var/www/discourse & gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
错误:找不到有效的 gem 'bundler' (= 2.3.4),原因如下:
          无法从 https://rubygems.org/ 下载数据 - Net::OpenTimeout: 打开到 rubygems.org:443 的 TCP 连接失败 (execution expired) (https://rubygems.org/specs.4.8.gz)

但我可以从主机正常 curl rubygems.org

问题出在 Ruby gems 和 Yarn 网站的 ipv6 上,解决方案是在 /etc/gai.conf 中降低 ipv6 优先级:

precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 10
precedence 2a04:4e42::0/32 5
precedence 2606:4700::0/32 5