Opened 4 weeks ago

Closed 2 weeks ago

#32051 closed defect (duplicate)

Nyx unable to read tor's authentication cookie

Reported by: cypherpunks Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Nyx Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Upagraded to Mint 19 from 18.3 and unable to use arm anymore. Installed Nyx and receiving the following error:

We were unable to read tor's authentication cookie...

Path: /run/tor/control.authcookie
Issue: Authentication failed: unable to read '/run/tor/control.authcookie' ([Errno 13] Permission denied: '/run/tor/control.authcookie')

ControlPort 9051
CookieAuthentication 1

Hope you can assist.
Thanks

Child Tickets

Change History (6)

comment:1 Changed 4 weeks ago by atagar

Status: newneeds_information

Hi cypherpunks. Are you running nyx with the same user as tor? Tor limits read access for its authentication cookie to its own user and the above error indicates a basic permission issue. Also, in your torrc you can set CookieAuthGroupReadable if you'd prefer to use group permissions to grant access.

I'll keep this ticket open with two action items on my end...

  1. Adjust Stem's exception message to better describe what user/group have access.
  2. Add a Nyx FAQ entry about cookie permissions.

comment:2 Changed 4 weeks ago by cypherpunks

Hi atagar,

I've added CookieAuthFileGroupReadable 1 to the torrc file however I'm not sure how to run nyx with the same user as tor.

Thanks

comment:3 Changed 3 weeks ago by cypherpunks

Hi atagar,

In spite of making the change CookieAuthFileGroupReadable 1 to the torrc file and starting nyx using sudo -u debian-tor nyx, still not working. Getting the following output using sudo -u debian-tor nyx:

Traceback (most recent call last):

File "/usr/bin/nyx", line 11, in <module>

load_entry_point('nyx==2.0.4', 'console_scripts', 'nyx')()

File "/usr/lib/python3/dist-packages/nyx/init.py", line 176, in main

nyx.starter.main()

File "/usr/lib/python3/dist-packages/stem/util/conf.py", line 289, in wrapped

return func(*args, config = config, kwargs)

File "/usr/lib/python3/dist-packages/nyx/starter.py", line 118, in main

nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)

File "/usr/lib/python3/dist-packages/nyx/curses.py", line 217, in start

curses.wrapper(_wrapper)

File "/usr/lib/python3.6/curses/init.py", line 94, in wrapper

return func(stdscr, *args, kwds)

File "/usr/lib/python3/dist-packages/nyx/curses.py", line 215, in _wrapper

function()

File "/usr/lib/python3/dist-packages/nyx/init.py", line 194, in draw_loop

interface = nyx_interface()

File "/usr/lib/python3/dist-packages/nyx/init.py", line 256, in nyx_interface

Interface() # constructor sets NYX_INTERFACE

File "/usr/lib/python3/dist-packages/nyx/init.py", line 589, in init

self._header_panel = nyx.panel.header.HeaderPanel()

File "/usr/lib/python3/dist-packages/nyx/panel/header.py", line 47, in init

self._vals = Sampling.create()

File "/usr/lib/python3/dist-packages/nyx/panel/header.py", line 235, in create

my_router_status_entry = nyx.tracker.get_consensus_tracker().my_router_status_entry()

File "/usr/lib/python3/dist-packages/nyx/tracker.py", line 169, in get_consensus_tracker

CONSENSUS_TRACKER = ConsensusTracker()

File "/usr/lib/python3/dist-packages/nyx/tracker.py", line 831, in init

self._update(ns_response)

File "/usr/lib/python3/dist-packages/nyx/tracker.py", line 853, in _update

writer.record_relay(fingerprint, address, or_port, nickname)

File "/usr/lib/python3/dist-packages/nyx/init.py", line 569, in record_relay

self._cache._query('INSERT OR REPLACE INTO relays(fingerprint, address, or_port, nickname) VALUES (?,?,?,?)', fingerprint, address, or_port, nickname)

File "/usr/lib/python3/dist-packages/nyx/init.py", line 541, in _query

return self._conn.execute(query, param)

sqlite3.OperationalError: attempt to write a readonly database
Error in sys.excepthook:
Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 145, in apport_excepthook

os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:

FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_nyx.122.crash'

Original exception was:
Traceback (most recent call last):

File "/usr/bin/nyx", line 11, in <module>

load_entry_point('nyx==2.0.4', 'console_scripts', 'nyx')()

File "/usr/lib/python3/dist-packages/nyx/init.py", line 176, in main

nyx.starter.main()

File "/usr/lib/python3/dist-packages/stem/util/conf.py", line 289, in wrapped

return func(*args, config = config, kwargs)

File "/usr/lib/python3/dist-packages/nyx/starter.py", line 118, in main

nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)

File "/usr/lib/python3/dist-packages/nyx/curses.py", line 217, in start

curses.wrapper(_wrapper)

File "/usr/lib/python3.6/curses/init.py", line 94, in wrapper

return func(stdscr, *args, kwds)

File "/usr/lib/python3/dist-packages/nyx/curses.py", line 215, in _wrapper

function()

File "/usr/lib/python3/dist-packages/nyx/init.py", line 194, in draw_loop

interface = nyx_interface()

File "/usr/lib/python3/dist-packages/nyx/init.py", line 256, in nyx_interface

Interface() # constructor sets NYX_INTERFACE

File "/usr/lib/python3/dist-packages/nyx/init.py", line 589, in init

self._header_panel = nyx.panel.header.HeaderPanel()

File "/usr/lib/python3/dist-packages/nyx/panel/header.py", line 47, in init

self._vals = Sampling.create()

File "/usr/lib/python3/dist-packages/nyx/panel/header.py", line 235, in create

my_router_status_entry = nyx.tracker.get_consensus_tracker().my_router_status_entry()

File "/usr/lib/python3/dist-packages/nyx/tracker.py", line 169, in get_consensus_tracker

CONSENSUS_TRACKER = ConsensusTracker()

File "/usr/lib/python3/dist-packages/nyx/tracker.py", line 831, in init

self._update(ns_response)

File "/usr/lib/python3/dist-packages/nyx/tracker.py", line 853, in _update

writer.record_relay(fingerprint, address, or_port, nickname)

File "/usr/lib/python3/dist-packages/nyx/init.py", line 569, in record_relay

self._cache._query('INSERT OR REPLACE INTO relays(fingerprint, address, or_port, nickname) VALUES (?,?,?,?)', fingerprint, address, or_port, nickname)

File "/usr/lib/python3/dist-packages/nyx/init.py", line 541, in _query

return self._conn.execute(query, param)

sqlite3.OperationalError: attempt to write a readonly database

comment:4 Changed 3 weeks ago by atagar

Hi cypherpunks, the sql error is from https://trac.torproject.org/projects/tor/ticket/27938

Try deleting '.nyx' from your home directory.

comment:5 Changed 3 weeks ago by cypherpunks

Hi atagar,

That worked!

Thanks a ton

comment:6 Changed 2 weeks ago by atagar

Resolution: duplicate
Status: needs_informationclosed

No problem! Sorry about the confusion, that's certainly a head scratchier for users. :P

Note: See TracTickets for help on using tickets.