-
Notifications
You must be signed in to change notification settings - Fork 100
Trino gateway not able to forward images from Trino due to incorrect encoding #680
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
Comments
Gateway primarily deals with the JSON responses coming back from trino and expects the response in a UTF-8 format which then gets converted to an intermediate String object, this could cause an issue with the png content type. |
Yea I don't think supporting image is on the roadmap |
Thanks for the response. I can describe our usecase for image incase helpful. Currently we have two Trino clusters with hostnames like
We tested that above works fine for JDBC and via other Trino supported clients, but it doesn't give a seamless experience for the UI as all images in UI don't work. Our intent is to have 0 user actions for both programmatic and UI access. Apart from the logo, there are other smaller images like the one used to copy a query text to clipboard that doesn't show up as well. These seem to be using https://www.glyphicons.com/sets/halflings/ which aren't passed successfully via Gateway as well. |
I see. In that case I'd suggest you to open a PR to add image support as this is a pretty unique usecase |
Oh okay. Do you know if there is any plan to add more info regarding Query statistics/ stages etc in the Gateway UI ? Our main intent for routing via Gateway is because Gateway UI doesn't have all information that Trino UI provides. |
I don't think we'll want to support that because we can already see that in Trino's UI. What kind of statistics are you looking for? |
Sorry for the late response. Was thinking Gateway UI would be one stop for all UI related aspects, like the Stage view, Resource Utilization summary, Splits etc, but that maybe too ambitious. |
I'm not able to reproduce this with Trino 454 behind Trino Gateway 13. logo.png downloaded directly from Trino or through Trino Gateway via curl or a browser has the same BLAKE2 hash (
Just my two cents, I'm not sure if it's due to some differences in configuration |
I re-ran Trino v470 and Gateway 13 both locally, with the default configs but seeing different values of b2sum
|
Trino gateway doesn't return a valid response for the images hosted behind the /ui endpoint. For example /ui/assets/log.png.
This results in default/black images being rendered when UI is routed via Trino Gateway. The difference in the responses can be seen by running a curl command for example:
These are what the results look like from the browser:
When hitting the /ui/assets/log.png to Trino directly.
When doing the same via Gateway, response is like:
The first 8 bytes of Hexdump value of the response from going to Trino directly matches the PNG specification https://en.wikipedia.org/wiki/PNG
89 50 4e 47 0d 0a 1a 0a
as show below:Based on https://stackoverflow.com/questions/6543548/whats-going-on-with-this-byte-array, when the StreamReader doesn't recognize the utf-8 encoding it's replaceed with
EF BF BD
which matches the response from GatewayThe text was updated successfully, but these errors were encountered: