Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trino Gateway Health check fails when trino cluster has oauth2 enabled #166

Open
JustinR5 opened this issue Jan 18, 2024 · 6 comments
Open

Comments

@JustinR5
Copy link

Whenever Trino gateway runs a health check with the trino backend clusters, it returns an 'Unauthorized to fetch cluster stats' error and sets the status of the cluster to 'false'. When changing trino authentication to 'form' from 'oauth2' the health check works.

@willmostly
Copy link
Contributor

willmostly commented Jan 19, 2024

Trino only currently supports the authorization code flow, so you'll need to switch to JDBC health checks and set up a separate authn mechanism for the gateway service user.

For example, you can set http-server-authorization.types = OAUTH2, PASSWORD and set up the password database with a service user for the Gateway. The gateway only needs access to the system.runtime schema for health checks so you can restrict its access to everything else.

@andythsu
Copy link
Member

andythsu commented Jan 30, 2024

if the auth is oauth2 then useApi has to be set to false, since oauth2 flow doesn't support /ui/api/stats

clusterStatsConfiguration:
  useApi: false

@siminyou
Copy link

Trino only currently supports the authorization code flow, so you'll need to switch to JDBC health checks and set up a separate authn mechanism for the gateway service user.

For example, you can set http-server-authorization.types = OAUTH2, PASSWORD and set up the password database with a service user for the Gateway. The gateway only needs access to the system.runtime schema for health checks so you can restrict its access to everything else.

the issue with JDBC is internal trino clusters might not have TLS enabled (for various reasons) while it is a strict requirement for JDBC client.

@mosabua
Copy link
Member

mosabua commented Feb 14, 2024

TLS is not required for JDBC connections

@oneonestar
Copy link
Member

I think this is resolved by #264

@mosabua
Copy link
Member

mosabua commented Mar 18, 2024

Yeah .. good call @oneonestar .. pleasetest and confirm once the new 7 release is out @JustinR5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants