torproject / stem

Python controller library for Tor
https://stem.torproject.org/
GNU Lesser General Public License v3.0
260 stars 75 forks source link

colector issue Failed to decompress #50

Closed toralf closed 3 years ago

toralf commented 4 years ago

This https://github.com/toralf/torutils/blob/f307866d2149bcd3c95df5269b3b48d051f871e9/info.py gave today at relay:

0.4.2.5   10 days, 17:01:05   Fast  Guard  HSDir  Running  Stable  V2Dir  Valid
 resolver=proc  pid=6069  conns=8336
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/stem/descriptor/__init__.py", line 236, in decompress
    return self._decompression_func(self._module, content)
  File "/usr/lib64/python3.6/site-packages/stem/descriptor/__init__.py", line 257, in <lambda>
    ('LZMA', _Compression('lzma', 'lzma', 'x-tor-lzma', '.xz', lambda module, content: module.decompress(content))),
  File "/usr/lib64/python3.6/lzma.py", line 342, in decompress
    raise LZMAError("Compressed data ended before the "
_lzma.LZMAError: Compressed data ended before the end-of-stream marker was reached

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/torutils/info.py", line 232, in <module>
    main()
  File "/opt/torutils/info.py", line 127, in main
    for s in stem.descriptor.collector.get_server_descriptors(start = back):
  File "/usr/lib64/python3.6/site-packages/stem/descriptor/collector.py", line 103, in get_server_descriptors
    for desc in get_instance().get_server_descriptors(start, end, cache_to, bridge, timeout, retries):
  File "/usr/lib64/python3.6/site-packages/stem/descriptor/collector.py", line 439, in get_server_descriptors
    for f in self.files(desc_type, start, end):
  File "/usr/lib64/python3.6/site-packages/stem/descriptor/collector.py", line 674, in files
    self._cached_files = sorted(CollecTor._files(self.index(), []), key = lambda x: x.start if x.start else FUTURE)
  File "/usr/lib64/python3.6/site-packages/stem/descriptor/collector.py", line 648, in index
    response = compression.decompress(stem.util.connection.download(url, self.timeout, self.retries))
  File "/usr/lib64/python3.6/site-packages/stem/descriptor/__init__.py", line 238, in decompress
    raise IOError('Failed to decompress as %s: %s' % (self, exc))
OSError: Failed to decompress as lzma: Compressed data ended before the end-of-stream marker was reached
atagar commented 4 years ago

Thanks toralf. I think I've previously seen this before on occasion. Does this happen consistently or is it sporadic? If the later I likely should introduce retries on our end.

toralf commented 4 years ago

Thanks toralf. I think I've previously seen this before on occasion. Does this happen consistently or is it sporadic? If the later I likely should introduce retries on our end.

happened here just once till now, an immediate repeat was fine

atagar commented 3 years ago

Closing this since it's been quite a while without any further reports. If this comes up again (hopefully with a repro I can use) feel free to reopen.