You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "berlicon (via GitHub)" <gi...@apache.org> on 2024/06/17 13:42:18 UTC

[I] On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB [superset]

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

   ### Bug description
   
   I have error on Superset/SQL lab when tried to execute command:
   KILL QUERY WHERE query_id='091f6bf3-18b4-4977-89e7-ac9a038a242f' -- GUID of my query
   
   Error: "ClickHouse Connect (Superset) Error - expected string or bytes-like object"
   Query Guid I can see in system.processes: 
   https://clickhouse.com/docs/en/operations/system-tables/processes
   
   I can kill query with this sql command according to:
   https://clickhouse.com/docs/en/sql-reference/statements/kill#kill-query
   
   ### How to reproduce the bug
   
   1. I have Superset and Clickhouse DB connected
   2. Run long running query in Superset/SQL Lab: select * from mytable limit 100000
   3. Go to DBeaver and get active queries: select query_id, * from system.processes
   4. Execute query in another Superset/SQL Lab tab: KILL QUERY WHERE query_id='Guid from step 3'
   5. I have error on Superset: "ClickHouse Connect (Superset) Error - expected string or bytes-like object"
   
   ### Screenshots/recordings
   
   ![error on kill query](https://github.com/apache/superset/assets/18382276/1d17bb26-519d-435c-b28e-7e55fcfc8057)
   
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### 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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29270:
URL: https://github.com/apache/superset/issues/29270#issuecomment-2173448278

   <!-- Greeting -->
   Hey @berlicon! I'm here to assist you with any bugs, questions, and contribute to the repository. Let's tackle this issue together!
   
   <!-- Answer -->
   To resolve the "ClickHouse Connect (Superset) Error - expected string or bytes-like object" when executing the `KILL QUERY` command in Superset/SQL Lab connected to a ClickHouse database, ensure that the parameters passed to the command are of the correct type (string or bytes-like object). 
   
   Here's a code snippet to properly format the `KILL QUERY` command:
   
   ```python
   query_id = "091f6bf3-18b4-4977-89e7-ac9a038a242f"  # Ensure this is a string
   kill_query_command = f"KILL QUERY WHERE query_id = '{query_id}'"
   
   # Execute the command
   database.execute(kill_query_command)
   ```
   
   Make sure that `query_id` is a string. If `query_id` is obtained from another source, convert it to a string before using it in the `KILL QUERY` command.
   
   If the issue persists, check the implementation of the `execute` method in your database connection to ensure it correctly handles the `KILL QUERY` command <sup>[[1]](https://github.com/apache/superset/blob/master/superset/db_engine_specs/clickhouse.py)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #29270: On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB
URL: https://github.com/apache/superset/issues/29270


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #29270:
URL: https://github.com/apache/superset/issues/29270#issuecomment-2744451737

   Closing this, since there's been no feedback to the bot or other corroboration on the issue in about 9 months. If you're still facing this and think it's a bug, we can revisit/reopen as needed, particularly if it's happening in 4.1.1 or newer.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org