-
Notifications
You must be signed in to change notification settings - Fork 3.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
Improve validation error messages for DBRP API #20134
Comments
Let's also make the "Invalid ID" error messages disambiguate which ID(s) are invalid. (See re-used errors here: https://github.com/influxdata/influxdb/blob/master/dbrp/http_server_dbrp_test.go#L185). |
@Hualin-AUG -- you might also consider trying the updated CLI which now has DBRP commands which should make this a bit easier to manage the mappings themselves. https://docs.influxdata.com/influxdb/v2.0/reference/cli/influx/v1/dbrp/ We'll improve the error messages here in parallel. |
+1 to more specific error messages. In that same direction, I suspect the actual error here is/was that the Cloud implementation expects I don't think either impl is validating that requests contain all the expected keys. When there's a mismatch, the system ends up with an empty string for one (or both) IDs, and the empty string fails validation. The most specific validation error would be something like |
@Hualin-AUG if the new CLI tools don't work for you, could you also try using |
That absolutely solves the problem. |
@Hualin-AUG thanks for the bug-report. Really helpful as we iron out some usability gotchas here! |
Steps to reproduce:
List the minimal actions needed to reproduce the behavior.
curl --request POST 'https://us-west-2-1.aws.cloud2.influxdata.com/api/v2/dbrps'
--header 'Authorization: Token {my token}'
--header 'Content-type: application/json'
--data '{
"bucketID": "{my bucketID}",
"database": "{some database name}",
"default": true,
"orgID": "{my orgID}",
"retention_policy": "30days"
}'
Expected behavior:
A DBRP should be setup for the bucket I give
Actual behavior:
400 Bad request error happens with following message
{
"code": "invalid",
"message": "invalid ID"
}
Environment info:
Config:
Token I use an all permission token
The text was updated successfully, but these errors were encountered: