更新/重建到Beta7时遇到问题

Hi,

I’m currently trying to update our DEV-Instance to the most recent Beta 7, coming from Beta 2.
It’s running on the default `tests-passed’ branch.

My issue is that rebuilding the container ends in a connectivity issue (I guess) with github:

I, [2025-07-28T12:35:19.480463 #1]  INFO -- : Replacing # postgres with if [ -f /root/install_postgres ]; then
  /root/install_postgres
  rm /root/install_postgres
fi
sv start postgres || exit 1
 in /etc/service/unicorn/run
I, [2025-07-28T12:35:19.480838 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
I, [2025-07-28T12:35:19.511065 #1]  INFO -- : 
I, [2025-07-28T12:35:19.511112 #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
'
error: RPC failed; curl 56 Recv failure: Connection reset by peer
error: 44 bytes of body are still expected
fatal: expected flush after ref listing
I, [2025-07-28T12:37:22.158398 #1]  INFO -- : 
I, [2025-07-28T12:37:22.158628 #1]  INFO -- : Terminating async processes

General connectivity on the host is fine otherwise, if I clear the Docker Build Cache before ./launcher rebuild app I can see that it actually pulls the most recent version, pulls all the container images and so on, but still fails afterwards:

Long stdout output
I, [2025-07-28T12:19:42.269421 #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
'
From https://github.com/discourse/discourse
 - [deleted]             (none)     -> origin/dependabot/bundler/nokogiri-1.18.9
 - [deleted]             (none)     -> origin/dependabot/bundler/playwright-ruby-client-1.54.0
 - [deleted]             (none)     -> origin/dependabot/bundler/propshaft-1.2.0
 - [deleted]             (none)     -> origin/dependabot/npm_and_yarn/babel-plugin-ember-template-compilation-3.0.0
 - [deleted]             (none)     -> origin/dependabot/npm_and_yarn/glob-11.0.3
 - [deleted]             (none)     -> origin/dependabot/npm_and_yarn/playwright-1.54.1
 - [deleted]             (none)     -> origin/dev/decorate-quote-collapsed-content-properly
 - [deleted]             (none)     -> origin/dev/extract-invite-guardian
 - [deleted]             (none)     -> origin/dev/mt/discourse-category-custom-fields
 - [deleted]             (none)     -> origin/dev/mt/discourse-group-users
 - [deleted]             (none)     -> origin/dev/mt/discourse-groups
 - [deleted]             (none)     -> origin/dev/mt/discourse-muted-users
 - [deleted]             (none)     -> origin/dev/mt/requires-set
 - [deleted]             (none)     -> origin/dev/no-more-widgets
 - [deleted]             (none)     -> origin/dev/use-themeable-site-settings-horizon
 - [deleted]             (none)     -> origin/enable-new-topic-btn-on-restricted-category
 - [deleted]             (none)     -> origin/feature-admin-filter-controls
 - [deleted]             (none)     -> origin/feature/enable-rich-editor-for-all
 - [deleted]             (none)     -> origin/filtermagic
 - [deleted]             (none)     -> origin/fix/mt/log-failed-downloads
 - [deleted]             (none)     -> origin/fix/translated-badge-title
 - [deleted]             (none)     -> origin/layout-container-dev
 - [deleted]             (none)     -> origin/loic-upgrade-rails-8.0
 - [deleted]             (none)     -> origin/media-convert-job
 - [deleted]             (none)     -> origin/merge-sso-destination-url-cookie-with-destination-url-cookie
 - [deleted]             (none)     -> origin/mt/set_store
 - [deleted]             (none)     -> origin/pento/dev-flag-reason-tests
 - [deleted]             (none)     -> origin/playwright-1.53
 - [deleted]             (none)     -> origin/refactor-color-palette
 - [deleted]             (none)     -> origin/remove-suspended-and-deleted-users-from-leaderboard
 - [deleted]             (none)     -> origin/rollup-theme-experiment
 - [deleted]             (none)     -> origin/ux-editor-toolbar-mobile-scroll
 - [deleted]             (none)     -> origin/ux/sidebar-show-messages-count
   43ddd4ef3..ea5b5b6c0  main                    -> origin/main
 * [new branch]          0-a-depr-html-safe      -> origin/0-a-depr-html-safe
 * [new branch]          0-a-tabs                -> origin/0-a-tabs
 * [new branch]          add-composer-mention-warnings -> origin/add-composer-mention-warnings
   187f13d67..8d4a86f25  add-plugin-outlet-wrapper-to-login-template -> origin/add-plugin-outlet-wrapper-to-login-template
 * [new branch]          ai_default_llm          -> origin/ai_default_llm
 * [new branch]          content-border-color    -> origin/content-border-color
 + 51077ac74...088f149a6 dependabot/bundler/excon-1.2.8 -> origin/dependabot/bundler/excon-1.2.8  (forced update)
 + 36699b311...e3f5c2d0d dependabot/bundler/jwt-3.1.2 -> origin/dependabot/bundler/jwt-3.1.2  (forced update)
 * [new branch]          dependabot/bundler/octokit-10.0.0 -> origin/dependabot/bundler/octokit-10.0.0
 * [new branch]          dependabot/bundler/stripe-15.3.0 -> origin/dependabot/bundler/stripe-15.3.0
 + def825f3f...b5a5f3924 dependabot/bundler/web-push-3.0.2 -> origin/dependabot/bundler/web-push-3.0.2  (forced update)
 * [new branch]          dependabot/bundler/zendesk_api-3.1.1 -> origin/dependabot/bundler/zendesk_api-3.1.1
 + f4d832ec8...5aa0145f3 dependabot/npm_and_yarn/embroider-0ad991d471 -> origin/dependabot/npm_and_yarn/embroider-0ad991d471  (forced update)
 * [new branch]          dependabot/npm_and_yarn/fortawesome/fontawesome-free-7.0.0 -> origin/dependabot/npm_and_yarn/fortawesome/fontawesome-free-7.0.0
 * [new branch]          dependabot/npm_and_yarn/jspreadsheet-ce-5.0.3 -> origin/dependabot/npm_and_yarn/jspreadsheet-ce-5.0.3
 * [new branch]          dependabot/npm_and_yarn/lint-fda1ac657e -> origin/dependabot/npm_and_yarn/lint-fda1ac657e
 + e46dc3798...d3420e3eb dependabot/npm_and_yarn/prosemirror-f8434604ae -> origin/dependabot/npm_and_yarn/prosemirror-f8434604ae  (forced update)
 * [new branch]          dependabot/npm_and_yarn/puppeteer-core-24.15.0 -> origin/dependabot/npm_and_yarn/puppeteer-core-24.15.0
 + 4bcbc028d...03b9759db dev-floatkit-autocomplete-d-editor -> origin/dev-floatkit-autocomplete-d-editor  (forced update)
 + ea5bba76a...03b9759db dev-floatkit-autocomplete-d-editor-qa -> origin/dev-floatkit-autocomplete-d-editor-qa  (forced update)
 * [new branch]          dev/decorate-cooked-state -> origin/dev/decorate-cooked-state
   56e6c9ae1..11c480f88  dev/no-more-widgets-smoke-test -> origin/dev/no-more-widgets-smoke-test
 * [new branch]          dev/post-keep-detail-state -> origin/dev/post-keep-detail-state
 * [new branch]          dev/prevent-rerenderings -> origin/dev/prevent-rerenderings
 * [new branch]          dev/remove-redundant-staff-check-6 -> origin/dev/remove-redundant-staff-check-6
   1f3bbee91..00dfb95b1  dev/try-fix-flakys-tss  -> origin/dev/try-fix-flakys-tss
 * [new branch]          dual-mode-palettes-wip  -> origin/dual-mode-palettes-wip
 * [new branch]          feature/color-mode-preference -> origin/feature/color-mode-preference
 * [new branch]          feature/type-upload-in-type-objects -> origin/feature/type-upload-in-type-objects
 * [new branch]          feature/use-current-user-tz-instead-of-guess-local-dates -> origin/feature/use-current-user-tz-instead-of-guess-local-dates
 * [new branch]          filter-tips-dmenu-martinwip -> origin/filter-tips-dmenu-martinwip
 * [new branch]          filter-updates          -> origin/filter-updates
 * [new branch]          fix-color-palette-dark  -> origin/fix-color-palette-dark
 * [new branch]          fix/missing-user-custom-preferences-outlet-class-in-connector -> origin/fix/missing-user-custom-preferences-outlet-class-in-connector
 * [new branch]          improve_no_database_error_patch -> origin/improve_no_database_error_patch
 * [new branch]          improve_pg_adapter_new_client_error -> origin/improve_pg_adapter_new_client_error
 * [new branch]          loic-pitchfork          -> origin/loic-pitchfork
 * [new branch]          messages-dropdown-d-menu -> origin/messages-dropdown-d-menu
 * [new branch]          my-pref-lang            -> origin/my-pref-lang
 * [new branch]          notification-panel-refactor -> origin/notification-panel-refactor
 * [new branch]          pinned-dmenu            -> origin/pinned-dmenu
 * [new branch]          rollup-plugin-experiment -> origin/rollup-plugin-experiment
 * [new branch]          rollup-theme-experiment-cross-theme-import -> origin/rollup-theme-experiment-cross-theme-import
 * [new branch]          samsaffron/codex/convert-filter-tips-to-use-dmenu -> origin/samsaffron/codex/convert-filter-tips-to-use-dmenu
   8cb90072e..710d9fd41  sandbox/design-1        -> origin/sandbox/design-1
   1f97cf422..aa2fb29fa  sandbox/dev-xp-1        -> origin/sandbox/dev-xp-1
   817a743cb..3428acddc  sandbox/member-xp-1     -> origin/sandbox/member-xp-1
 + d182efe6f...a0aba00c7 sandbox/member-xp-2     -> origin/sandbox/member-xp-2  (forced update)
 * [new branch]          source-identify-modulepreload -> origin/source-identify-modulepreload
 + 9aa6daa1f...c56258634 split-login-admin-settings -> origin/split-login-admin-settings  (forced update)
   a83bd0f67..41e1152f6  stable                  -> origin/stable
 + 293de3a75...e31549885 temp-user-creation-debug-logging -> origin/temp-user-creation-debug-logging  (forced update)
   43ddd4ef3..ea5b5b6c0  tests-passed            -> origin/tests-passed
 * [new branch]          theme-upload-cleanup    -> origin/theme-upload-cleanup
 * [new branch]          translations-from-crowdin-main -> origin/translations-from-crowdin-main
 + 9f8fd9214...c3562ed3a translations-from-crowdin-stable -> origin/translations-from-crowdin-stable  (forced update)
 + 4ffab7134...e211b4a55 unicode-mentions-in-composer-rte -> origin/unicode-mentions-in-composer-rte  (forced update)
 * [new branch]          ux-footer-button-squish -> origin/ux-footer-button-squish
 * [new branch]          ux-horizon-discotoc     -> origin/ux-horizon-discotoc
 * [new branch]          ux-unify-appearance-filters -> origin/ux-unify-appearance-filters
   b0c2d83ec..045aefecb  ux/horizon-mobile-composer -> origin/ux/horizon-mobile-composer
 * [new branch]          ux/sidebar-my-messages-enhancements -> origin/ux/sidebar-my-messages-enhancements
 + 28d11bbd0...6f7d9e816 variable-additions-2    -> origin/variable-additions-2  (forced update)
   39d2564ba..57dcfda6a  vite-squashed-rebased   -> origin/vite-squashed-rebased
I, [2025-07-28T12:19:43.174876 #1]  INFO -- : 
I, [2025-07-28T12:19:43.174943 #1]  INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse bash -c '
  set -o errexit
  if [[ $(git symbolic-ref --short HEAD) == tests-passed ]] ; then
      git pull
  else
      git -c advice.detachedHead=false checkout tests-passed
  fi
'
error: RPC failed; curl 56 Recv failure: Connection reset by peer
error: 5470 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: could not fetch bff89c0762e874ec88d553d89901dbda4fa89f20 from promisor remote
I, [2025-07-28T12:23:50.121438 #1]  INFO -- : 

While it is trying to fetch from Github I can see no activity whatsoever on the Host in htop.

Host details: Proxmox VM running Debian 11, 4 Cores, 12GB Memory. Plenty of free memory while rebuilding, so it should not be a memory issue.
The server is hosted in germany, so there shouldn’t be anything blocking access to github.
I’ve found that

fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

indicates a tiemout, e.G. when the connection is too slow. Checking the connection speed shows around 890MBit/s Up and Down. Storage is all NVMe, so I don’t see any reason for it to time out at this step.

I’ve tried clearing all the Docker Build cache, updating the host system first to the most recent packages, rebooting, even moving it to a different node in the cluster to remove a faulty host as the issue.

Almost forgot to add: Heading towards the Admin Panel, I get the Information that I am not on the most recent version, but clicking on the Click here to update results in an error:

Server-Error
while loading /admin/docker/repos
Errorcode: 502 error

I can see timeout errors there as well:

activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:128:in `block in wait_poll' 
<internal:kernel>:187:in `loop'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:117:in `wait_poll' 
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:78:in `internal_poll' 
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:204:in `internal_poll' 
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:73:in `block in poll' 
/usr/local/lib/ruby/3.3.0/monitor.rb:201:in `synchronize'
/usr/local/lib/ruby/3.3.0/monitor.rb:201:in `mon_synchronize'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:82:in `synchronize' 
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool/queue.rb:73:in `poll' 
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:868:in `acquire_connection' 
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:564:in `checkout' 
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `with_connection' 
activerecord-7.2.2.1/lib/active_record/connection_handling.rb:296:in `with_connection' 
activerecord-7.2.2.1/lib/active_record/transactions.rb:410:in `with_transaction_returning_status' 
activerecord-7.2.2.1/lib/active_record/transactions.rb:366:in `save!' 
activerecord-7.2.2.1/lib/active_record/suppressor.rb:56:in `save!' 
activerecord-7.2.2.1/lib/active_record/persistence.rb:55:in `create!' 
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:128:in `process_queue' 
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:77:in `worker_loop' 
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:63:in `block (2 levels) in ensure_worker_threads' 

