sambuddhabasu / nyx

https://gitweb.torproject.org/nyx.git
GNU General Public License v3.0
8 stars 3 forks source link

Nyx failing to start after working on first use. #15

Open DiagonalArg opened 6 years ago

DiagonalArg commented 6 years ago

I just installed nyx on Ubuntu 18.04. Nyx worked on first try in a tmux window. When I came back though, the display was scrambled. I could see a little, and it was responding to commands, so I tried 'c' (twice), which didn't work, and then 'q' (twice). On attempt to re-run nyx, I consistently get an error (below).

(And by the way, cypherpunks/writecode does not allow you to register a new ticket on the tracker, only view tickets.)

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
DiagonalArg commented 5 years ago

It seems I had to reboot after adding myself to the debian-tor group (usermod -a -G debian-tor devrana). Now, it's working.

DiagonalArg commented 5 years ago

Nope, that's not right. It's doing the same as it was before: it runs the first time, then I get screen chaos. After I close it out, on restart it gives the above error.

DiagonalArg commented 5 years ago

The problem appears to be ~/.nyx/cache.sqlite, which nyx is trying to write on shutdown and read on startup. The ownership is root:root, and permission 644. When I change the ownership to myself, with the same permissions, nyx works fine. Oddly, it does not help if I change it to root:root and 666.