YAML RepresenterError bug causes reporter removal
At 2013-08-25 17:52:51 None wrote: If a report entry trips over this bug, it fails repeatedly and immediately until the # of retries has exceeded, and the reporter is then removed. For some reason this doesn't blow up with the YAMLReporter (fortunately), but it does cause the OONIBReporter to get punted. :(
[!] Task <ooni.tasks.ReportEntry object at 0x3ed3110> has failed 1 times
Traceback (most recent call last):
File "/home/ooni/ooni-probe/ooni/tasks.py", line 38, in start
self._running = defer.maybeDeferred(self.run)
File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 137, in maybeDeferred
result = f(*args, **kw)
File "/home/ooni/ooni-probe/ooni/tasks.py", line 166, in run
return self.reporter.writeReportEntry(self.measurement)
File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1213, in unwindGenerator
return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks
result = g.send(result)
File "/home/ooni/ooni-probe/ooni/reporter.py", line 258, in writeReportEntry
content += safe_dump(entry)
File "/home/ooni/ooni-probe/ooni/reporter.py", line 117, in safe_dump
return yaml.dump_all([data], stream, Dumper=OSafeDumper, **kw)
File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/yaml/__init__.py", line 190, in dump_all
dumper.represent(data)
File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/yaml/representer.py", line 28, in represent
node = self.represent_data(data)
File "/home/ooni/ooni-probe/ooni/reporter.py", line 73, in represent_data
return SafeRepresenter.represent_data(self, data)
File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/yaml/representer.py", line 67, in represent_data
node = self.yaml_representers[None](self, data)
File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/yaml/representer.py", line 247, in represent_undefined
raise RepresenterError("cannot represent an object: %s" % data)
yaml.representer.RepresenterError: cannot represent an object: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.defer.CancelledError'>:
]
[D] Rescheduling...
This issue was automatically migrated from github issue https://github.com/TheTorProject/ooni-probe/issues/167