属性用户在数据存储区中已损坏:

时间:2011-05-04 08:38:30

标签: python google-app-engine

您好我收到一条奇怪的错误消息:Property user is corrupt in the datastore 你能告诉我它意味着什么,我该怎么做?这是完整的痕迹

2011-05-04 01:35:15.144

Property user is corrupt in the datastore:
Traceback (most recent call last):
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 958, in _FromPb
    value = datastore_types.FromPropertyPb(prop)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore_types.py", line 1785, in FromPropertyPb
    _strict_mode=False)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/users.py", line 115, in __init__
    assert _auth_domain
AssertionError
Traceback (most recent call last):
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 698, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/classifiedsmarket/dev.350122009565563926/i18n.py", line 266, in get
    ads = Ad.all().filter("modified >", timeline).filter("published =", True).filter("modified <=", bookmark ).order("-modified").fetch(PAGESIZE+1)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 2025, in fetch
    raw = raw_query.Get(limit, offset, config=config)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 1504, in Get
    batch = batcher.next_batch(limit)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2220, in next_batch
    batch = self.__next_batch.get_result()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 592, in get_result
    return self.__get_result_hook(self)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 1998, in __query_result_hook
    self.__results = self._process_results(query_result.result_list())
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_query.py", line 2031, in _process_results
    for result in results]
  File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 127, in pb_to_query_result
    return self.pb_to_entity(pb)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 242, in pb_to_entity
    return Entity._FromPb(pb)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 962, in _FromPb
    (prop.name(), traceback.format_exc()))
Error: Property user is corrupt in the datastore:
Traceback (most recent call last):
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 958, in _FromPb
    value = datastore_types.FromPropertyPb(prop)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore_types.py", line 1785, in FromPropertyPb
    _strict_mode=False)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/users.py", line 115, in __init__
    assert _auth_domain
AssertionError
编辑:这是我的整个模型。我没有为几次部署更改它:

class Ad(GeoModel,search.SearchableModel):   
    primary_image = blobstore.BlobReferenceProperty() 
    ip=db.StringProperty(indexed=False,verbose_name="ip")
    ipcountry=db.StringProperty(indexed=False,verbose_name="origin")
    tags=db.ListProperty(db.Category)
    category=db.CategoryProperty(choices=('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31'),default='1',verbose_name="Category") #numeric for now    
    title=db.StringProperty(verbose_name="title")#required
    type=db.StringProperty(choices=('w','s','r','l','b'),default='s',verbose_name="ContentType")#sell,wanted,rent,lease,buy
    company_ad=db.BooleanProperty(default=False,verbose_name="company_ad")#false or nothing
    user=db.UserProperty(verbose_name="userid") 
    facebookID=db.IntegerProperty(verbose_name="facebook id") 
    twitterID=db.IntegerProperty(verbose_name="twitter id")
    im=db.IMProperty(verbose_name="nickname")#optional, xmpp
    place=db.StringProperty()# postaladdress should work
    url=db.StringProperty(verbose_name="url")
    link=db.LinkProperty(verbose_name="Link")#enable
    geopt=db.GeoPtProperty(verbose_name="geopt") 
    geohash=db.StringProperty(indexed=False,verbose_name="geocode")#should we use this? 
    rating=db.RatingProperty()
    text=db.TextProperty(verbose_name="text")
    currency=db.StringProperty(choices=('EUR','ARS','AUD','BRL','GBP','CAD','CZK','DKK','HKD','HUF','ILS','INR','JPY','MXN','NZD','NOK','PLN','PHP','SGD','SEK','SGD','CHF','USD', 'THB','TWB'),verbose_name = "Currency")
    price=db.StringProperty(verbose_name="price")#floatfree, digits, decimals, regexable or integer valid8able
    phonenumber=db.PhoneNumberProperty(indexed=False,verbose_name="phonenumber")#viewbit
    postaladress=db.PostalAddressProperty(indexed=False,verbose_name="postaladdress")
    phoneview=db.BooleanProperty(default=False,verbose_name="phoneview")#add2phone
    email=db.EmailProperty(indexed=False,verbose_name="Email")#optional
    name=db.StringProperty(verbose_name="Name") 
    #owner=db.UserProperty(verbose_name="Owner") 
    published=db.BooleanProperty(default=True,verbose_name="published")
    #submitted=db.BooleanProperty(default=False,verbose_name="submitted")#edit
    #montao=db.BooleanProperty(default=False,verbose_name="montao")#migr8
    #moderated=db.BooleanProperty(default=False,verbose_name= "moderated")#edit
    added=db.DateTimeProperty(verbose_name="added",auto_now_add=True)#readonly
    modified=db.DateTimeProperty(verbose_name="modified",auto_now_add=True)   
    last_modified = db.DateTimeProperty(required=True, auto_now=True)
    crypted_password=db.StringProperty()#set default true random
    salt=db.StringProperty()# merge with passwrd, set default true random or why even store? counterexample
    timestamp=db.DateTimeProperty(auto_now=True)#backupsystem
    def __unicode__(self):
        return self.title
    def to_json(self):
        data={}
        for prop in self.properties().values():
            data[prop.name] = prop.get_value_for_datastore(self)
        return simplejson(data)    
    def __encrypt(self, plaintext, salt=""):
        """returns the SHA1 hexdigest of a plaintext and salt"""
        phrase = hashlib.sha1()
        phrase.update("%s--%s" % (plaintext, salt))
        return phrase.hexdigest()
    def set_password(self, new_password):
        """sets the user's crypted_password"""
        #from datetime import datetime, timedelta  
        import datetime
        if not self.salt:
            self.salt = self.__encrypt(str(datetime.datetime.now()))
        self.crypted_password = self.__encrypt(new_password, self.salt)
    def check_password(self, plaintext):
        return self.__encrypt(plaintext, self.salt) == self.crypted_password
    def next(self):#enable
        return Ad.all().filter("published =", True).filter("modified >", self.modified).get()    
    def prev(self):#enable
        return Ad.all().filter("published =", True).filter("modified <", self.modified).get()
return levenshtein(self.text,self.prev().text)
    '''
    def uri2view(self):#enable get_serving_url
        return images.get_serving_url(str(self.matched_images.get().primary_image.key()))+'=s100'
    def kmluri2view(self):#enable get_serving_url
        return self.matched_images.get()
    def to_dict(self):
        tempdict1 = dict([(p, unicode(getattr(self, p))) for p in self.properties()])
        tempdict2 = {'key':unicode(self.key())}
        tempdict1.update(tempdict2)
        return tempdict1

编辑2:通过更改变量PAGESIZE,我可以为最近的实体加载页面。我找不到错误开始/结束的位置:def get(self, cursor=None, limit=60, PAGESIZE = 1):有效,我现在尝试使用更大的PAGESIZE即def get(self, cursor=None, limit=60, PAGESIZE = 10):

2 个答案:

答案 0 :(得分:3)

当从数据存储区中提取实体时,复杂的属性类型(以及实体本身)表示为二进制编码的协议缓冲区。此错误意味着无法使用UserProperty协议缓冲区定义对一个特定用户字段中的二进制数据进行反序列化。它可能没有损坏,只是填充了UserProperty以外的东西。

尝试通过数据存储区查看器加载相关实体,以查看实际存储在用户字段中的内容。

答案 1 :(得分:3)

这是App Engine数据存储区的已知问题。它与您的代码或应用程序无关。

App Engine团队正在努力修复,在您等待的时候发布了一个解决方法:http://groups.google.com/forum/#!topic/google-appengine-python/ClkOIalYD3s