Opened 12 years ago

Last modified 7 years ago

#433 closed defect (Fixed)

Tor 0.1.2.13 - Error initializing dns subsystem

Reported by: geekcq Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.1.2.13
Severity: Keywords:
Cc: geekcq, nickm, arma, phobos Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I just upgraded to Tor 0.1.2.13 on Solaris 8 (Generic_117350-46) and now the service dies out complaing
it cannot read resolv.conf. I even attempted to set the ServerDNSResolvConfFile to another (new)
resolv.conf using my ISP DNS rather than my internal DNS servers thinking the private net and the loopback
might be causing issues. For some reason, the log output at 00:29:59.165 (below) shows tor adding 127.0.0.l
as a DNS server (which there is) but its not defined in the new resolv conf and I even took it out of the
system resolv.conf for one round of testing.

I've poked around and tried running this as mu tor user and then root to rule out permissions issues with
no change. Googling shows the code changes around this, but I'm no coder and unfortunately cant see any
obvious problems.

Debug log Output (running as root for testing):

/opt/csw/bin/tor -f /opt/csw/etc/tor/torrc

May 21 00:29:59.123 [notice] Tor v0.1.2.13. This is experimental software. Do not rely on it for strong anonymity.
May 21 00:29:59.137 [notice] Initialized libevent version 1.1a using method devpoll. Good.
May 21 00:29:59.138 [notice] Opening OR listener on 0.0.0.0:49001
May 21 00:29:59.139 [notice] Opening Socks listener on 127.0.0.1:9050
May 21 00:29:59.140 [notice] Opening Socks listener on 10.15.20.10:9100
May 21 00:29:59.140 [notice] Opening Control listener on 127.0.0.1:9051
[root@lapetus:tor, 00:29:59]> May 21 00:29:59.142 [notice] Tor 0.1.2.13 opening log file.
May 21 00:29:59.143 [debug] parse_dir_server_line(): Trusted dirserver at 18.244.0.188:9031 (46DB)
May 21 00:29:59.143 [debug] parse_dir_server_line(): Trusted dirserver at 18.244.0.114:80 (E45D)
May 21 00:29:59.143 [debug] parse_dir_server_line(): Trusted dirserver at 86.59.21.38:80 (1F85)
May 21 00:29:59.144 [debug] parse_dir_server_line(): Trusted dirserver at 140.247.60.64:80 (F5FC)
May 21 00:29:59.144 [debug] parse_dir_server_line(): Trusted dirserver at 194.109.206.212:80 (EAD6)
May 21 00:29:59.145 [info] or_state_load(): Loaded state from "/opt/csw/var/lib/tor/state"
May 21 00:29:59.147 [debug] parse_addr_policy(): Adding new entry 'accept 10.15.20.0/24'
May 21 00:29:59.147 [debug] parse_addr_policy(): Adding new entry 'accept 127.0.0.1'
May 21 00:29:59.147 [debug] parse_addr_policy(): Adding new entry 'reject *'
May 21 00:29:59.147 [warn] You are running Tor as root. You don't need to, and you probably shouldn't.
May 21 00:29:59.162 [info] crypto_seed_rng(): Seeding RNG from "/dev/urandom"
May 21 00:29:59.164 [info] configure_nameservers(): Parsing resolver configuration in '/etc/resolv.conf'
May 21 00:29:59.164 [info] eventdns: Parsing resolv.conf file /etc/resolv.conf
May 21 00:29:59.165 [info] eventdns: Added nameserver 127.0.0.1
May 21 00:29:59.165 [warn] Unable to parse '/etc/resolv.conf', or no nameservers in '/etc/resolv.conf'
May 21 00:29:59.172 [err] Error initializing dns subsystem; exiting
May 21 00:29:59.233 [info] or_state_save(): Saved state to "/opt/csw/var/lib/tor/state"
May 21 00:29:59.234 [debug] _connection_free(): closing fd 5.
May 21 00:29:59.234 [debug] _connection_free(): closing fd 8.
May 21 00:29:59.235 [debug] _connection_free(): closing fd 9.
May 21 00:29:59.235 [debug] _connection_free(): closing fd 10.

[Automatically added by flyspray2trac: Operating System: Solaris]

Child Tickets

Change History (18)

