# 502 Bad Gateway Error

**URL:** <https://forums.screenly.io/t/502-bad-gateway-error/1591>\
**Category:** Anthias\
**Created:** [September 24, 2024, 5:53pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591 "2024-09-24T17:53:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhe](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@Dhe](https://forums.screenly.io/u/Dhe)\
**Post date:** [September 24, 2024, 5:53pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/1 "2024-09-24T17:53:03Z")

</div>

New install of Anthias works fine.

I try to enable basic\_auth in .scrrenly/screenly.conf

I’ve tried both:  
auth\_backend = -and-  
auth\_backend = auth\_basic

with  
[auth\_basic]  
user=bob  
password=sally

Then running:  
screenly/bin/upgrade\_containers.sh  
and rebooting.

Going back to the original IP address results in the 502 error.

Messages look like:  
Sep 24 18:49:57 display4 kernel: [1158.560669] br-6fb49e4cfc4e: port 1(veth1033d9e) entered blocking state  
Sep 24 18:49:57 display4 kernel: [1158.560678] br-6fb49e4cfc4e: port 1(veth1033d9e) entered forwarding state  
Sep 24 18:49:58 display4 kernel: [1159.543466] br-6fb49e4cfc4e: port 1(veth1033d9e) entered disabled state  
Sep 24 18:49:58 display4 kernel: [1159.543906] veth6717b73: renamed from eth0  
Sep 24 18:49:58 display4 kernel: [1159.600418] br-6fb49e4cfc4e: port 1(veth1033d9e) entered disabled state  
Sep 24 18:49:58 display4 kernel: [1159.601967] device veth1033d9e left promiscuous mode  
Sep 24 18:49:58 display4 kernel: [1159.601989] br-6fb49e4cfc4e: port 1(veth1033d9e) entered disabled state  
Sep 24 18:50:23 display4 kernel: [1184.855451] br-6fb49e4cfc4e: port 1(veth82f8304) entered blocking state  
Sep 24 18:50:23 display4 kernel: [1184.855498] br-6fb49e4cfc4e: port 1(veth82f8304) entered disabled state  
Sep 24 18:50:23 display4 kernel: [1184.856293] device veth82f8304 entered promiscuous mode  
Sep 24 18:50:26 display4 kernel: [1188.007735] eth0: renamed from veth0d37c8c  
Sep 24 18:50:26 display4 kernel: [1188.036978] IPv6: ADDRCONF(NETDEV\_CHANGE): veth82f8304: link becomes ready  
Sep 24 18:50:26 display4 kernel: [1188.037079] br-6fb49e4cfc4e: port 1(veth82f8304) entered blocking state  
Sep 24 18:50:26 display4 kernel: [1188.037088] br-6fb49e4cfc4e: port 1(veth82f8304) entered forwarding state

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [September 25, 2024, 8:58am UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/2 "2024-09-25T08:58:21Z")

</div>

@Dhe, I would like to request for the following logs:

- `server` logs

```bash
cd ~/screenly
docker compose logs -ft anthias-server

```

- `viewer` logs

```auto
cd ~/screenly
docker compose logs -ft anthias-viewer

```

- `nginx logs`

```bash
cd ~/screenly
docker compose exec -it anthias-nginx
tail -f /var/log/nginx/error.log # You can also check `/var/log/nginx/access.log` as well.

```

---

<div class="post-metadata">

**Author:** ![Dhe](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@Dhe](https://forums.screenly.io/u/Dhe)\
**Post date:** [September 30, 2024, 2:12pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/3 "2024-09-30T14:12:11Z")

</div>

> [@nicomiguelino](#):
>
> `docker compose exec -it anthias-nginx`

root@myhost:/home/root/screenly# docker compose exec -it anthias-nginx  
requires at least 2 arg(s), only received 1

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [September 30, 2024, 3:16pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/4 "2024-09-30T15:16:30Z")

</div>

@Dhe, my bad. It should be:

```bash
docker compose exec -it anthias-nginx bash

```

---

<div class="post-metadata">

**Author:** ![Dhe](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@Dhe](https://forums.screenly.io/u/Dhe)\
**Post date:** [September 30, 2024, 3:47pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/5 "2024-09-30T15:47:26Z")

</div>

root@47d53120a19d:/var/log/nginx# tail -f /var/log/nginx/error.log  
2024/09/27 22:48:38 [error] 16#16: \*205 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /cgi-bin/fxm.exe HTTP/1.1”, upstream: “[http://172.18.0.5:8080/cgi-bin/fxm.exe](http://172.18.0.5:8080/cgi-bin/fxm.exe)”, host: “10.227.80.43”  
2024/09/27 22:48:42 [error] 16#16: \*205 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /scripts/fxm.exe HTTP/1.1”, upstream: “[http://172.18.0.5:8080/scripts/fxm.exe](http://172.18.0.5:8080/scripts/fxm.exe)”, host: “10.227.80.43”  
2024/09/27 22:48:42 [error] 16#16: \*215 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /qwe/qwe/index.html HTTP/1.1”, upstream: “[http://172.18.0.5:8080/qwe/qwe/index.html](http://172.18.0.5:8080/qwe/qwe/index.html)”, host: “10.227.80.43”  
2024/09/27 22:48:45 [error] 16#16: \*205 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /fxm.exe HTTP/1.1”, upstream: “[http://172.18.0.5:8080/fxm.exe](http://172.18.0.5:8080/fxm.exe)”, host: “10.227.80.43”  
2024/09/27 22:48:45 [error] 16#16: \*220 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET / HTTP/1.1”, upstream: “[http://172.18.0.5:8080/](http://172.18.0.5:8080/)”, host: “p80-43.dhcp.ece.ufl.edu”  
2024/09/27 22:48:45 [error] 16#16: \*222 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /SiteScope/cgi/go.exe/SiteScope?page=eventLog&machine=&logName=System&account=administrator HTTP/1.1”, upstream: “[http://172.18.0.5:8080/SiteScope/cgi/go.exe/SiteScope?page=eventLog&machine=&logName=System&account=administrator](http://172.18.0.5:8080/SiteScope/cgi/go.exe/SiteScope?page=eventLog&machine=&logName=System&account=administrator)”, host: “p80-43.dhcp.ece.ufl.edu”  
2024/09/27 22:48:48 [error] 17#17: \*224 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /…\pixfir~1\how\_to\_login.html HTTP/1.1”, upstream: “[http://172.18.0.5:8080/](http://172.18.0.5:8080/)…\pixfir~1\how\_to\_login.html”, host: “p80-43.dhcp.ece.ufl.edu”  
2024/09/27 22:48:48 [error] 16#16: \*220 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET / HTTP/1.1”, upstream: “[http://172.18.0.5:8080/](http://172.18.0.5:8080/)”, host: “p80-43.dhcp.ece.ufl.edu”  
2024/09/27 22:48:51 [error] 17#17: \*228 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /note.txt?F\_notini=&T\_note=&nomentreprise=blah&filenote=…/…/windows/win.ini HTTP/1.1”, upstream: “[http://172.18.0.5:8080/note.txt?F\_notini=&T\_note=&nomentreprise=blah&filenote=../../windows/win.ini](http://172.18.0.5:8080/note.txt?F_notini=&T_note=&nomentreprise=blah&filenote=../../windows/win.ini)”, host: “10.227.80.43”  
2024/09/27 22:48:54 [error] 17#17: \*228 connect() failed (113: No route to host) while connecting to upstream, client: 10.241.174.113, server: , request: “GET /note.txt?F\_notini=&T\_note=&nomentreprise=blah&filenote=…/…/winnt/win.ini HTTP/1.1”, upstream: “[http://172.18.0.5:8080/note.txt?F\_notini=&T\_note=&nomentreprise=blah&filenote=../../winnt/win.ini](http://172.18.0.5:8080/note.txt?F_notini=&T_note=&nomentreprise=blah&filenote=../../winnt/win.ini)”, host: “10.227.80.43”

anthias-server-1 | 2024-09-30T14:07:21.067354592Z TypeError: Strings must be encoded before hashing  
anthias-server-1 | 2024-09-30T14:08:22.235358922Z Running migration…  
anthias-server-1 | 2024-09-30T14:08:22.307061064Z Obsolete column (filename) is not present  
anthias-server-1 | 2024-09-30T14:08:22.307177897Z Column (is\_enabled,nocache) already present  
anthias-server-1 | 2024-09-30T14:08:22.307206730Z already has primary key  
anthias-server-1 | 2024-09-30T14:08:22.307231064Z Column (play\_order) already present  
anthias-server-1 | 2024-09-30T14:08:22.307254934Z Column (is\_processing) already present  
anthias-server-1 | 2024-09-30T14:08:22.307277952Z Column (skip\_asset\_check) already present  
anthias-server-1 | 2024-09-30T14:08:22.307402619Z Migration done.  
anthias-server-1 | 2024-09-30T14:08:24.400299993Z Traceback (most recent call last):  
anthias-server-1 | 2024-09-30T14:08:24.400440771Z File “/usr/src/app/server.py”, line 46, in   
anthias-server-1 | 2024-09-30T14:08:24.400912361Z from celery\_tasks import shutdown\_anthias, reboot\_anthias  
anthias-server-1 | 2024-09-30T14:08:24.401088379Z File “/usr/src/app/celery\_tasks.py”, line 5, in   
anthias-server-1 | 2024-09-30T14:08:24.401355212Z from lib import diagnostics  
anthias-server-1 | 2024-09-30T14:08:24.401501507Z File “/usr/src/app/lib/diagnostics.py”, line 8, in   
anthias-server-1 | 2024-09-30T14:08:24.401753451Z from . import utils  
anthias-server-1 | 2024-09-30T14:08:24.401896228Z File “/usr/src/app/lib/utils.py”, line 23, in   
anthias-server-1 | 2024-09-30T14:08:24.402162505Z from settings import settings, ZmqPublisher  
anthias-server-1 | 2024-09-30T14:08:24.402305134Z File “/usr/src/app/settings.py”, line 162, in   
anthias-server-1 | 2024-09-30T14:08:24.402610633Z settings = AnthiasSettings()  
anthias-server-1 | 2024-09-30T14:08:24.402753910Z ^^^^^^^^^^^^^^^^^  
anthias-server-1 | 2024-09-30T14:08:24.402785225Z File “/usr/src/app/settings.py”, line 88, in **init**  
anthias-server-1 | 2024-09-30T14:08:24.403100520Z self.load()  
anthias-server-1 | 2024-09-30T14:08:24.403242649Z File “/usr/src/app/settings.py”, line 131, in load  
anthias-server-1 | 2024-09-30T14:08:24.403525648Z self.\_get(config, section, field, default)  
anthias-server-1 | 2024-09-30T14:08:24.403661648Z File “/usr/src/app/settings.py”, line 105, in \_get  
anthias-server-1 | 2024-09-30T14:08:24.404085739Z self[field] = hashlib.sha256(self[field]).hexdigest()  
anthias-server-1 | 2024-09-30T14:08:24.404243942Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^  
anthias-server-1 | 2024-09-30T14:08:24.404276497Z TypeError: Strings must be encoded before hashing

anthias-viewer-1 | 2024-09-30T14:08:16.843583731Z TypeError: Strings must be encoded before hashing  
anthias-viewer-1 | 2024-09-30T14:08:17.692266402Z ./bin/start\_viewer.sh: line 57: kill: (37) - No such process  
anthias-viewer-1 | 2024-09-30T14:09:19.016765718Z ./bin/start\_viewer.sh: line 39: /sys/fs/cgroup/memory/memory.swappiness: No such file or directory  
anthias-viewer-1 | 2024-09-30T14:09:20.908153390Z Traceback (most recent call last):  
anthias-viewer-1 | 2024-09-30T14:09:20.908308982Z File “/usr/src/app/viewer.py”, line 30, in   
anthias-viewer-1 | 2024-09-30T14:09:20.908354704Z from lib.media\_player import MediaPlayerProxy  
anthias-viewer-1 | 2024-09-30T14:09:20.908379481Z File “/usr/src/app/lib/media\_player.py”, line 7, in   
anthias-viewer-1 | 2024-09-30T14:09:20.908403574Z from settings import settings  
anthias-viewer-1 | 2024-09-30T14:09:20.908427370Z File “/usr/src/app/settings.py”, line 162, in   
anthias-viewer-1 | 2024-09-30T14:09:20.908452240Z settings = AnthiasSettings()  
anthias-viewer-1 | 2024-09-30T14:09:20.908475592Z ^^^^^^^^^^^^^^^^^  
anthias-viewer-1 | 2024-09-30T14:09:20.908498629Z File “/usr/src/app/settings.py”, line 88, in **init**  
anthias-viewer-1 | 2024-09-30T14:09:20.908521129Z self.load()  
anthias-viewer-1 | 2024-09-30T14:09:20.908543259Z File “/usr/src/app/settings.py”, line 131, in load  
anthias-viewer-1 | 2024-09-30T14:09:20.908566129Z self.\_get(config, section, field, default)  
anthias-viewer-1 | 2024-09-30T14:09:20.908588684Z File “/usr/src/app/settings.py”, line 105, in \_get  
anthias-viewer-1 | 2024-09-30T14:09:20.908611518Z self[field] = hashlib.sha256(self[field]).hexdigest()  
anthias-viewer-1 | 2024-09-30T14:09:20.908635629Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^  
anthias-viewer-1 | 2024-09-30T14:09:20.908657851Z TypeError: Strings must be encoded before hashing  
anthias-viewer-1 | 2024-09-30T14:09:21.555679137Z ./bin/start\_viewer.sh: line 57: kill: (37) - No such process

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [September 30, 2024, 5:20pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/6 "2024-09-30T17:20:51Z")

</div>

@Dhe, thanks for providing the logs. I’ll further look closer on the issue. It looks like an encoding issue that needs to be fixed. I’ll keep you posted on the fixes.

You can also create a pull request if you’d like. Contributions are always welcome.

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [October 1, 2024, 9:48pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/7 "2024-10-01T21:48:35Z")

</div>

@Dhe, it looks like you’re trying to store the password (in your case it’s “sally”) as it is.  
You have to put a hashed version of your password in `~/.screenly/screenly.conf`.

You can use [this online tool](https://emn178.github.io/online-tools/sha256.html) to get the hashed version of the password. If your password is _ **sally** _, then you should put `97897a111d485af1048bece173d2980a15870ca079281b79c7ca755356847602` instead.

I’ll update the documentation for setting the password via `~/.screenly/screenly.conf`.

---

<div class="post-metadata">

**Author:** ![nicomiguelino](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@nicomiguelino](https://forums.screenly.io/u/nicomiguelino)\
**Post date:** [October 1, 2024, 10:30pm UTC](https://forums.screenly.io/t/502-bad-gateway-error/1591/8 "2024-10-01T22:30:12Z")

</div>

@Dhe, I just created a [pull request](https://github.com/Screenly/Anthias/pull/2078) to modify the documentation for HTTP basic auth. Take note that you can also change your login and password via the web UI (in the _Settings_ page).
