Problem with GAE Datastore Viewer

121 views
Skip to first unread message

bartprokop

unread,
Dec 2, 2011, 3:55:14 AM12/2/11
to Google App Engine, edzi...@isocom.eu
Hi, My application is developed in JAVA, utilizing JDO.
Unfortunatelly, I started today getting starnge errors - 500 when
trying to run GQL queries on my data:

SELECT * FROM Przedszkole where __key__ =
Key('agtzfmUtZHppZWNrb3ITCxILUHJ6ZWRzemtvbGUYgooIDA')

results with Server error 500 and strange message: "address must not
be empty."

My application is http://e-dziecko.appspot.com .

Any hint on this?

More funny, access object programatically seems to work without any
interruption.

Ikai Lan (Google)

unread,
Dec 2, 2011, 1:16:29 PM12/2/11
to google-a...@googlegroups.com
HI bart,

Oy, I know what is causing this. The datastore admin is written using Python which has validations for fields like Address or GeoPt. The Java code does not, so it's possible to set this to null, which would cause this to error out.

In general I advise people to use StringProperty as much as possible. To fix this, you have two choices:

1. Change the Address property to be non-null programmatically
2. Change the property on all entities to be a String property. You'll probably use App Engine mapreduce for this.

I'm going to make a list of "polish" bugs and feature requests that I'm going to champion in an upcoming release. I'm wondering what the implications of a quick and dirty fix to remove the validations are. Unfortunately, if history is any kind of a teacher, the fix is NEVER that easy.

--
Ikai Lan 
Developer Programs Engineer, Google App Engine




--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.


bartprokop

unread,
Dec 6, 2011, 3:39:17 AM12/6/11
to Google App Engine
Hi Ikai,

Thanks for your reply. Anyway, the problem is a bit deeper. When I set
the property to null, my App Engine Data Vievwer panel was fixed. So
null is valid value for my field. Before that, I accessed the field
programically (JAVA through JDO) and get very strange value for that
field:

com.google.appengine.api.datastore.PostalAddress@0 <- zero is probably
bad value here.

I suppose that it was a bug in JDO when persisting the entity do
DataStore. After fixing property (setting it to null), it seems to
work.

Rimma Rosenberg

unread,
Jan 8, 2015, 10:57:07 AM1/8/15
to google-a...@googlegroups.com, ika...@google.com
Hi Ikai,

Could you please tell me what I am doing wrong. I am trying to run GQL queries from Google App Engine site from Datastore Viewer.
1. I tried with '6192449487634432',  6192449487634432L,  '6192449487634432L'

SELECT * FROM Docprod where __key__ = KEY('Docprod', 6192449487634432)

2. Docprod is a child of 'mrwdocbkup', so I tried also without any success:

SELECT * FROM Docprod where _key_ = KEY('mrwdocbkup', 4922171302346752, 'Docprod', 6192449487634432 )

value of the key I found in ID/Name column of all records (SELECT * FROM Docprod)

I would like to use GAE Datastore for my app, but I need to know that if my customer will have a problem I will be able to run quick query to be able to provide better customer support. 

Thank you,

Rimma

Vinny P

unread,
Jan 12, 2015, 4:20:52 AM1/12/15
to google-a...@googlegroups.com
On Thu, Jan 8, 2015 at 9:57 AM, Rimma Rosenberg <rim...@gmail.com> wrote:
Could you please tell me what I am doing wrong. I am trying to run GQL queries from Google App Engine site from Datastore Viewer.
1. I tried with '6192449487634432',  6192449487634432L,  '6192449487634432L'

SELECT * FROM Docprod where __key__ = KEY('Docprod', 6192449487634432)

2. Docprod is a child of 'mrwdocbkup', so I tried also without any success:

SELECT * FROM Docprod where _key_ = KEY('mrwdocbkup', 4922171302346752, 'Docprod', 6192449487634432 )



Can you confirm that you're using two underscores before and after the key limiter, instead of just one? I.e. __key__ instead of _key_. From your example above, the first select command properly uses two underscores, but the second select command uses only 1 underscore before and after. If it still doesn't work, can you screenshot the error screen that pops up?

If you can't get the GQL query to work, try using the Datastore Query page in the new cloud console. Go to cloud.google.com/console, click on your project, then navigate through Storage > Cloud Datastore > Query on the navigation bar. You'll see a page that looks like this: http://imgur.com/KKZWaFn . That interface is a bit easier to use to find a particular entity.

 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

dele...@gmail.com

unread,
Mar 25, 2015, 6:45:42 AM3/25/15
to google-a...@googlegroups.com
For switching between "key encoded string" and "separate key fields" (for debug purpose, but not only) you may use this web interface I made : http://datastore-key.appspot.com/

Valentin
Reply all
Reply to author
Forward
0 new messages