redash
redash copied to clipboard
Unhandled error on MSSQL server connection using private network and self signed.
trafficstars
Issue Summary
I have setup redash and I tried to connect to my MSSQL server but getting unhandled error (test connection)
Steps to Reproduce
- Setup mssql server on windows server
- Try to connect to mssql server using
IP address,sauser andpassword - Test connection
Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?
Technical details:
- Redash Version: 25.1.0
- Browser/OS: Mozilla Firfox 138.0.4 (64-bit)/Ubuntu 24.04 Server
- How did you install Redash: Docker compose
redash_server | [2025-06-01 08:14:47 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:94)
redash_server | [2025-06-01 08:14:47,145][PID:94][INFO][metrics] method=POST path=/api/data_sources/3/test endpoint=datasourcetestresource status=500 content_type=? content_length=-1 duration=60548.31 query_count=4 query_duration=2.61
redash_server | [2025-06-01 08:14:47 +0000] [94] [ERROR] Error handling request /api/data_sources/3/test
redash_server | Traceback (most recent call last):
redash_server | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 135, in handle
redash_server | self.handle_request(listener, req, client, addr)
redash_server | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 178, in handle_request
redash_server | respiter = self.wsgi(environ, resp.start_response)
redash_server | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2213, in __call__
redash_server | return self.wsgi_app(environ, start_response)
redash_server | File "/usr/local/lib/python3.10/site-packages/werkzeug/middleware/proxy_fix.py", line 182, in __call__
redash_server | return self.app(environ, start_response)
redash_server | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
redash_server | response = self.full_dispatch_request()
redash_server | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
redash_server | rv = self.dispatch_request()
redash_server | File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
redash_server | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
redash_server | File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 489, in wrapper
redash_server | resp = resource(*args, **kwargs)
redash_server | File "/usr/local/lib/python3.10/site-packages/flask_login/utils.py", line 277, in decorated_view
redash_server | return current_app.ensure_sync(func)(*args, **kwargs)
redash_server | File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 109, in view
redash_server | return current_app.ensure_sync(self.dispatch_request)(**kwargs)
redash_server | File "/app/redash/handlers/base.py", line 31, in dispatch_request
redash_server | return super(BaseResource, self).dispatch_request(*args, **kwargs)
redash_server | File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 604, in dispatch_request
redash_server | resp = meth(*args, **kwargs)
redash_server | File "/app/redash/permissions.py", line 71, in decorated
redash_server | return fn(*args, **kwargs)
redash_server | File "/app/redash/handlers/data_sources.py", line 232, in post
redash_server | time.sleep(1)
redash_server | File "/usr/local/lib/python3.10/site-packages/gunicorn/workers/base.py", line 203, in handle_abort
redash_server | sys.exit(1)
redash_server | SystemExit: 1
redash_server | [2025-06-01 08:14:47 +0000] [94] [INFO] Worker exiting (pid: 94)
redash_server | [2025-06-01 08:14:47 +0000] [120] [INFO] Booting worker with pid: 120
I tested it inside redash server container and I was able to connect to server
import pyodbc
conn_string = f'DRIVER={{ODBC Driver 18 for SQL Server}};SERVER=192.168.103.217;DATABASE=my_db_name;UID=sa;PWD=my_password_name;TrustServerCertificate=yes'
conn = pyodbc.connect(conn_string)
cursor = conn.cursor()
cursor.execute("SELECT TOP 10 * FROM bi.my_table_name")
rows = cursor.fetchall()
for row in rows:
print(row)
If you guys add skip ssl/tls or allow self sign ssl it would fix the issue, cause at first I didn't add TrustServerCertificate=yes and I was getting the following error
pyodbc.OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate] (-1) (SQLDriverConnect)')