"Unknown option ''" log message is confusing
Summary
I recently upgraded a machine that runs a tor
service; after a reboot, the tor
service immediately fails with the log message "[warn] Failed to parse/validate config: Unknown option ''. Failing." This error message is confusing, as I initially interpreted it as indicating that empty lines are no longer permitted in torrc
, which I was just told on IRC is not the case. It would be nice if this message was a bit more helpful in explaining what went wrong.
(Also, as this error has taken down some onion services I run, and I don't know how to fix it, I would appreciate a suggestion on what this log error means even if it's not fixed quickly in the source code.)
Steps to reproduce:
I have no idea what I did to trigger this, other than installing apt
upgrades on the machine where it happened. I did update the torrc
config about 30 minutes before upgrading, but I had already restarted the tor
service after updating torrc
and it seemed fine then.
What is the current bug behavior?
The message is "[warn] Failed to parse/validate config: Unknown option ''. Failing."
What is the expected behavior?
The message should either say that empty lines are prohibited if that's the case (I believe it is not), or otherwise give some explanation of where the empty string came from and what's supposed to be there instead.
Environment
- Which version of Tor are you using? Run
tor --version
to get the version if you are unsure.- 0.4.5.10.
- Which operating system are you using? For example: Debian GNU/Linux 10.1, Windows 10, Ubuntu Xenial, FreeBSD 12.2, etc.
- Whonix-Gateway 16 (morphed from Debian Bullseye) on ppc64le.
- Which installation method did you use? Distribution package (apt, pkg, homebrew), from source tarball, from Git, etc.
- Distro morphing via
apt
.
- Distro morphing via
Relevant logs and/or screenshots
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.133 [notice] Tor 0.4.5.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 1.1.1n, Zlib 1.2.11, Liblzma 5
.2.5, Libzstd 1.4.8 and Glibc 2.31 as libc.
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.133 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/downlo
ad/download#warning
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.133 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.134 [notice] Read configuration file "/etc/tor/torrc".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.142 [notice] Processing configuration path "/etc/torrc.d/*.conf" at recursion level 1.
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/etc/torrc.d/60_network.conf".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/etc/torrc.d/65_gateway.conf".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/etc/torrc.d/65_leak_tests.conf".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/etc/torrc.d/70_workstation.conf".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Processing configuration path "/usr/share/tor/tor-service-defaults-torrc.anondist" at recursion l
evel 2.
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/usr/share/tor/tor-service-defaults-torrc.anondist".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/etc/torrc.d/95_whonix.conf".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Processing configuration path "/usr/local/etc/torrc.d/" at recursion level 2.
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/usr/local/etc/torrc.d//40_tor_control_panel.conf".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.152 [notice] Including configuration file "/usr/local/etc/torrc.d//50_user.conf".
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.157 [warn] Option 'DisableNetwork' used more than once; all but the last value will be ignored.
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.164 [warn] Failed to parse/validate config: Unknown option ''. Failing.
Aug 13 19:50:20 host tor[899]: Aug 13 19:50:20.164 [err] Reading config failed--see warnings above.
Possible fixes
No idea.