[google-appengine] Re: Intermittent delete failures

2009-08-03 Thread rkluin

I guess taking a couple day off from the problem helped.  When the
issue started I thought the fact that every time the file was reloaded
it worked was strange. I realized why today.

The issue is in how I was defining my placeholder properties.  From
the documentation I was, incorrectly, under the impression that any
model members beginning with an underscore (_) were treated similar to
the other members -- i.e. they are initialized for every instance.
This is NOT the case.  The _members list was growing, until the model
was freshly reloaded into memory.  I had printed the _members list,
BUT I just had not run through enough combinations with it printing to
see the issue happen.

Robert



On Jul 31, 9:47 pm, Holger w...@arcor.de wrote:
 You tested deleting them one by one out of transaction. Did you test a
 version without ancestor relations set too? (Just these relations may
 be the reason, as change is blocked within an ancestor group as long
 as another change is not finished.)

 If such tests don't help, maybe it's an appengine issue. In your place
 I would create some demo code and upload it to a test page with two
 buttons (create 10 items, delete 5 items) always showing the resulting
 number, thus demonstrating that deleting sometimes failes.
--~--~-~--~~~---~--~~
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-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Intermittent delete failures

2009-07-31 Thread rkluin

I am having deletes intermittently fail -- without error.  When I
check the number of records that will be deleted (by printing out
immediately before deletion) it is correct.  I call db.delete() and
receive no errors, but the entities are not deleted.  A snippet of
the problem code:
db.delete(MyChildModel.all(keys_only=True).ancestor
(myParentModelInstance))

Anyone have any thoughts?


This is a more complete discussion of the problem followed by more
complete code:

Below is a slightly condensed version of the code.  Basically the
handler is called, and a group instance is either created or fetched,
by key, from the datastore at the top of the post handler.  The posted
variables are then validated and assigned to the corresponding group
instance properties.

One of the variables is a list of members.  I validate each entry to
verify that the supplied key is valid and of the correct kind.  Then I
attempt to save the group and child group-member entries.  In this
case I know all groups are very small typically 4 to 6 members, never
over 10.  Instead of a lookup to figure out who is and is not still
in the group I just wipe out any existing groupmember entries and
recreate them all, for the current group.

This is where the issue comes in.  Sometimes the GroupMember records
are deleted and sometimes they are not.  It seems to work almost
randomly on both the development and production servers.  However, on
the development server, simply re-saving the file with NO code changes
causes a recompile and it works every time.  On the production
servers, if I wait a few minutes then hit save it works every time.
It seems like each time the file is freshly loaded it works.


class GroupEditHandler(webapp.RequestHandler):
  def post(self):
# get post vars and build group instance here
groupKey = self.request.get('groupKey')
if groupKey:
  try:
group = Group.get(db.Key(groupKey))
  except:
self.handleError()
return
else:
  group = Group(organization=self.session
['organizationKey'],division=self.session['divisionKey'])

#  fetch and set other varaibles here #

memberValues = self.request.get('members',allow_multiple=True)
# loop over each memberKey and validate it.
for member in memberValues:
  # be sure it at least has something in it
  if member:
try:
  # Convert variable to a db.Key and look it up through the
  # Person kind to be sure it is the correct type.
  member = Person.get(db.Key(member))
  if member:
# It is good, add it to the temp member list.
group._members.append(member)
  else:
# handle invalid member
except:
  # handle member lookup related failure

self.saveGroup(group)


  def saveGroup(self,group):
def txn():
  key = None
  key = group.put()
  if key:
# handle name search object and tag search objects here

if group._members:
  # Just wipe all members out, the membership is small (10
members / group)
  # This is the problem line.  No errors, the items are being
returned
  # ... they are just not being deleted consistently.
  db.delete(groupMember.all(keys_only=True).ancestor(group))

  # Build a new set of members and write it.
  db.put([groupMember(parent=group,
  organization=self.session
['organizationKey'],
  division=self.session
['divisionKey']),
  member=member,
  memberName=member.name)
for member in group._members])
return True
  return False
return db.run_in_transaction(txn)



# Models, for reference
class Group(db.Expando):
owner = db.UserProperty(auto_current_user_add=True)
organization = db.ReferenceProperty
(reference_class=Organization,required=True)
division = db.ReferenceProperty
(reference_class=Division,required=True)

name = db.StringProperty(multiline=False)
active = db.BooleanProperty(default=True,required=True)

# Place holders
_search = []
_tags = []
_members = []

# If we just call organization.key() the organization will be
dereferenced,
#  costing us a datastore call (and time)
def organizationKey(self):
 Needed to avoid dereffing the organization to get the key

return Group.organization.get_value_for_datastore(self)

def divisionKey(self):
 Needed to avoid dereffing the division to get the key 
return Group.division.get_value_for_datastore(self)


class GroupMember(db.Model):
organization = db.ReferenceProperty
(reference_class=Organization,required=True)
division = db.ReferenceProperty
(reference_class=Division,required=True)
member = db.ReferenceProperty

[google-appengine] Re: Intermittent delete failures

2009-07-31 Thread rkluin

I probably should note several things I have already tried:
1) I moved the deletion step outside of the transaction.
2) Instead of using the bulk delete  method, I looped through
deleting one-by-one (both in and out of the transaction).

All combinations produced the same results, sometimes the records are
deleted sometimes they are not.

Robert

On Jul 31, 8:22 pm, Holger w...@arcor.de wrote:
 Maybe you are lucky and someone takes the time to work through your
 code.

 If not you should be able to solve your problem by changing your code
 step by step.

 Go back to a version (or create a simple one) where deleting works
 corretly. Then change it into the direction of your faulty code and
 test which step makes the delete fail.
--~--~-~--~~~---~--~~
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-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: iPhone cannot log in any more, system-wide issue, Google pls help

2009-05-12 Thread rkluin

I created an issue to report this problem, see Issue #1524.

The sign in page appears broken on the iPhone.  There is no
application name, it just says New Service.  My apps domain-specific
applications are working fine.

Robert Kluin

---
Ezox Systems, LLC
www.ezoxsystems.com


On May 11, 9:59 am, baytiger troels...@gmail.com wrote:
 Possibly we should add the issue in the tracker... There currently is
 one but it has to do with a wrongly entered password and not with the
 login actually not working even if provided with correct
 credidentials...

 Everybody I know who is on app engine is facing this problem.

 On May 11, 12:16 pm, Pankaj Vishwani pankajvishw...@gmail.com wrote:

  I have been getting this for past two days too.
  Can someone please look into it since we are launching our website
  (www.wallpipe.com) on Monday (7:00pm PST).

  Thanks!!

  On May 10, 1:54 pm, mckoss mck...@gmail.com wrote:

   This is also failing with the Google Android browser (G1 phone).
   Didn't every Google employee get this phone for Christmas?  Why has
   this fatalerrorin AppEngine persisted for over 36 hours?

   On May 9, 4:14 am, tijer troels...@gmail.com wrote:

To reproduce the problem go to the google-developed app
shell.appspot.com and try to login with aniphone.

It not having aniphonethen spoof the useragent to theiphone(like
with Safari 4's debug menu) and try logging in then. It fails with a
   500-errorpage.

What to do? This has been going on for two days now.

It really sux when you're developing aniPhoneapplication :)

--~--~-~--~~~---~--~~
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-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---