-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cant save value REST API query - invalid query name autogenerated with query parameters #15368
Comments
This is a query against a Prometheus host.. The query language is PromQL |
hey @rjmercier1 - are you using the GET or POST method for this query? https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries if you're using the GET it might work better to switch to a POST and include your PromQL in the request body |
I have no trouble with the same (GET) query in retool and appsmith. I like budibase in some ways but it just doesnt seem as far along as the others.
… On Jan 21, 2025, at 9:51 AM, Andrew Thompson ***@***.***> wrote:
hey @rjmercier1 <https://github.com/rjmercier1> - are you using the GET or POST method for this query? https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries
if you're using the GET it might work better to switch to a POST and include your PromQL in the request body
—
Reply to this email directly, view it on GitHub <#15368 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABMRU55TB7OFLEYN4KJ7P532LZNHLAVCNFSM6AAAAABVF6RRQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBUHE2DOMBRGU>.
You are receiving this because you were mentioned.
|
hey @rjmercier1 - Budibase automatically names the query based on the REST URL. There's some character in your query parameter value that is invalid for the Query name. I'll keep this issue up to fix the validation problem. In the meantime you can rename the query using the pencil icon to something that can be saved. |
Checklist
Hosting
Describe the bug
A specific rest api parameter makes the query unable to save
To Reproduce
Steps to reproduce the behavior:
Create a rest api with this parameter:
query sum(rate(rfx_instance_net_rd{domain="srs"}[6m]))
Expected behavior
It should save the query
Additional context
docker log at time of error:
{"level":"WARN","timestamp":"2025-01-14T23:01:39.915Z","service":"@budibase/server","err":{"type":"BadRequestError","message":"Invalid query name","stack":"BadRequestError: Invalid query name\n at Object.throw (/app/node_modules/koa/lib/context.js:97:11)\n at save16 (/app/dist/index.js:186293:14)\n at save16 (/app/node_modules/dd-trace/packages/datadog-instrumentations/src/koa.js:88:57)\n at save16 (/app/node_modules/dd-trace/packages/datadog-shimmer/src/shimmer.js:31:21)\n at save16 (/app/node_modules/dd-trace/packages/datadog-shimmer/src/shimmer.js:31:21)\n at dispatch (/app/node_modules/koa-compose/index.js:42:32)\n at /app/dist/index.js:134133:12\n at /app/node_modules/dd-trace/packages/datadog-instrumentations/src/koa.js:88:57\n at /app/node_modules/dd-trace/packages/datadog-shimmer/src/shimmer.js:31:21\n at /app/node_modules/dd-trace/packages/datadog-shimmer/src/shimmer.js:31:21\n at dispatch (/app/node_modules/koa-compose/index.js:42:32)\n at /app/dist/index.js:129554:14\n at /app/dist/index.js:179181:14\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async middleware3 (/app/dist/index.js:166083:20)\n at async /app/node_modules/koa-compress/lib/index.js:38:5\n at async errorHandling (/app/dist/index.js:133918:5)\n at async /app/node_modules/koa-mount/index.js:52:26\n at async userAgent (/app/node_modules/koa-useragent/dist/index.js:12:5)\n at async contentSecurityPolicy (/app/dist/index.js:133997:5)\n at async ip_default (/app/dist/index.js:134158:16)","status":400,"statusCode":400,"expose":true},"pid":29,"tenantId":"default","correlationId":"f1f6b420-af9f-4b87-ae2f-0853d8d2993f","msg":""}
{"level":"INFO","timestamp":"2025-01-14T23:01:39.915Z","service":"@budibase/server","req":{"method":"POST","url":"/api/queries","correlationId":"f1f6b420-af9f-4b87-ae2f-0853d8d2993f"},"res":{"status":400},"responseTime":40,"msg":"request completed"}
The text was updated successfully, but these errors were encountered: