Skip to content
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

.set stored_query_result command returns 400 - Bad Request #820

Closed
MSDkuznetsov opened this issue Mar 20, 2024 · 5 comments
Closed

.set stored_query_result command returns 400 - Bad Request #820

MSDkuznetsov opened this issue Mar 20, 2024 · 5 comments
Assignees
Labels

Comments

@MSDkuznetsov
Copy link

What happened:

I wanted to use the https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/set-stored-query-result-command to store the state.

According to documentation, to use this command "You must have Database Viewer permissions to run these commands." - which is the case, I have confirmed that Grafana account has the appropriate permission, I have also tried to use my own principal with the same results.

image

What you expected to happen:

  • To be able to store the state when dashboard is loaded (as a caching mechanism) or at least have some clarity about the restrictions if there are any, so that appropriate error message is shown - "not allowed to be executed, due to policy" something like that.

How to reproduce it (as minimally and precisely as possible):

  1. Go to any dashboard
  2. Add new panel that relies on Azure Data Explorer as data source
  3. Type in the following kql statement:
.set-or-replace stored_query_result Numbers3 <| range X from 1 to 10 step 1
  1. Load the query
  2. Failure will be shown

Anything else we need to know?:

btw reading stored query results, works just fine:

.show stored_query_results

image

Environment:

  • Grafana version: Azure Managed Grafana - Grafana v10.3.4 (5bde27379c)
@aangelisc
Copy link
Contributor

Hi @MSDkuznetsov, thank you for the report. I can confirm I've replicated the behaviour in Grafana. However, I also see issues when executing this query in Azure directly:

Image

Are you able to confirm if this is an Azure issue?

@aangelisc aangelisc moved this from Incoming to Waiting in Partner Datasources Mar 20, 2024
@MSDkuznetsov
Copy link
Author

I see no issues from my side, works as expected. Based on the error it seems to me like it's some other error related to connection.
image

Hi @MSDkuznetsov, thank you for the report. I can confirm I've replicated the behaviour in Grafana. However, I also see issues when executing this query in Azure directly:

Image

Are you able to confirm if this is an Azure issue?

@aangelisc
Copy link
Contributor

Hi @MSDkuznetsov,

The actual underlying issue is that these queries aren't supported by the endpoint Grafana uses. The true error is:

Bad request: Control commands (starting with a dot '.') cannot be served from the query endpoint unless they are .show control commands.

I've added a task to improve the error messages so this is made clearer to the user.

@MSDkuznetsov
Copy link
Author

Hi @MSDkuznetsov,

The actual underlying issue is that these queries aren't supported by the endpoint Grafana uses. The true error is:

Bad request: Control commands (starting with a dot '.') cannot be served from the query endpoint unless they are .show control commands.

I've added a task to improve the error messages so this is made clearer to the user.

Thanks, that makes sense !

@aangelisc aangelisc self-assigned this Mar 20, 2024
@aangelisc
Copy link
Contributor

Fixed by #822

@github-project-automation github-project-automation bot moved this from Waiting to Done in Partner Datasources Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants