Opened 5 years ago

Closed 2 years ago

#11044 closed defect (wontfix)

No consensus results in empty 'GETINFO ns/name/*' responses

Reported by: atagar Owned by:
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-client, tor-control empty-getinfo
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi Nick, spotted an interesting tor oddity during my flight (due to not having any network connectivity). When calling 'GETINFO ns/name/blarg' without a cached consensus it returns an empty string rather than the expected "Unrecognized key" response.

Repro details...

  1. With a data directory containing a cached consensus things work as expected...
% telnet localhost 9051
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
AUTHENTICATE
250 OK
GETINFO ns/all
[ ... lots of output... ]
GETINFO ns/name/blarg
552 Unrecognized key "ns/name/blarg"
  1. Blow away your data directory when you lack network connectivity.
% mv ~/.tor ~/.tor_bak
% mkdir ~/.tor
% cp ~/.tor_bak/torrc ~/.tor
% cat ~/.tor/torrc 
ControlPort 9051
% tor -f ~/.tor/torrc
...
  1. Now GETINFO for 'ns/all' and any requrest for a relay returns an empty response.
% telnet localhost 9051
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
AUTHENTICATE
250 OK
GETINFO ns/all
250-ns/all=
250 OK
GETINFO ns/name/blarg
250-ns/name/blarg=
250 OK

Interestingly this only seems to concern router status entries. Server descriptors and microdescriptors give us a 'Unrecognized key'...

GETINFO desc/name/blarg
552 Unrecognized key "desc/name/blarg"
GETINFO md/name/blarg
552 Unrecognized key "md/name/blarg"

For my part I noticed this because it caused an integ testing failure during my flight...

======================================================================
ERROR: test_get_network_status
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 977, in test_get_network_status
    self.assertRaises(stem.ControllerError, controller.get_network_status, "blargg")
  File "/usr/lib/python2.7/unittest/case.py", line 471, in assertRaises
    callableObj(*args, **kwargs)
  File "/home/atagar/Desktop/stem/stem/control.py", line 1427, in get_network_status
    raise exc
ValueError: Router status entries (v3) must have a 'r' line:

This doesn't seem like the right tor behavior but if you think it is I can simply have stem check for the empty string. :)

Cheers! -Damian

Child Tickets

Change History (10)

comment:1 Changed 5 years ago by nickm

Keywords: tor-client controller added
Milestone: Tor: 0.2.5.x-final

Hm. I agree that an empty string is poor. Do you also think we should distinguish between the "no consensus" case and the "consensus present but couldn't find that node" case?

comment:2 Changed 5 years ago by atagar

Do you also think we should distinguish between the "no consensus" case and the "consensus present but couldn't find that node" case?

Probably not necessary. The other GETINFO options don't have a special response for that and if a user is wondering 'does tor have a consensus?' then they can check for an empty 'GETINFO ns/all' response.

comment:3 Changed 5 years ago by nickm

Okay, seems plausible to me.

comment:4 Changed 5 years ago by nickm

Milestone: Tor: 0.2.5.x-finalTor: 0.2.???

comment:5 Changed 3 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:6 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:7 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:8 Changed 2 years ago by dgoulet

Unify controller keyword to "tor-control".

comment:9 Changed 2 years ago by dgoulet

Keywords: tor-control added; controller removed

Unify "controller" keyword to "tor-control".

comment:10 Changed 2 years ago by nickm

Keywords: empty-getinfo added
Resolution: wontfix
Severity: Normal
Status: newclosed

Above, I think we decided on wontfix. But if I'm wrong let's reopen.

Note: See TracTickets for help on using tickets.