sqlalchemy-trino icon indicating copy to clipboard operation
sqlalchemy-trino copied to clipboard

It requires specifying port number `443` when authenticating via username/password

Open shawnzhu opened this issue 2 years ago • 1 comments

The current implementation will keep using default TCP port number 8080 from underneath DB-API driver even using HTTPS:

https://github.com/dungdm93/sqlalchemy-trino/blob/5aea36225cb8352cede5df4499b7d9628011ae50/sqlalchemy_trino/dialect.py#L92-L94

However, this could be documented or it will fail the connection with Connection timeout to port 8080.

Background

I found this error message from superset:

F [SupersetError(message="HTTPSConnectionPool(host='<trino-url>', port=8080): Max retries exceeded with url: /v1/statement (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f722688acd0>, 'Connection to <trino-url> timed out. (connect timeout=30.0)'))", error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Trino', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

Which is obviously a problem of the port number (should use HTTPS port number instead of 8080)

shawnzhu avatar Sep 10 '21 17:09 shawnzhu

will follow up under https://github.com/trinodb/trino-python-client/issues/94

shawnzhu avatar Sep 13 '21 14:09 shawnzhu