# Error 502 after upgrading to CentOS 7.8

**URL:** <https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818>\
**Category:** Administrators\
**Created:** [May 14, 2020, 5:02pm UTC](https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818 "2020-05-14T17:02:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvala](https://talk.getindico.io/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mvala](https://talk.getindico.io/u/mvala)\
**Post date:** [May 14, 2020, 5:02pm UTC](https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818/1 "2020-05-14T17:02:28Z")

</div>

I just update centos 7.7 to 7.8 and also indico 2.2.7 to 2.2.8 and i am getting same error. Can you help me?  
My error is

```auto
2020/05/14 19:07:11 [error] 16809#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 95.103.6.204, server: indico.openbrain.sk, request: "GET / HTTP/2.0", upstream: "uwsgi://unix:/opt/indico/w
eb/uwsgi.sock:", host: "indico.openbrain.sk"

```

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [May 14, 2020, 5:12pm UTC](https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818/2 "2020-05-14T17:12:43Z")

</div>

Try this (as root):

```auto
mkdir -p /etc/systemd/system/uwsgi.service.d
cat > /etc/systemd/system/uwsgi.service.d/old-exec-start.conf <<'EOF'
[Service]
ExecStart=
ExecStart=/usr/sbin/uwsgi --ini /etc/uwsgi.ini
EOF

```

and then (still as root):

```auto
systemctl daemon-reload
systemctl restart uwsgi.service

```

* * *

Why did this happen? Shortly before the release of CentOS 7.8 (so it was not caused by that update itself - it’s just the time where people are most likely to actually restart uWSGI or even reboot the server), an updated uWSGI package has been released which changed the start command for uWSGI:

```diff
-ExecStart=/usr/sbin/uwsgi --ini /etc/uwsgi.ini
+ExecStart=/usr/sbin/uwsgi --ini /etc/uwsgi.ini --pidfile /run/uwsgi/uwsgi.pid --stats /run/uwsgi/stats.sock

```

When running it was the default user this would not be a problem, but since we are running uWSGI as the indico user, it now fails to create the stats socket file in `/run/wsgi`. By adding the custom config file in `uwsgi.service.d` this change is basically reverted, and everything works again.

---

<div class="post-metadata">

**Author:** ![mvala](https://talk.getindico.io/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mvala](https://talk.getindico.io/u/mvala)\
**Post date:** [May 14, 2020, 5:15pm UTC](https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818/3 "2020-05-14T17:15:45Z")

</div>

Thanks for quick reply. It is fixed by your instruction

---

<div class="post-metadata">

**Author:** ![tak0222](https://talk.getindico.io/user_avatar/talk.getindico.io/tak0222/32/38_2.png) [@tak0222](https://talk.getindico.io/u/tak0222)\
**Post date:** [October 6, 2020, 6:17am UTC](https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818/4 "2020-10-06T06:17:38Z")

</div>

Hi,

I just updated our indico server from Centos 7.7 to Centos 7.8 today and encountered similar error.

I found this page by google search “indico Centos 7.8” and resolved this problem by the above method.  
Thanks

Takashi

---

<div class="post-metadata">

**Author:** ![npanyam](https://talk.getindico.io/letter_avatar_proxy/v4/letter/n/3e96dc/32.png) [@npanyam](https://talk.getindico.io/u/npanyam)\
**Post date:** [October 10, 2020, 5:19pm UTC](https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818/5 "2020-10-10T17:19:31Z")

</div>

Thanks to Takashi, I found this solution right at top of the page!  
I ran into the same Error 502 immediately after migrating to 2.0.

Nagaraj

---

<div class="post-metadata">

**Author:** ![ThiefMaster](https://talk.getindico.io/user_avatar/talk.getindico.io/thiefmaster/32/509_2.png) [@ThiefMaster](https://talk.getindico.io/u/ThiefMaster)\
**Post date:** [October 10, 2020, 10:16pm UTC](https://talk.getindico.io/t/error-502-after-upgrading-to-centos-7-8/1818/6 "2020-10-10T22:16:32Z")

</div>

That’s strange, because the current setup guide already contains this workaround (at the end of step 4)…
