lyft / presto-gateway

A load balancer / proxy / gateway for prestodb
Apache License 2.0
358 stars 156 forks source link

Getting '401 Unauthorized' in ActiveClusterMonitor #168

Closed pramesh94 closed 2 years ago

pramesh94 commented 2 years ago

After registering a trino backend, I'm able to make queries via presto-gateway but I'm getting these messages in the logs: WARN [2022-04-25 06:00:24,403] com.lyft.data.gateway.ha.clustermonitor.ActiveClusterMonitor: Received non 200 response, response code: 401

I'm running trino version 371 with no UI authentication. The trino admin UI asks for a username (any username works) and generates a JWT auth token. This token is missing when we are making the API call to cluster from presto-gateway to get the cluster health information and hence we're getting 401.

Am I missing something here?

pramesh94 commented 2 years ago

I was able to make it work after adding the below lines in config.properties of the coordinator

    web-ui.authentication.type=fixed
    web-ui.user=user
jotarada commented 2 years ago

I think this should be reopen. It works for non authenticated clusters, but i don't see how to make it work for authenticated clusters. I'm using password authenticated cluster and i'm having the same problem.