and

excon-1.2.5/lib/excon/socket.rb:386:in `select_with_timeout' 
excon-1.2.5/lib/excon/socket.rb:258:in `rescue in read_nonblock' 
excon-1.2.5/lib/excon/socket.rb:228:in `read_nonblock' 
excon-1.2.5/lib/excon/socket.rb:89:in `block in readline' 
<internal:kernel>:187:in `loop'
excon-1.2.5/lib/excon/socket.rb:78:in `readline' 
excon-1.2.5/lib/excon/response.rb:73:in `block in parse' 
<internal:kernel>:187:in `loop'
excon-1.2.5/lib/excon/response.rb:72:in `parse' 
excon-1.2.5/lib/excon/middlewares/response_parser.rb:7:in `response_call' 
excon-1.2.5/lib/excon/connection.rb:472:in `response' 
excon-1.2.5/lib/excon/connection.rb:297:in `request' 
/var/www/discourse/lib/discourse_updates.rb:136:in `new_features_payload' 
/var/www/discourse/app/jobs/scheduled/check_new_features.rb:24:in `execute' 
/var/www/discourse/app/jobs/base.rb:316:in `block (2 levels) in perform' 
rails_multisite-6.1.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
rails_multisite-6.1.0/lib/rails_multisite/connection_management.rb:21:in `with_connection'
/var/www/discourse/app/jobs/base.rb:303:in `block in perform' 
/var/www/discourse/app/jobs/base.rb:299:in `each' 
/var/www/discourse/app/jobs/base.rb:299:in `perform' 
/var/www/discourse/app/jobs/base.rb:379:in `perform' 
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:137:in `process_queue' 
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:77:in `worker_loop' 
mini_scheduler-0.18.0/lib/mini_scheduler/manager.rb:63:in `block (2 levels) in ensure_worker_threads' 

I’m really out of ideas here. I tried increasing the system ressources, but adding more cores or memory does not change anything, the error persists.

I tried increasing the git http.postBuffer as well, now it’s stuck a little longer before failing.

I hope someone has an idea, as I couldn’t find any more threads or posts about this kind of error.

Thanks!

您的 app.yml 文件中是否有很多扩展?也许可以尝试将它们全部注释掉,看看是否能正常工作,如果可以,您可以逐个取消注释它们。

我们不使用很多插件。我已按照更新日志的说明删除了已合并到核心的插件。

目前只设置了以下插件:

          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-translator.git
          - git clone https://github.com/discourse/onebox.git

我已注释掉这些插件,但它仍然卡在同一个地方。

这只是一个开发实例,所以不用担心数据。如果一切都失败了,我可以从生产服务器导入一个转储来恢复它。但我们的生产系统版本相同,所以我猜我也会在那里遇到同样的问题。

这感觉像是提供商的问题,或者可能是内核问题。但我对开发安装不熟悉。

它托管在德国的 Hetzner,内核也没有什么特别之处,只是默认的 Debian 11 内核 5.10.237-1。

DEV-Instance 仅指它是我们的测试实例,用于在实际生产环境中进行更新/升级尝试,以确保不会破坏实时版本。所以它基本上是我们实时系统的副本,用于尝试新事物。

对了。如果它基于常规容器,并且遇到连接问题,我认为那不是 Discourse 的问题。

您的内核非常旧。我正在运行 Ubuntu 24.04,内核版本为 6.8.0-53。

内核构建于 2025 年 5 月,是 Debian 11 的当前内核,仍然完全受支持。2 个月并不是“很旧”。

但是,为了排除此问题,我已将系统升级到 Debian 12 和最新的主线内核 6.10(同样,这并不旧,这是 Debian 12 的最新内核,无需运行任何开发/夜间/预览版本),问题完全相同。

主机上的一切正常,与 GitHub 或其他网站没有连接问题,甚至完整的系统升级也在 5 分钟内完成,没有问题。此系统上唯一无法正常工作的是 discourse——在此升级之前,它已正常工作多年。

另外奇怪的是,使用管理员面板进行的更新只显示 502,这表明 discourse 内部存在一些问题,而运行的是一个几乎未修改的标准镜像。没有安装第三方插件,除了自定义主题外没有进行任何修改。

这很奇怪。你检查内核做得很好——确实存在过内核版本不兼容的情况,但显然这次不是。

你可以进入容器的命令行,或许可以尝试一些网络操作(wget 或 curl),但我不知道这能证明什么。

我现在没有其他想法了,抱歉。

我发现错误指向 Git 配置,可能需要更改,但我不知道在哪里更改,因为这一切都发生在容器重建过程中。在主机本身上进行更改并没有真正起到任何作用。

因此,像 git config http.postBuffer 524288000 这样的更改,如果在主机系统上更改,可能不会影响重建。
压缩设置或 Git 内存限制也是如此。

我将检查是否可以在类似的 Host 上设置新环境,或者如果使用相同版本也失败的话。

也许你可以在你的 app.yml 文件中添加一些命令规范 - 请参阅

我试过了,但遗憾的是没有变化。不确定命令是否在尝试拉取/构建实际容器之前运行。

它必须在开始(重新)构建时运行。我期望这些钩子在拉取/构建 /var/www/discourse 处的站点之后运行,而这对我来说不会完成。

我现在真的没有别的办法了……

编辑:所以我尝试从正在运行的容器内部诊断它,似乎也有一个问题。在这里克隆 discourse docker 仓库也会失败:

root@community-app:/tmp# git clone https://github.com/discourse/discourse_docker.git
Cloning into 'discourse_docker'...
remote: Enumerating objects: 7235, done.
remote: Counting objects: 100% (234/234), done.
remote: Compressing objects: 100% (104/104), done.
error: RPC failed; curl 56 Recv failure: Connection reset by peer
error: 1355 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

所以,Docker 内部肯定有什么问题,或者……我不知道。
我可以在宿主机上正常克隆同一个仓库,但在容器内不行。这与重新构建失败的地方相同。

我将诊断一下 Docker 网络,也许能找到一些东西。

终于搞定了。问题确实出在 Docker 和主机网络上,而不是 Discourse。

Hetzner 如果运行带有公共子网的 vSwitch,需要将 MTU 设置为 1400 而不是 1500。我之前更改过一次,但不知为何又被还原了。所以,我不得不重新进行更改并使用正确的 MTU 重启 Docker。

现在 Discourse 内的更新站点也能正常工作了。

真有趣,其他所有东西一直都工作正常。

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.