Opened 10 months ago

Closed 8 months ago

#30018 closed defect (worksforme)

Unable to download consensus using an ORPort

Reported by: irl Owned by: atagar
Priority: Medium Milestone:
Component: Archived/Stem Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


When trying to use an ORPort to download a consensus, it always fails with this error:

>>> from stem import ORPort
>>> from stem.descriptor.remote import get_consensus
>>> tor26 = ORPort("", 443)
>>> get_consensus(endpoints=[tor26])
<stem.descriptor.remote.Query object at 0x7f8579799080>
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/stem/descriptor/", line 446, in run
    return list(self._run(suppress))
  File "/usr/lib/python3/dist-packages/stem/descriptor/", line 457, in _run
    raise self.error
  File "/usr/lib/python3/dist-packages/stem/descriptor/", line 511, in _download_descriptors
    self.content, self.reply_headers = _download_from_orport(endpoint, self.compression, self.resource)
  File "/usr/lib/python3/dist-packages/stem/descriptor/", line 854, in _download_from_orport
    response = b''.join([ for cell in circ.send(RelayCommand.DATA, request, stream_id = 1)])
  File "/usr/lib/python3/dist-packages/stem/client/", line 262, in send
    raise stem.ProtocolError('Circuit response should be a series of RELAY cells, but received an unexpected size for a
 response: %i' % len(reply))
stem.ProtocolError: Circuit response should be a series of RELAY cells, but received an unexpected size for a response:

Child Tickets

Change History (5)

comment:1 Changed 10 months ago by teor

This looks similar to #30021, where Tor 0.2.9 and later, and Stem running under Python 3.6, disagree about the state of the link.

Which python version are you using?
Try using 3.5 or earlier?

comment:2 Changed 10 months ago by atagar

Status: newneeds_information

Hi irl, I just tried your command with the current git codebase and I think it's working, but not quite sure (the run command has hung for the last minute, but that's more likely because tor26 is taking a while).

I'm 98% sure this is a duplicate of #28961. Do you need anything else?

comment:3 Changed 10 months ago by teor

This issue might also be due to firewall restrictions on tor26, which are intended to slow down large numbers of old tor clients, or custom scripts.

Does it happen with any other authority?

comment:4 Changed 10 months ago by irl

It also happens with moria1. It happens with both Python 3.6 and 3.7 (I don't have 3.5 available just now). I'm using the latest release of stem though, maybe it is fixed in master. I'll try to test this later today.

comment:5 Changed 8 months ago by atagar

Resolution: worksforme
Status: needs_informationclosed

Hi irl, feel free to reopen if you run into further issues.

Note: See TracTickets for help on using tickets.