qinxuye/cola

Failed to save to db, weakly-referenced object no longer exists

TylerTemp opened this issue · 2 comments

Error when handle bundle: 1760418622, url: http://weibo.com/1760418622/info
weakly-referenced object no longer exists
Traceback (most recent call last):
  File "/Users/tyler/Documents/cola/cola/job/executor.py", line 519, in _parse_with_process_exception
    res = self._parse(parser_cls, options, bundle, url)
  File "/Users/tyler/Documents/cola/cola/job/executor.py", line 442, in _parse
    **options).parse()
  File "/Users/tyler/Documents/cola/app/weibo/parsers.py", line 597, in parse
    weibo_user.save()
  File "/Users/tyler/.pyenv/versions/2.7.10/lib/python2.7/site-packages/mongoengine/document.py", line 304, in save
    self.validate(clean=clean)
  File "/Users/tyler/.pyenv/versions/2.7.10/lib/python2.7/site-packages/mongoengine/base/document.py", line 395, in validate
    field._validate(value, clean=clean)
  File "/Users/tyler/.pyenv/versions/2.7.10/lib/python2.7/site-packages/mongoengine/base/fields.py", line 211, in _validate
    self.validate(value, **kwargs)
  File "/Users/tyler/.pyenv/versions/2.7.10/lib/python2.7/site-packages/mongoengine/fields.py", line 563, in validate
    self.document_type.validate(value, clean)
  File "/Users/tyler/.pyenv/versions/2.7.10/lib/python2.7/site-packages/mongoengine/base/document.py", line 410, in validate
    elif self._instance and hasattr(self._instance, 'pk'):
ReferenceError: weakly-referenced object no longer exists

This sometimes happened when I interrupt a job and try to start it again.

I don't know how to re-produce it :(

Looks like it has some issue to restore from the cache(pickle?). Any way to fix this? Any thing else I can provide?

Have you ever modified the code?

Sorry, you're right. I indeed modified the code... I was trying to handle the JS API exception automatically.