rabindragogoi opened a new issue, #28326:
URL: https://github.com/apache/superset/issues/28326

   ### Bug description
   
   Superset : 3.0.0
   
   While running a query in SQL LAB with more that 20k records in IN clause, 
the query is not getting submitted in and is returning:
   
   **"superset.databases.commands.exceptions.ValidatorSQLError: 
   PrestoDBSQLValidator was unable to check your query."
   Please recheck your query.
   Exception: HTTPSConnectionPool(host='xxxx.uat.com', port=7778): Max retries 
exceeded with url: /v1/statement (Caused by SSLError(SSLEOFError(8, 'EOF 
occurred in violation of protocol (_ssl.c:2427)')))"**
   
   The error is not in presto side as the query did not even got submitted and 
is failing in the superset itself.
   
   Error Stack trace:
   =======================
   2024-05-03 
02:33:54,745:ERROR:superset.databases.commands.validate_sql:HTTPSConnectionPool(host='XXXX.UAT.com',
 port=7778): Max retries exceeded with url: /v1/statement (Caused by 
SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2427)')))
   Traceback (most recent call last):
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/databases/commands/validate_sql.py",
 line 68, in run
       errors = self._validator.validate(sql, schema, self._model)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/sql_validators/presto_db.py",
 line 174, in validate
       annotation = cls.validate_statement(statement, database, cursor)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/sql_validators/presto_db.py",
 line 146, in validate_statement
       raise ex
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/sql_validators/presto_db.py",
 line 76, in validate_statement
       db_engine_spec.execute(cursor, sql)
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/db_engine_specs/base.py",
 line 1526, in execute
       raise cls.get_dbapi_mapped_exception(ex) from ex
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/db_engine_specs/base.py",
 line 1524, in execute
       cursor.execute(query)
     File "/opt/app-root/lib64/python3.11/site-packages/pyhive/presto.py", line 
269, in execute
       response = self._requests_session.post(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/api.py", line 
115, in post
       return request("post", url, data=data, json=json, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/api.py", line 
59, in request
       return session.request(method=method, url=url, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/sessions.py", 
line 589, in request
       resp = self.send(prep, **send_kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/sessions.py", 
line 703, in send
       r = adapter.send(request, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/adapters.py", 
line 517, in send
       raise SSLError(e, request=request)
   requests.exceptions.SSLError: HTTPSConnectionPool(host='XXXX.UAT.com', 
port=7778): Max retries exceeded with url: /v1/statement (Caused by 
SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2427)')))
   SupersetErrorException
   Traceback (most recent call last):
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/databases/commands/validate_sql.py",
 line 68, in run
       errors = self._validator.validate(sql, schema, self._model)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/sql_validators/presto_db.py",
 line 174, in validate
       annotation = cls.validate_statement(statement, database, cursor)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/sql_validators/presto_db.py",
 line 146, in validate_statement
       raise ex
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/sql_validators/presto_db.py",
 line 76, in validate_statement
       db_engine_spec.execute(cursor, sql)
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/db_engine_specs/base.py",
 line 1526, in execute
       raise cls.get_dbapi_mapped_exception(ex) from ex
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/db_engine_specs/base.py",
 line 1524, in execute
       cursor.execute(query)
     File "/opt/app-root/lib64/python3.11/site-packages/pyhive/presto.py", line 
269, in execute
       response = self._requests_session.post(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/api.py", line 
115, in post
       return request("post", url, data=data, json=json, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/api.py", line 
59, in request
       return session.request(method=method, url=url, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/sessions.py", 
line 589, in request
       resp = self.send(prep, **send_kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/sessions.py", 
line 703, in send
       r = adapter.send(request, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/requests/adapters.py", 
line 517, in send
       raise SSLError(e, request=request)
   requests.exceptions.SSLError: HTTPSConnectionPool(host='XXXX.UAT.com', 
port=7778): Max retries exceeded with url: /v1/statement (Caused by 
SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2427)')))
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/opt/app-root/lib64/python3.11/site-packages/flask/app.py", line 
1484, in full_dispatch_request
       rv = self.dispatch_request()
            ^^^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/flask/app.py", line 
1469, in dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/flask_appbuilder/security/decorators.py",
 line 95, in wraps
       return f(self, *args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/views/base_api.py", line 
127, in wraps
       raise ex
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/views/base_api.py", line 
121, in wraps
       duration, response = time_function(f, self, *args, **kwargs)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/utils/core.py", line 
1526, in time_function
       response = func(*args, **kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^
     File "/opt/app-root/lib64/python3.11/site-packages/superset/utils/log.py", 
line 255, in wrapper
       value = f(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^
     File 
"/opt/app-root/lib64/python3.11/site-packages/superset/databases/api.py", line 
1037, in validate_sql
       validator_errors = ValidateSQLCommand(pk, sql_request).run()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     **File 
"/opt/app-root/lib64/python3.11/site-packages/superset/databases/commands/validate_sql.py",
 line 87, in run
       raise ValidatorSQLError(superset_error) from ex**
   superset.databases.commands.exceptions.ValidatorSQLError: 
PrestoDBSQLValidator was unable to check your query.
   Please recheck your query.
   Exception: HTTPSConnectionPool(host='XXXX.UAT.com', port=7778): Max retries 
exceeded with url: /v1/statement (Caused by SSLError(SSLEOFError(8, 'EOF 
occurred in violation of protocol (_ssl.c:2427)')))
   ======================
   
   The error is throwing out from 
"/opt/app-root/lib64/python3.11/site-packages/superset/databases/commands/validate_sql.py"
   
   **NOTE** : 
   The query gets submitted to Presto and returns back with results if we have 
1k to 3k of records in the IN clause.
   
   
   ### How to reproduce the bug
   
   1. Go to sqllab
   2. create a query with more that 20K records in IN Clause of a query 
   3. Query will be in pending state for a long time and will error out.
   
   ### Screenshots/recordings
   
   
![image](https://github.com/apache/superset/assets/12514180/a1a63972-0a77-4d56-ab25-1b815b2e2b68)
   
   
   
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.11
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [X] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to