重建失败,请帮助!

我今晚进行了重建,但失败了。我禁用了所有插件,但它仍然失败。看来一些 gem 可能没有正确更新。@pfaffman 我可能需要您的帮助。

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development' failed with return #<Process::Status: pid 367 exit 5>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --retry 3 --jobs 4 --verbose --without test development'"]}
bootstrap failed with exit code 5
** 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.
I, [2022-09-26T00:37:54.244078 #1]  INFO -- : Terminating async processes
I, [2022-09-26T00:37:54.244262 #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: 41
2022-09-26 00:37:54.244 UTC [41] LOG:  received fast shutdown request
I, [2022-09-26T00:37:54.244884 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 102
102:signal-handler (1664152674) Received SIGTERM scheduling shutdown...
2022-09-26 00:37:54.247 UTC [41] LOG:  aborting any active transactions
2022-09-26 00:37:54.250 UTC [41] LOG:  background worker "logical replication launcher" (PID 50) exited with exit code 1
2022-09-26 00:37:54.253 UTC [45] LOG:  shutting down
102:M 26 Sep 2022 00:37:54.271 # User requested shutdown...
102:M 26 Sep 2022 00:37:54.271 * Saving the final RDB snapshot before exiting.
2022-09-26 00:37:54.274 UTC [41] LOG:  database system is shut down
102:M 26 Sep 2022 00:37:55.122 * DB saved on disk
102:M 26 Sep 2022 00:37:55.122 # Redis is now ready to exit, bye bye...
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/msgpack-1.5.6.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/image_size-3.1.0.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/logster-2.11.3.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/version_gem-1.1.0.gem)
Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/msgpack-1.5.6.gem)
Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/image_size-3.1.0.gem)
Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/logster-2.11.3.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/stackprof-0.2.21.gem)
Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/image_size-3.1.0.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/omniauth-1.9.2.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/oauth-tty-1.0.3.gem)
Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/stackprof-0.2.21.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/loofah-2.19.0.gem)
Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/css_parser-1.12.0.gem)
Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/oauth-tty-1.0.3.gem)
Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/stackprof-0.2.21.gem)
Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/loofah-2.19.0.gem)
Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/css_parser-1.12.0.gem)
Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/oauth-tty-1.0.3.gem)
Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError Net::OpenTimeout: execution expired (https://rubygems.org/gems/loofah-2.19.0.gem)
Bundler::InstallError: Bundler::HTTPError: Could not download gem from https://rubygems.org/ due to underlying error <Net::OpenTimeout: execution expired (https://rubygems.org/gems/oauth-tty-1.0.3.gem)>
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/rubygems_integration.rb:497:in `rescue in download_gem'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/rubygems_integration.rb:469:in `download_gem'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/source/rubygems.rb:539:in `download_gem'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/source/rubygems.rb:488:in `fetch_gem'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/source/rubygems.rb:465:in `fetch_gem_if_possible'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/source/rubygems.rb:158:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/gem_installer.rb:54:in `install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:62:in `apply_func'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:57:in `block in process_queue'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:54:in `loop'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:54:in `process_queue'
  /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.3.18/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'

如果对 rubygems 的请求超时,那很可能是他们那边出了问题。

您是否已成功重启现有容器?

我假设服务器上的其他 DNS 请求都成功了?

2 个赞

我无法启动容器。

这是我的 gem env 输出供您参考:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.2.1
  - RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-linux-gnu]
  - INSTALLATION DIRECTORY: /var/lib/gems/2.3.0
  - USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /usr/bin/ruby2.3
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/2.3.0
     - /root/.gem/ruby/2.3.0
     - /usr/lib/x86_64-linux-gnu/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/2.3.0
     - /usr/share/rubygems-integration/all
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin

并且它似乎正在连接:

root@community:/var/discourse# curl -O https://rubygems.org/gems/msgpack-1.5.6.gem
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 89600  100 89600    0     0   745k      0 --:--:-- --:--:-- --:--:--  741k

编辑:错误。这太奇怪了。事实证明,如果你不遵循 Discourse FontAwesome Pro 中的说明,而是将插件与其他插件一起克隆,而不是放在 after_code 节中,你就会遇到这些错误。我无法解释为什么它以前能正常工作。我回顾了那里的说明,看看这是否是一个更改,但它最近没有被更改过。

2 个赞

我不明白你在说什么,Jay,安装插件的常规方法就是after_code 块中克隆它?

这对我有用,我想知道糟糕的配置是什么样的?

## 插件放在这里
## 详情请参阅 https://meta.discourse.org/t/19157
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-fontawesome-pro.git

2 个赞

我现在真的糊涂了。我从来没注意到插件通常在哪个块里。但我发誓,它在所有其他插件中都不起作用,然后我添加了另一个 after_code 块,里面有 git clone 和安装脚本。

我看看能不能再把它弄坏。:confused: :crying_cat_face:

2 个赞

依我判断,这只是rubygems 的速率限制。我不确定我刚创建的全新 droplet 是如何被限制速率的,但这就是我的最佳解释,或者是一个与 rubygems 本身相关的虚假问题。

2 个赞

尝试将 127.0.0.1 添加到主机 DNS。
这对我解决了此错误。