App works locally, but fails when uploaded

1 view
Skip to first unread message

Jerome West

unread,
Jun 15, 2008, 8:40:21 AM6/15/08
to Google App Engine
Hi,

I'm currently implementing a very simple project, in the process of
learning App Engine. My project works fine locally on the development
web server. However, after uploading it and trying it online, I find
it fails on this line: -

x = Section.all().ancestor(self).filter("URL = ", SectionURL).get()

What am I doing wrong here? If I've found some kind of a bug, is there
a workaround I can implement? The full error report is shown below: -

Traceback (most recent call last):
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 499, in __call__
handler.get(*groups)
File "/base/data/home/apps/overture/1.4/main.py", line 98, in get
self.response.out.write(Band.Render(SectionURL))
File "/base/data/home/apps/overture/1.4/music.py", line 43, in
Render
x = Section.all().ancestor(self).filter("URL = ",
SectionURL).get()
File "/base/python_lib/versions/1/google/appengine/ext/db/
__init__.py", line 1257, in get
results = self.fetch(1)
File "/base/python_lib/versions/1/google/appengine/ext/db/
__init__.py", line 1301, in fetch
raw = self._get_query().Get(limit, offset)
File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 928, in Get
return self._Run(limit, offset)._Next(limit)
File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 872, in _Run
_ToDatastoreError(err)
File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 1601, in _ToDatastoreError
raise errors[err.application_error](err.error_detail)
InternalError: internal error

Many thanks,
Jerome

Marzia Niccolai

unread,
Jun 16, 2008, 2:23:22 PM6/16/08
to google-a...@googlegroups.com
Hi Jerome,
 First, during the weekend we did experience some intermittent datastore outages, please see:
http://groups.google.com/group/google-appengine-downtime-notify

 If this was not part of the problem you were hitting, would you mind providing some more details?  If you could provide the Section data model, as well as the ancestor data model that would be helpful.  Additionally, it would be nice to have the code that generates the ancestor object on which you are filtering, as well as the data that is stored in the ancestor object.

Thanks,
Marzia

Jerome West

unread,
Jun 17, 2008, 5:10:01 AM6/17/08
to Google App Engine
Hi Marzia,

Thanks for taking the time to look at this for me. I've tried running
the code again and it still seems to display the problem, so it
doesn't seem to be related to the outages you mentioned.

I've created a minimal test case which reproduces the error, and I've
pasted this code in below. It declares the two data models, creates
some test data, and then performs the same query as I was performing
originally. I can successfully run this code locally, but not after
uploading it to the server. I'm quite new to App Engine development,
so it may be that I'm doing something odd in the code, but the fact
that it runs locally but not on the server makes me curious as to what
is happening!

Many thanks,
Jerome


from google.appengine.ext import db

print "AppEngine test case"

# The parent class

class Band(db.Model):
Name = db.StringProperty(required=True)
URL = db.StringProperty(required=True)
Description = db.TextProperty()
Sections = db.ListProperty(db.Key)


# The child class

class Section(db.Model):
Title = db.StringProperty(required=True)
URL = db.StringProperty(required=True)
Type = db.StringProperty(required=True, choices=set(["Gallery",
"News", "Information", "Release", "Event", "People", "Link",
"Contact"]))


# Create one parent Band and two child Sections as test objects

NewBand = Band(Name="Test", URL="Test", Description="A test
description")
NewBand.put()
NewSection = Section(parent=NewBand, Title="News", URL="News",
Type="News")
NewSection.put()
NewBand.Sections.append(NewSection.key())
NewSection = Section(parent=NewBand, Title="Info", URL="Info",
Type="Information")
NewSection.put()
NewBand.Sections.append(NewSection.key())
NewBand.put()


# Try to get from the datastore the Section with a URL of 'Info',
# which is a also child of the Band we just created
# This is the part which works locally but fails when run on the
server

SectionURL = "Info"
TestSection = Section.all().ancestor(NewBand).filter("URL = ",
SectionURL).get()


# If this works, output the Title of the section we retrieved

if (TestSection):
print "Section retrieved: '" + TestSection.Title + "'"








On Jun 16, 7:23 pm, "Marzia Niccolai" <ma...@google.com> wrote:
> Hi Jerome,
> First, during the weekend we did experience some intermittent datastore
> outages, please see:http://groups.google.com/group/google-appengine-downtime-notify
>
> If this was not part of the problem you were hitting, would you mind
> providing some more details? If you could provide the Section data model,
> as well as the ancestor data model that would be helpful. Additionally, it
> would be nice to have the code that generates the ancestor object on which
> you are filtering, as well as the data that is stored in the ancestor
> object.
>
> Thanks,
> Marzia
>
> On Sun, Jun 15, 2008 at 5:40 AM, Jerome West <JeromeCW...@googlemail.com>

Jerome West

unread,
Jun 20, 2008, 6:42:15 AM6/20/08
to Google App Engine
Any update on this? FYI, I have submitted this as issue # 490.

Jerome

Marzia Niccolai

unread,
Jun 20, 2008, 6:49:22 PM6/20/08
to google-a...@googlegroups.com
The issue has been accepted.  We will update it when there is progress.

Thanks,
Marzia
Reply all
Reply to author
Forward
0 new messages