GeezerVison is showing github.com — Datastore: When runQuery fails with index required, the exact index needed should be part of the error message. · Issue #1090 · googleapis/google-cloud-node
Datastore: When runQuery fails with index required, the exact index needed should be part of the error message. #1090DescriptionThis is the current error message when a required index is not found:
ApiError: Precondition Failed - no matching index found.
Many lives would be immeasurably improved if the error looked more like this:
ApiError: Precondition Failed - no matching index found.
Solution: You must add the following index to your index.yaml file:
- kind: Cat
ancestor: no
properties:
- name: name
- name: age
direction: desc
For more info, see: https://cloud.google.com/sdk/gcloud/reference/preview/datastore/create-indexes
Activitychanged the title [-]Datastore.runQuery: When fails with index required, the exact index needed should be part of the error message.[/-] [+]Datastore: When runQuery fails with index required, the exact index needed should be part of the error message.[/+] on Jan 26, 2016krisnye commented on Jan 26, 2016 For instance, this is the query I am currently trying to run:
{
"namespace":null,
"kinds":["Task"],
"filters":[
{
"name":"__key__",
"op":"HAS_ANCESTOR",
"val":{
"name":"9CDFB82D-FC98-2B7F-22C5-A391A0623474",
"kind":"Project",
"path":["Project","9CDFB82D-FC98-2B7F-22C5-A391A0623474"]
}
},
{"name":"parentId =","op":"=","val":"9"}
],
"orders":[{"name":"order","sign":"+"}],
"groupByVal":[],
"selectVal":[],
"autoPaginateVal":true,
"startVal":null,
"endVal":null,
"limitVal":-1,
"offsetVal":-1
}
I get the Error that no matching index is found.
My application has the following index specified:
Task
Includes ancestors parentId ▲ + order ▲
This leaves me unsure of what the problem is, or what index I need to add. stephenplusplus commented on Jan 27, 2016 @pcostell - is it possible/reliable to generate such an error message given the query object and 412 response? pcostell commented on Jan 27, 2016 Yup this has been a rough experience. We are working on adding this to the server error message, so as long as you pass along the error message this should start working soon. stephenplusplus commented on Jan 29, 2016 Cool, that will be a great addition! We pass the raw API message, so the user will get it when it's available.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|