502 Bad Gateway Error

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

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

  • server logs
    cd ~/screenly
    docker compose logs -ft anthias-server
    
  • viewer logs
    cd ~/screenly
    docker compose logs -ft anthias-viewer
    
  • nginx logs
    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.
    

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

@Dhe, my bad. It should be:

docker compose exec -it anthias-nginx bash

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”, 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”, 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”, 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”, 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/”, 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”, 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/…\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/”, 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”, 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”, 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

@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.

@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 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.

@Dhe, I just created a pull request 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).