NeedIndexError, even though the index seems to exist

375 views
Skip to first unread message

Logan

unread,
Apr 24, 2008, 1:14:47 AM4/24/08
to Google App Engine
I'm having trouble with a query that looks like this:

SELECT * FROM Quote WHERE deleted = FALSE AND draft = FALSE AND
ancestor IS :account ORDER BY submitted DESC

I've defined a number of indexes, but it seems to me that this one
should support this particular query:

- kind: Quote
ancestor: yes
properties:
- name: deleted
- name: draft
- name: submitted
direction: desc

But for some reason I continue to get NeedIndexErrors. Am I missing
something?

Logan

Brett Morgan

unread,
Apr 24, 2008, 1:20:46 AM4/24/08
to google-a...@googlegroups.com
Is the dev environment not auto-generating the index specification for you?

Logan

unread,
Apr 24, 2008, 1:32:27 AM4/24/08
to Google App Engine
Yes, and I can confirm that when I remove this index locally and run
with --require_indexes, I get an error in the dev environment.

Logan

On Apr 23, 10:20 pm, "Brett Morgan" <brett.mor...@gmail.com> wrote:
> Is the dev environment not auto-generating the index specification for you?
>

Brett Morgan

unread,
Apr 24, 2008, 1:52:21 AM4/24/08
to google-a...@googlegroups.com
I suspect you have a bug on your hands. Wanna raise an issue on the tracker?

http://code.google.com/p/googleappengine/issues/list

Marce

unread,
Apr 24, 2008, 3:22:43 PM4/24/08
to Google App Engine
Hi Logan,
Can I ask you some follow up questions?

From what you've written, it seems like this query normally runs fine
on the development server? You said that when you remove the index
and run with --require_indexes you get an error, which would be
expected if the index is removed.

Is the error your getting on Google App Engine, after you've uploaded
your application? If so, was this particular index uploaded already
along with your application? You can check which indexes are present
by logging in to the Administration Console (http://
appengine.google.com), and clicking on 'Indexes' on the right hand
side under 'Datastore'. If the index is not listed there, then it
wasn't uploaded with your application. You should be able to fix this
by verifying the presence of the index in your index.yaml file and
then uploading the application using appcfg.py.

If the index is present, please file the issue in the issue tracker
that Brett referenced and include your index.yaml file, and the
relevant part of the program that is throwing the error.

Thanks,
Marzia

Markus

unread,
Jun 1, 2008, 1:37:35 AM6/1/08
to Google App Engine
Not sure if this issue has been resolved, but I believe I had the same
exact problem and found a "fix".

I used the following procedure to get things working, but didn't check
along the way to see which of the following steps fixed things. It
might be useful, Logan, if you try this, if you could keep checking
your app after every step to see which one makes the difference (if
any).

Here goes:

1. Empty out all index definitions from index.yaml
2. Run your app in the dev-server WITHOUT require_indexes to rebuild
index.yaml
3. Run "appcfg.py update"
4. Run "appcfg.py vacuum_indexes" (at this step, I got a "Server
Error" report)
5. Run "appcfg.py update"
6. Run "appcfg.py vacuum_indexes" (no more error here)

Cheers,

Markus
Reply all
Reply to author
Forward
0 new messages