If you are performing an ancestor query, doesn't this imply that you know the ancestor and are using its index in the query?
uses "tomkey" as the ancestor.
If your datastore has no existing entities, then I'm guessing your ancestor does not yet exist in the datastore either, and therefore you get the error message.
Maybe it is not clear in the provided example that the "tomkey" ancestor already exists in the datastore.
Does that make sense? If not, could you please share the code you are trying?
-- Glenn