You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a SQL query is running is SQL Lab, it can't be stopped error received is "Failed at stopping query."
How to reproduce the bug
Go to the SQL Lab.
Write and run a query.
Click on the STOP button.
Expect to see error "Failed at stopping query."
Expected results
Query should stop running.
Actual results
Query is still runing, unless I kill it from the Trino itself, and failed at stopping query message poppes up.
Screenshots/recordings
No response
Superset version
4.1.1
Python version
3.10
Node version
I don't know
Browser
Chrome
Additional context
I am trying to upgrade my current superset cluster from superset 0.0.0-dev to superste 4.1.1, using the official helm-chart, and official superset images. I have a master, celery worker, redis as broker and postgres as my metadata backend.
My db engine is Trino and when I try to stop queries all I see is the "Failed at stopping query" error and in the master logs I see the /api/v1/query/stop request is always receiving 422 (unprocessable entity).
Also, in the worker logs I don't see that he receives tasks and also no additional logs in the redis instance itself, but they are connected.
When I lookup in the dev tools I see in the stop event this message - "Could not cancel query".
I also tries to use the api myself and stop the query with post request with the generated 'client_id' and the right headers and I got 400 over and over again.
Also in the master logs I see that when the query is submitted it says in the logs : "Running query on a celery worker" but again no logs in the worker.
When I deleted the worker deployment and used only the master, the query did stop properly.
Checklist
I have searched Superset docs and Slack and didn't find a solution to my problem.
I have searched the GitHub issue tracker and didn't find a similar bug report.
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.
The text was updated successfully, but these errors were encountered:
Hey there, @talh3747! I'm here to help you with your Superset issue. I can assist with bug fixes, answer your questions, and guide you on becoming a contributor. Let's dive in and tackle this challenge together!
The issue you're experiencing with query cancellation in Superset's SQL Lab when using Trino as the database engine could be related to several factors. Here are some potential areas to investigate:
Celery Worker Configuration: Ensure that your Celery workers are correctly configured to receive and execute tasks. The CELERY_CONFIG in your superset_config.py should be properly set up, and the Celery worker should be started with the correct command. Verify that the broker URL and result backend are correctly configured and that the necessary imports are included [1].
Query Cancellation Mechanism: Superset uses a cancel_query_id stored in the query's extra JSON payload to identify and cancel queries. Ensure that this ID is being correctly set and retrieved. The client_id is crucial for identifying the query session for cancellation [2][3].
Trino-Specific Settings: Check the settings related to Trino in Superset, such as the QUERY_CANCEL_KEY and QUERY_EARLY_CANCEL_KEY. These are used to manage query cancellation and should be correctly implemented [2].
Error Handling: The 422 (unprocessable entity) error suggests that there might be an issue with the request payload or the way the query cancellation is being handled. Double-check the API request format and ensure that all required parameters are correctly specified.
Logs and Debugging: Since you mentioned that the worker logs do not show task reception, ensure that the Celery worker is running and connected to the broker. Check the logs for any errors or warnings that might indicate connectivity or configuration issues.
Database Engine Support: Ensure that Trino supports the query cancellation features being used. If the cancellation key is not set or if the database engine does not support explicit cancellation, the query cannot be stopped [4].
By addressing these areas, you should be able to identify and resolve the issue with query cancellation in Superset.
Bug description
When a SQL query is running is SQL Lab, it can't be stopped error received is "Failed at stopping query."
How to reproduce the bug
Expected results
Query should stop running.
Actual results
Query is still runing, unless I kill it from the Trino itself, and failed at stopping query message poppes up.
Screenshots/recordings
No response
Superset version
4.1.1
Python version
3.10
Node version
I don't know
Browser
Chrome
Additional context
I am trying to upgrade my current superset cluster from superset 0.0.0-dev to superste 4.1.1, using the official helm-chart, and official superset images. I have a master, celery worker, redis as broker and postgres as my metadata backend.
My db engine is Trino and when I try to stop queries all I see is the "Failed at stopping query" error and in the master logs I see the /api/v1/query/stop request is always receiving 422 (unprocessable entity).
Also, in the worker logs I don't see that he receives tasks and also no additional logs in the redis instance itself, but they are connected.
When I lookup in the dev tools I see in the stop event this message - "Could not cancel query".
I also tries to use the api myself and stop the query with post request with the generated 'client_id' and the right headers and I got 400 over and over again.
Also in the master logs I see that when the query is submitted it says in the logs : "Running query on a celery worker" but again no logs in the worker.
When I deleted the worker deployment and used only the master, the query did stop properly.
Checklist
The text was updated successfully, but these errors were encountered: