FH-CrOSSD / crossd

Critical Open-Source Software Database (CrOSSD)
https://health.crossd.tech
Creative Commons Attribution Share Alike 4.0 International
1 stars 0 forks source link

flower broker page shows error 500 #6

Closed tobiasdam closed 3 months ago

tobiasdam commented 3 months ago

Accessing the /broker page results in a HTTP 500 status code: image

The flower flogs show the following errors:

[I 240716 13:07:19 mixins:228] Connected to redis://:**@redis-service:6379/0
[E 240717 16:46:46 broker:31] Unable to get queues: 'Error while reading from redis-service:6379 : (104, 'Connection reset by peer')'
[E 240717 16:46:46 web:1871] Uncaught exception GET /broker (10.1.75.6)
    HTTPServerRequest(protocol='http', host='<redacted>', method='GET', uri='/broker', version='HTTP/1.1', remote_ip='<redacted>')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/tornado/web.py", line 1786, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/flower/views/broker.py", line 35, in get
        queues=queues)
               ^^^^^^
    UnboundLocalError: cannot access local variable 'queues' where it is not associated with a value
client_loop: send disconnect: Broken pipe

The second one is just a follow-up error caused by the first one. As the logs say Connected to redis just a line before, the Connection reset by peer error is curious.

Debugging showed that the code resulting in Connected to redis actually opens a ssl connection to redis.

After some debugging, the logs of redis give further info:

# Error accepting a client connection: error:0A00010B:SSL routines::wrong version number

Rechecking the docs made clear that I used a wrong connector url. I used the following connector url for both celery workers and flower:

redis://:$RAUTH@redis-service:6379/0?ssl_cert_reqs=required

According to the docs you need to use rediss instead of redis for ssl/tls connections.

There are 2 confusing things about the behaviour shown:

Solution

Use the correct connection url with rediss: instead of redis: