Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nyx Error: "Unable to save configuration ([551] Unable to write configuration to disk.)" #20

Open
T0rr0 opened this issue Jul 28, 2020 · 2 comments

Comments

@T0rr0
Copy link

T0rr0 commented Jul 28, 2020

Got this error message when I want to save (as root) the torrc after editing the config in nyx.
tempsnip

@T0rr0 T0rr0 changed the title nyx Error: "Unable to safe configuration ([551] Unable to write configuration to disk.)" nyx Error: "Unable to save configuration ([551] Unable to write configuration to disk.)" Jul 28, 2020
@atagar
Copy link
Collaborator

atagar commented Aug 2, 2020

Hi T0rr0, sorry about the delay. This looks to be arising because your torrc has "%include" entries which would get overwritten. Tor raises this error at the following when we don't provide a 'force' flag...

https://gitweb.torproject.org/tor.git/tree/src/feature/control/control_cmd.c#n436

I should change Nyx to do the following...

  • Issue a SAVECONF without the force flag.
  • If this errors with a 551 response (like this) provide a message cautioning that overwriting your torrc is risky.
  • If the user says so do so then re-issue SAVECONF with the force flag.

I won't get to this for a while. In the meantime I'd suggest managing your torrc by hand.

Thanks for reporting this!

@tsekityam
Copy link

tsekityam commented Jan 19, 2021

I got the same error, but I don't have %include enabled.

 │ 244 ## Configuration options can be imported from files or folders using the %include
 │ 245 ## option with the value being a path. This path can have wildcards. Wildcards are
 │ 246 ## expanded first, using lexical order. Then, for each matching file or folder, the following
 │ 247 ## rules are followed: if the path is a file, the options from the file will be parsed as if
 │ 248 ## they were written where the %include option is. If the path is a folder, all files on that
 │ 249 ## folder will be parsed following lexical order. Files starting with a dot are ignored. Files
 │ 250 ## on subfolders are ignored.
 │ 251 ## The %include option can be used recursively.
 │ 252 #%include /etc/torrc.d/*.conf

Here is the messaged printed to syslog when the error occur.

Jan 19 16:17:46 ip-172-26-9-145 Tor[42673]: Renaming old configuration file to "/etc/tor/torrc.orig.1"
Jan 19 16:17:46 ip-172-26-9-145 Tor[42673]: Couldn't rename configuration file "/etc/tor/torrc" to "/etc/tor/torrc.orig.1": Read-only file system

The same error happens on my other relay, in this relay, the error log is

Jan 19 16:31:01 instance-20210117-1235 Tor[460279]: Renaming old configuration file to "/etc/tor/torrc.orig.1"
Jan 19 16:31:01 instance-20210117-1235 Tor[460279]: Couldn't rename configuration file "/etc/tor/torrc" to "/etc/tor/torrc.orig.1": Read-only file system
Jan 19 16:31:04 instance-20210117-1235 sudo[789524]: pam_unix(sudo:session): session closed for user toranon

Looks like my tor process is not running in root, so they couldn't write into the /etc/tor/ directory. Perhaps add write permission to the tor process will solve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants