Opened 2 years ago

Closed 2 years ago

#27938 closed defect (fixed)

SQLite permission error writing to cache

Reported by: atagar Owned by: atagar
Priority: High Milestone:
Component: Archived/Nyx Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


I've had a couple users report nyx permission errors. Most likely this comes up when changing the user they run nyx as.

Users should be able to work around this with the following...

% echo "data_directory disabled" >> my_nyxrc
% nyx --config my_nyxrc

Stacktrace users report are the following...

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/", line 176, in main
  File "/usr/lib/python3/dist-packages/stem/util/", line 289, in wrapped
    return func(*args, config = config, **kwargs)
  File "/usr/lib/python3/dist-packages/nyx/", 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/", line 217, in start
  File "/usr/lib/python3.6/curses/", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib/python3/dist-packages/nyx/", line 215, in _wrapper
  File "/usr/lib/python3/dist-packages/nyx/", line 194, in draw_loop
    interface = nyx_interface()
  File "/usr/lib/python3/dist-packages/nyx/", line 256, in nyx_interface
    Interface()  # constructor sets NYX_INTERFACE
  File "/usr/lib/python3/dist-packages/nyx/", line 589, in __init__
    self._header_panel = nyx.panel.header.HeaderPanel()
  File "/usr/lib/python3/dist-packages/nyx/panel/", line 47, in __init__
    self._vals = Sampling.create()
  File "/usr/lib/python3/dist-packages/nyx/panel/", line 235, in create
    my_router_status_entry = nyx.tracker.get_consensus_tracker().my_router_status_entry()
  File "/usr/lib/python3/dist-packages/nyx/", line 169, in get_consensus_tracker
    CONSENSUS_TRACKER = ConsensusTracker()
  File "/usr/lib/python3/dist-packages/nyx/", line 831, in __init__
  File "/usr/lib/python3/dist-packages/nyx/", line 853, in _update
    writer.record_relay(fingerprint, address, or_port, nickname)
  File "/usr/lib/python3/dist-packages/nyx/", 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/", line 541, in _query
    return self._conn.execute(query, param)

  sqlite3.OperationalError: attempt to write a readonly database

The cache is only for a performance improvement so when we lack cache write access nyx should emit a warning and simply avoid these calls.

Child Tickets

Change History (1)

comment:1 Changed 2 years ago by atagar

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.