[tor-bugs] #30262 [Core Tor/Stem]: stem.descriptor.remote not handling 'HTTP/1.0 404 Not found' gracefully

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Apr 29 16:36:57 UTC 2019


#30262: stem.descriptor.remote not handling 'HTTP/1.0 404 Not found' gracefully
---------------------------+-----------------------------------
 Reporter:  starlight      |          Owner:  atagar
     Type:  defect         |         Status:  needs_information
 Priority:  Medium         |      Milestone:
Component:  Core Tor/Stem  |        Version:
 Severity:  Normal         |     Resolution:
 Keywords:                 |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+-----------------------------------
Changes (by atagar):

 * status:  new => needs_information


Comment:

 Hi starlight. Stem's descriptor.remote module propagates its underlying
 exception. When downloading through a DirPort this is a
 urllib2.HTTPError...

 {{{
 atagar at morrigan:~/Desktop/stem$ python download_descriptor.py -t server -f
 7FE6E24BF6058EA55717C18D34FCD049307D8D2C
 Downloading server descriptor from 128.31.0.34:9131...

 Traceback (most recent call last):
   File "download_descriptor.py", line 131, in <module>
     main()
   File "download_descriptor.py", line 113, in main
     endpoints = [args.download_from],
   File "/home/atagar/Desktop/stem/stem/descriptor/remote.py", line 487, in
 run
     return list(self._run(suppress))
   File "/home/atagar/Desktop/stem/stem/descriptor/remote.py", line 498, in
 _run
     raise self.error
 urllib2.HTTPError: HTTP Error 404: Servers unavailable
 }}}

 Whereas with an ORPort it is the same stem.ProtocolError...

 {{{
 atagar at morrigan:~/Desktop/stem$ python download_descriptor.py -t server -f
 7FE6E24BF6058EA55717C18D34FCD049307D8D2C --orport 171.25.193.9:80
 Downloading server descriptor from 171.25.193.9:80...

 Traceback (most recent call last):
   File "download_descriptor.py", line 131, in <module>
     main()
   File "download_descriptor.py", line 113, in main
     endpoints = [args.download_from],
   File "/home/atagar/Desktop/stem/stem/descriptor/remote.py", line 487, in
 run
     return list(self._run(suppress))
   File "/home/atagar/Desktop/stem/stem/descriptor/remote.py", line 498, in
 _run
     raise self.error
 stem.ProtocolError: Response should begin with HTTP success, but was
 'HTTP/1.0 404 Not found'
 }}}

 What are you hoping for Stem to do? I suspect your concern might be the
 verbosity of exception chaining in which case that is an artifact of
 python3...

 https://trac.torproject.org/projects/tor/ticket/16348

 > stem.descriptor.remote also has a problem with empty documents

 Could you please re-try with the git codebase? I suspect this is already
 fixed - I get a 404 when I run the command you provided.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30262#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list