# Discourse\_docker：启动器引导失败（包含解决方法）

**URL:** <https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897>\
**Category:** Support\
**Created:** [2021年三月20日 21:50 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897 "2021-03-20T21:50:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.abi](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@m.abi](https://meta.discourse.org/u/m.abi)\
**Post date:** [2021年三月20日 21:50 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/1 "2021-03-20T21:50:46Z")

</div>

初始化新容器镜像失败。几天前还能正常工作，“没有任何改动”，今天却失败了。日志如下：

```
[0:02:27] 仍在处理：
[0:02:27] v8
________ 正在 '/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/libv8-8.4.255.0/vendor' 中运行 'vpython third_party/depot_tools/update_depot_tools_toggle.py --disable'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/libv8-8.4.255.0/vendor/depot_tools/.cipd_bin/.cipd/pkgs/0/fI6WggdkRyN1r91MnTeApc2_gyTtXfYpueHZVLcaF8gC/vpython:
无法解析选项：无法解析 Python 脚本：stat
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/libv8-8.4.255.0/vendor/third_party/depot_tools/update_depot_tools_toggle.py:
没有该文件或目录
错误：命令 'vpython third_party/depot_tools/update_depot_tools_toggle.py --disable' 在 /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/libv8-8.4.255.0/vendor 中返回了非零退出状态 1

...

**初始化失败** 请向上滚动并查看之前的错误消息，可能不止一条。
./discourse-doctor 可能有助于诊断问题。

```

深入调查：关于 libv8，GitHub 上已报告过类似问题，与 Ruby 构建器版本变更有关。在初始化过程中，会执行构建器的升级。我认为问题可能与昨天发布的 bundler 2.2.15 版本有关。老实说：我不是 Ruby 专家，所以真正的问题可能略有不同。

不过，以下变通方法对我有效：将 templates/web.template.yml 中的第 148 行  
`- gem update bundler`  
修改为  
`- gem install bundler -v 2.2.14`

此致，

Michael

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2021年三月21日 02:11 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/2 "2021-03-21T02:11:53Z")

</div>

这是在尝试构建稳定分支时发生的吗？

---

<div class="post-metadata">

**Author:** ![m.abi](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@m.abi](https://meta.discourse.org/u/m.abi)\
**Post date:** [2021年三月21日 16:58 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/3 "2021-03-21T16:58:55Z")

</div>

好主意！使用 discourse\_docker 的 master 分支，app.yml 中的参数设为 version: stable。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2021年三月21日 17:06 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/4 "2021-03-21T17:06:00Z")

</div>

除非你有理由运行 `stable` 版本，并且愿意对某些问题（如本例）投入更多关注，否则使用 `tests-passed` 会是更好的选择。该版本经过更充分的测试，也是 Discourse 官方托管服务所使用的版本。

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2021年三月21日 23:21 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/5 "2021-03-21T23:21:01Z")

</div>

这确实值得调试，如果 Bundler 刚发布了一个 bug，我们需要尽快提供解决方案。

@kris.kotlarek 你能在 DigitalOcean 上复现这个问题吗？

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2021年三月22日 18:56 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/8 "2021-03-22T18:56:08Z")

</div>

这里存在若干问题。目前最稳妥的解决方案是在稳定版中提升 Gemfile 的版本。更多详情请参阅提交信息：

> <https://github.com/discourse/discourse/commit/5dbac4e58ec1055e2b1688f1e195f52540851266>
>
> There are a few issues which require us to do this:
> - We install the latest ve…rsion of bundler on every rebuild. Therefore we're running 2.2.15 everywhere, even for 'stable' clusters
> - Bundler has changed how gem platforms are managed. That meant that on the stable branch we were building libv8 from source via the 'ruby' package, rather than using the precompiled x86\_64-linux binary
> - Building the libv8 from source is currently failing
> 
> Together, these things mean that builds of \`stable\` are currently failing. Each of the above issues should likely be fixed, but this commit provides the quickest route to get things working again. Note that despite the Gemfile.lock update, no gem versions have changed.

@M.abi 请尝试重新构建，现在应该可以正常工作了。

---

<div class="post-metadata">

**Author:** ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)\
**Post date:** [2021年三月22日 19:50 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/9 "2021-03-22T19:50:20Z")

</div>

> [@pfaffman](#):
>
> 除非你有理由运行 `stable` 版本，并且愿意对某些事项投入更多关注。

我预期运行 `stable` 版本能获得更好的稳定性——理想情况下仅包含安全修复，其他改动极少。至少这是我们对稳定分支的理解。而且，正因为稳定分支可能比“前沿”版本更容易出问题，才更需要用户投入更多关注。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2021年三月22日 20:00 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/10 "2021-03-22T20:00:01Z")

</div>

> [@mentalstring](#):
>
> 而且，也不需要特别关注 stable 版本，因为它可能比 bleeding edge 版本更容易出问题。

不过，正如这个案例所示，实际情况可能与你预期的有所不同。他们确实很擅长快速修复问题（比如这次），但他们（主要）不在自己的托管环境中使用 `stable` 版本，因此其测试覆盖度不如 `tests-passed` 充分。所以，除非正好有新 `stable` 版本发布，否则我认为 `tests-passed` 相对更“稳妥”一些。当然，并非所有人都认同这一观点。

---

<div class="post-metadata">

**Author:** ![m.abi](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@m.abi](https://meta.discourse.org/u/m.abi)\
**Post date:** [2021年三月23日 08:00 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/11 "2021-03-23T08:00:35Z")

</div>

@david 构建成功！谢谢！

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2021年四月22日 08:00 UTC](https://meta.discourse.org/t/discourse-docker-launcher-boostrap-fails-workaround-included/183897/12 "2021-04-22T08:00:48Z")

</div>

此主题在最后一次回复 30 天后自动关闭。不再允许新回复。
