Note that there are some explanatory texts on larger screens.

plurals
  1. POMigrating an App to High-Replication Datastore - now ancestor issues
    primarykey
    data
    text
    <p>Following these instructions: <a href="http://neogregious.blogspot.com/2011/04/migrating-app-to-high-replication.html" rel="nofollow">http://neogregious.blogspot.com/2011/04/migrating-app-to-high-replication.html</a></p> <p>I have managed to migrate to the high replication datastore however I am now getting the following exception:</p> <pre><code>datastore_errors.BadArgumentError('ancestor argument should match app ("%r" != "%r")' % (ancestor.app(), app)) </code></pre> <p>The model data looks something like this:</p> <pre><code>class base_business(polymodel.PolyModel): created = db.DateTimeProperty(auto_now_add=True) class business(base_business): some_data = db.StringProperty() etc.. class business_image(db.Model): image = db.BlobProperty(default=None) mimetype = db.StringProperty() comment = db.StringProperty(required=False) # the image is associated like so image_item = business_image(parent = business_item, etc... ) image_item.put() </code></pre> <p>The new app name has not been assigned to the ancestor model data. At the moment the data is returned however the logs are being populated with this exception message.</p> <p>The actual stack trace using logging.exception:</p> <blockquote> <p>2011-11-03 16:45:40.211 ======= get_business_image exception [ancestor argument should match app ("'oldappname'" != "'s~newappname'")] ======= Traceback (most recent call last): File "/base/data/home/apps/s~newappname/3.354412961756003398/oldappname/entities/views.py", line 82, in get_business_image business_img = business_image.gql("WHERE ANCESTOR IS :ref_business and is_primary = True", ref_business = db.Key(business_key)).get() File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/<strong>init</strong>.py", line 2049, in get results = self.fetch(1, config=config) File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/<strong>init</strong>.py", line 2102, in fetch raw = raw_query.Get(limit, offset, config=config) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 1668, in Get config=config, limit=limit, offset=offset, prefetch_size=limit)) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 1600, in GetBatcher return self.GetQuery().run(_GetConnection(), query_options) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 1507, in GetQuery order=self.GetOrder()) File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 93, in positional_wrapper return wrapped(*args, **kwds) File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 1722, in <strong>init</strong> ancestor=ancestor) File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 93, in positional_wrapper return wrapped(*args, **kwds) File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 1561, in <strong>init</strong> (ancestor.app(), app)) BadArgumentError: ancestor argument should match app ("'oldappname'" != "'s~newappname'")</p> </blockquote> <p>Is there a way to manually set the app on the model data? Could I do something like this to resolve this?</p> <pre><code>if( ancestor.app() != app ) set_app('my_app') put() </code></pre> <p>Before I do this or apply any other HACK is there something I should have done as part of the data migration?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload