Redash Keycloak SAML Issue

I am getting 500 error while connecting over SAML through keycloak

Here is the logs
[2023-01-31 05:06:09,175][PID:9][ERROR][redash.app] Exception on /saml/login [GET]
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 159, in _new_conn
server_1 | (self._dns_host, self.port), self.timeout, **extra_kw)
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py”, line 80, in create_connection
server_1 | raise err
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py”, line 70, in create_connection
server_1 | sock.connect(sa)
server_1 | ConnectionRefusedError: [Errno 111] Connection refused
server_1 |
server_1 | During handling of the above exception, another exception occurred:
server_1 |
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 600, in urlopen
server_1 | chunked=chunked)
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 343, in _make_request
server_1 | self._validate_conn(conn)
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 839, in _validate_conn
server_1 | conn.connect()
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 301, in connect
server_1 | conn = self._new_conn()
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 168, in _new_conn
server_1 | self, “Failed to establish a new connection: %s” % e)
server_1 | urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f46990c3390>: Failed to establish a new connection: [Errno 111] Connection refused
server_1 |
server_1 | During handling of the above exception, another exception occurred:
server_1 |
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 449, in send
server_1 | timeout=timeout
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 638, in urlopen
server_1 | _stacktrace=sys.exc_info()[2])
server_1 | File “/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py”, line 399, in increment
server_1 | raise MaxRetryError(_pool, url, error or ResponseError(cause))
server_1 | urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘172.177.61.191’, port=8443): Max retries exceeded with url: /realms/master/protocol/saml/descriptor (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7f46990c3390>: Failed to establish a new connection: [Errno 111] Connection refused’))
server_1 |
server_1 | During handling of the above exception, another exception occurred:
server_1 |
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/httpbase.py”, line 243, in send
server_1 | r = requests.request(method, url, **_kwargs)
server_1 | File “/usr/local/lib/python3.7/site-packages/requests/api.py”, line 60, in request
server_1 | return session.request(method=method, url=url, **kwargs)
server_1 | File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 533, in request
server_1 | resp = self.send(prep, **send_kwargs)
server_1 | File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 646, in send
server_1 | r = adapter.send(request, **kwargs)
server_1 | File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 516, in send
server_1 | raise ConnectionError(e, request=request)
server_1 | requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘172.177.61.191’, port=8443): Max retries exceeded with url: /realms/master/protocol/saml/descriptor (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7f46990c3390>: Failed to establish a new connection: [Errno 111] Connection refused’))
server_1 |
server_1 | During handling of the above exception, another exception occurred:
server_1 |
server_1 | Traceback (most recent call last):
server_1 | File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 2446, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1951, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File “/usr/local/lib/python3.7/site-packages/flask_restful/init.py”, line 269, in error_router
server_1 | return original_handler(e)
server_1 | File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1820, in handle_user_exception
server_1 | reraise(exc_type, exc_value, tb)
server_1 | File “/usr/local/lib/python3.7/site-packages/flask/_compat.py”, line 39, in reraise
server_1 | raise value
server_1 | File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1949, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File “/usr/local/lib/python3.7/site-packages/flask/app.py”, line 1935, in dispatch_request
server_1 | return self.view_functionsrule.endpoint
server_1 | File “/app/redash/authentication/saml_auth.py”, line 145, in sp_initiated
server_1 | saml_client = get_saml_client(current_org)
server_1 | File “/app/redash/authentication/saml_auth.py”, line 92, in get_saml_client
server_1 | sp_config.load(saml_settings)
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/config.py”, line 382, in load
server_1 | self.load_complex(cnf, metadata_construction=metadata_construction)
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/config.py”, line 316, in load_complex
server_1 | self.load_metadata(cnf[“metadata”]))
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/config.py”, line 425, in load_metadata
server_1 | mds.imp(metadata_conf)
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/mdstore.py”, line 1021, in imp
server_1 | self.load(key, **val)
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/mdstore.py”, line 1009, in load
server_1 | _md.load()
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/mdstore.py”, line 790, in load
server_1 | response = self.http.send(self.url)
server_1 | File “/usr/local/lib/python3.7/site-packages/saml2/httpbase.py”, line 246, in send
server_1 | raise ConnectionError(“%s” % exc)
server_1 | saml2.httpbase.ConnectionError: HTTPSConnectionPool(host=‘172.177.61.191’, port=8443): Max retries exceeded with url: /realms/master/protocol/saml/descriptor (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7f46990c3390>: Failed to establish a new connection: [Errno 111] Connection refused’))
server_1 | [2023-01-31 05:06:09,178][PID:9][INFO][metrics] method=GET path=/saml/login endpoint=saml_auth_sp_initiated status=500 content_type=text/html content_length=290 duration=10.97 query_count=1 query_duration=0.92
server_1 | [2023-01-31 05:06:09,179][PID:9][INFO][metrics] method=GET path=/saml/login endpoint=saml_auth_sp_initiated status=500 content_type=? content_length=-1 duration=12.27 query_count=1 query_duration=0.92
server_1 | [2023-01-31 05:06:09,447][PID:12][INFO][metrics] method=GET path=/favicon.ico endpoint=redash_index status=302 content_type=text/html; charset=utf-8 content_length=369 duration=0.40 query_count=0 query_duration=0.00
server_1 | [2023-01-31 05:06:09,875][PID:11][INFO][metrics] method=GET path=/login endpoint=redash_login status=200 content_type=text/html; charset=utf-8 content_length=2174 duration=16.92 query_count=1 query_duration=0.89
azureuser@redash:~$