gcloud.exceptions.BadRequest: 400 - No matching index error after updating index

803 views
Skip to first unread message

harsh savla

unread,
Nov 30, 2016, 4:21:56 PM11/30/16
to Google Cloud Datastore
Hi,

I am running a service in GCE which accesses cloud data store. I created an index for one of the Kinds in data store but then had to update the index. After updating the index I get a 400 error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/srv/certservice/venvs/cs/lib/python2.7/site-packages/gcloud/datastore/query.py", line 463, in __iter__
    self.next_page()
  File "/opt/srv/certservice/venvs/cs/lib/python2.7/site-packages/gcloud/datastore/query.py", line 434, in next_page
    transaction_id=transaction and transaction.id,
  File "/opt/srv/certservice/venvs/cs/lib/python2.7/site-packages/gcloud/datastore/connection.py", line 286, in run_query
    _datastore_pb2.RunQueryResponse)
  File "/opt/srv/certservice/venvs/cs/lib/python2.7/site-packages/gcloud/datastore/connection.py", line 124, in _rpc
    data=request_pb.SerializeToString())
  File "/opt/srv/certservice/venvs/cs/lib/python2.7/site-packages/gcloud/datastore/connection.py", line 98, in _request
    raise make_exception(headers, error_status.message, use_json=False)
gcloud.exceptions.BadRequest: 400 no matching index found. recommended index is:
- kind: Certificate
  properties:
  - name: date_issued
  - name: is_active
  - name: is_temporary
  - name: date_expires


From the GCP console I can see the green ticker next to the index and it's status is 'Serving'. The index contains the properties shown in the traceback.

Do I need to do anything else in order to start using the updated index?

Thanks

harsh savla

unread,
Dec 1, 2016, 2:05:55 PM12/1/16
to Google Cloud Datastore
Found out the cause of the issue. The order of the properties defined in the index matters i.e. properties which are to be used in equality must come before properties which are to be used in inequality in in the index definition.
Reply all
Reply to author
Forward
0 new messages