# 升级到 2.7.0beta2 后出现 502 Bad Gateway

**URL:** <https://meta.discourse.org/t/502-bad-gateway-after-upgrade-to-2-7-0beta2/177030>\
**Category:** Self-hosting\
**Created:** [2021 年1 月 23 日 12:46 UTC](https://meta.discourse.org/t/502-bad-gateway-after-upgrade-to-2-7-0beta2/177030 "2021-01-23T12:46:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![napcok](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/napcok/32/68153_2.png) [@napcok](https://meta.discourse.org/u/napcok)\
发布日期： [2021 年1 月 23 日 12:46 UTC](https://meta.discourse.org/t/502-bad-gateway-after-upgrade-to-2-7-0beta2/177030/1 "2021-01-23T12:46:38Z")

</div>

从 CLI 更新：

```plaintext
cd /var/discourse
git pull
 ./launcher rebuild app

```

一切正常，但我遇到了 502 Bad Gateway 错误。

**docker ps**

```plaintext
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6598e9407e29 local_discourse/app "/sbin/boot" 35 minutes ago Up 22 minutes 0.0.0.0:2045->80/tcp app

```

**./launcher logs app**

```plaintext
(105) exiting
ok: run: redis: (pid 47) 17s
ok: run: postgres: (pid 44) 17s
supervisor pid: 114 unicorn pid: 118
config/unicorn_launcher: line 71: kill: (118) - No such process
config/unicorn_launcher: line 15: kill: (118) - No such process
(114) exiting
ok: run: redis: (pid 47) 21s
ok: run: postgres: (pid 44) 21s
supervisor pid: 123 unicorn pid: 127
config/unicorn_launcher: line 71: kill: (127) - No such process
config/unicorn_launcher: line 15: kill: (127) - No such process
(123) exiting
ok: run: redis: (pid 47) 26s
ok: run: postgres: (pid 44) 26s
supervisor pid: 132 unicorn pid: 136

```

**curl localhost:2045**

```plaintext
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>

```

Discourse 运行在 LXC 容器中，我的第二个论坛也在 LXC 容器中，更新后运行正常。这真的很奇怪。  
有什么建议吗？

更新：  
我看到某些 Ruby 进程仍在运行并占用大量 CPU：

```plaintext
/usr/local/bin/ruby /usr/local/bin/bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb

```

更新 2：  
通过将 LXC 从非特权容器更改为特权容器解决了问题。

---

_[View the full topic](https://meta.discourse.org/t/502-bad-gateway-after-upgrade-to-2-7-0beta2/177030)._
