Hello Pinot team, We are getting the below error ...
# troubleshooting
p
Hello Pinot team, We are getting the below error when we run the query on Query console and thru postman query ex: select column1 from table html headtitle403 Forbidden/title/head body centerh1403 Forbidden/h1/center /body /html <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page -->
if we put some comment infront of query and run on console, it is working fine ex: // comment select column1 from table
m
Can you check the log on what request reaches Pinot in both cases?
x
do you have auth configured? when you query from the browser, try to check the network request and check request headers.
s
Yes, auth is configured and it is showing up in the network tabs request headers being sent.
Is there some setting in Pinot we need to configure so that every query that is not
select *
requires the comment at the beginning? To summarize, the behavior we have observed requires us to send a
//comment
at the beginning of every query that is not
select *
, otherwise it throws a 403 error. Due to this behavior, the presto connection is also not working. Since its behavior is to turn every
select *
into
select col1, col2, col3
when it pushes the query down to pinot.
x
Please fix the auth first
for presto connection, you need to config auth as well. Please check the presto doc on how to config that
p
we configured auth for presto connection, but still we are facing 403 error
x
then it means your config is wrong
use this
Copy code
pinot.controller-authentication-user

Controller username for basic authentication method.

pinot.controller-authentication-password

Controller password for basic authentication method.
or you can use
pinot.extra-http-headers
to directly put Auth header there
x
note that you need to configure to http and grpc as well
p
as per the doc, we setup configuration
x
cause presto may query pinot server grpc endpoints
s
I can confirm that the auth is being sent from presto. I see the Authorization value used in the presto error message
Since we are having this issue in the Pinot Admin Query Console, Presto, and any Broker query API call we make, is there some Pinot configuration we can look at that we might have gotten wrong?
Are there query validation rules that would require a named/description be added to queries?
s
We are still facing this issue even when removing all auth from the broker and controller. Any other suggestions on where to look to resolve this issue?
x
Can you compare the request sent to Pinot from your application and from Pinot UI?
s
The issue even happens in the Pinot UI
When running in the pinot UI and comparing requests that work vs do not work, the headers and everything match. The only different is the sql statement. I do see this error being logged to the console. Could it be a query priority setting?
x
no, those are just javascript.
could you help me understand, 1. does normal query say
select count(*) from <your-table>
work from UI? 2. does normal query say
select count(*) from <your-table>
work from your application? 3. what query doesn’t work from pinot UI?
s
No that does not work from the UI. I removed the table name for security reasons here but this is the response
However, if I include a comment at the beginning of the sql statement, the it does work
x
oh, place
<your-table>
to a table name from your db
this
//
thing is interesting, it’s likely some security hole I think. I will check. Can you please file a github issue for this one
s
I did put my table name in there when I executed the query, but when I took the screenshot, I removed it and replaced it with <table> to keep our table name private. I will submit a github issue for the // problem
x
oic
can you inspect from the web browser
s
Yes what would you like me to inspect
x
the request header
also just to double check, for auth, you put auth configs in all the controller/broker/servers right ?
s
We disabled the auth for now since you suggested it might be configured wrong, but its still throwing the errors. I redacted some values but here is what is being sent
Copy code
curl 'https://[REDACTED]/sql' \
  -H 'accept: text/plain, */*; q=0.01' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'content-type: application/json; charset=UTF-8' \
  -H 'cookie: [REDACTED]' \
  -H 'origin: https://[REDACTED]' \
  -H 'priority: u=1, i' \
  -H 'referer: https://[REDACTED]/' \
  -H 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \
  --data-raw '{"sql":"select count(*) from [REDACTED] limit 10","trace":false,"queryOptions":""}'
x
Can you check Pinot controller log for any error?
s
No errors are logged for auth errors. Should we change the log level to debug?
x
Is pinot running in k8s or you just run from the binary distribution
can you check the log file not console output, which should have more information in the log file
s
k8s
x
ok, then enter into controller pod
s
I'm checking the logs after setting it to log level debug but still do not see anything related to the error
x
hmm
can you do one thing
run this curl command inside the controller container
you can use
-k
to bypass the https check
s
yeah I can run it. Whats the curl command you want me to run ?
oh you mean the sql command as a curl?
got the same thing from the curl command
x
can you try the local controller port
s
That gave me a response like this
Copy code
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   149  100    40  100   109   3658   9969 --:--:-- --:--:-- --:--:-- 14900
x
do you know the port running on your controller
can you describe the controller pod?
and the pinot controller config
s
Copy code
host: pinot-controller
port: 9000
x
ok
then try
Copy code
curl 'https://localhost:9000/sql' \
-H 'content-type: application/json; charset=UTF-8' \
 --data-raw '{"sql":"select count(*) from [REDACTED] limit 10","trace":false,"queryOptions":""}'
s
I get the same response as the above table
not sure what I changed, but I am getting this response now
ProcessingException(errorCode:180)
x
180 is
Copy code
ACCESS_DENIED_ERROR_CODE
after you remove the auth, have you restart all pinot components? controller/broker/server/minions
and can you also check if controller/broker/server configs have no auth things
s
They are commented out in the configs. I'll try restarting them all again.
x
yes, feeling those configs are not picked up.
s
Okay they have all been restarted and I'm seeing different behavior now. The curls work from the controller pods, but it doesn't work in the query console still. Its still showing the 403 error. I have two pods for controllers, and 2 pods for brokers. I ran curls on each and was able to get successful responses from within the pods but not from the pinot query console ui tool
I did not restart zookeeper. Do I need to?
curls outside the pods not using localhost also result in a 403 still
x
no need for zookeeper
how do you query outside the pod?
is it due to the loadbalancer?
within the pinot container, can you try to query use pinot-controller service name like
http://pinot-controller:9000
?
what’s the response for the failed curl command ?
s
Yes, querying outside the pod with a loadbalancer endpoint. Failed curl using the loadbalancer is the same 403 error mentioned at the beginning of this thread
I'll try to curl with the service name and let you know the result
I get a successful response doing curl with the service name
Starting to think it might be a WAF. Will try disabling it next week and let you know the result
Solved: WAF was blocking the request
Thanks for your help!!
x
🤟
Good to know!