comment:1 Changed 12 years ago by geekcq

Just in case you are interested heres my resolv.conf for tor:
domain <sanitized>.lan
nameserver nn.nn.nn.nn
nameserver nn.nn.nn.nn

My original system /etc/resolv.conf even more straightforward:
domain <sanitized>.lan
nameserver 127.0.0.1
nameserver 10.15.20.nn

comment:2 Changed 12 years ago by nickm

What does the .nn do? I've never seen it before, and I don't think that we handle it right.

comment:3 Changed 12 years ago by geekcq

sorry, should have specified that I just took the last octet of my internal namserver & the full IP of my
ISP nameservers out. There are actual (valid) numbers there in the true config(s). I've been banging
away at this off and on all day with no change in the outcome. No matter where I put the file (& specify
the location) or how I format resolv.conf, TOR fails out at the same spot. Strange behavior as I've
been running a previous version of the TOR server on this host for a while with no issue.

comment:4 Changed 12 years ago by nickm

Hm, I think I know what this might be, and I think I just fixed it in the version in subversion trunk.
(But even if it isn't fixed, the code in subversion should be better at reporting what exactly went wrong.)

Could you try out the latest subversion code, and see whether it has this problem or not? If it is indeed
fixed, I'll backport the change to appear in the next 0.1.2.x release.

comment:5 Changed 12 years ago by arma

Please let us know if this is still a problem in 0.1.2.14.

comment:6 Changed 12 years ago by nickm

Ah, I may have been barking up the wrong tree. Phobos says:
15:19 < phobos> May 29 15:11:05.431 [warn] Unable to parse '/etc/resolv.conf',

or no nameservers in '/etc/resolv.conf' (6)

comment:7 Changed 12 years ago by geekcq

I just opened a request on the CSW (Blastwave) bugtracker to get 0.1.2.14 built as thats where I sourced the .13 package from. Their bugtracker ID is: http://www.blastwave.org/mantis/view_bug_page.php?f_id=0002262

comment:9 Changed 12 years ago by geekcq

Ok - Sorry for any delay but I was at the CISSE conference last week and that put me out of the loop.
I just installed the 0.1.2.14 version from blastwave main release and the issue still persists. Any
suggestions as to the best approach to get this worked through?

comment:10 Changed 12 years ago by nickm

Do you get the same message as phobos above? (There should be an error code now.)

comment:11 Changed 12 years ago by geekcq

Yes, the error code is exactly the same as you saw on phobos.

Jun 10 14:51:21 lapetus Tor[1090]: [ID 702911 daemon.warning] Unable to parse '/opt/csw/etc/resolv.conf', or no nameservers in '/opt/csw/etc/resolv.conf' (6)
Jun 10 14:51:21 lapetus Tor[1090]: [ID 702911 daemon.error] Error initializing dns subsystem; exiting

comment:12 Changed 12 years ago by nickm

Okay, so there's a bug in eventdns.c. The "6" means that somehow we're getting through
all the calls to resolv_conf_parse_line without actually adding any nameservers.

I don't suppose you have a debugger you can use to step through resolv_conf_parse_line to see whether
it ever calls evdns_nameserver_add? Or to add a breakpoint to evdns_nameserver_add() to see where
it's called from?

comment:13 Changed 12 years ago by geekcq

I have the output of a tor run through truss with debug enabled to stdout in tor. However the site wont let me attach a file for some reason. Let me know if you want me to simply paste it in or send it to you backchannel.

comment:14 Changed 12 years ago by geekcq

Also as an FYI, I tested the 0.2.0.2aplha release that was posted by the maintainer on blastwave testing today with
the same error result. I also provided him with a copy of the truss output and my actual resolv.conf files from
prod & test.

comment:15 Changed 12 years ago by nickm

Okay, I went over to unix-center.net and played around on their t1000. I think I've got this fixed; the fix
should appear in Tor 0.2.0.3-alpha.

(For a temporary workaround, edit eventdns.c and move the line '#include "eventdns_tor.h"' so that it comes before any other include line.)

comment:16 Changed 12 years ago by nickm

Seems to be fixed now.

At least, nobody's complained.

comment:17 Changed 12 years ago by nickm

flyspray2trac: bug closed.

comment:18 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.