Opened 13 months ago

Closed 12 months ago

Last modified 5 months ago

#27342 closed defect (fixed)

sbws poor error handling

Reported by: gabe Owned by: pastly
Priority: Medium Milestone: sbws: 1.0.x-final
Component: Core Tor/sbws Version:
Severity: Normal Keywords:
Cc: pastly, juga, teor Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

sbws first run states file not found, but gives no indication as to what file is not found.

test@26e7731456d9:~$ sbws scanner
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/handlers.py", line 823, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/sbws", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/sbws/sbws.py", line 53, in main
    configure_logging(args, conf)
  File "/usr/local/lib/python3.5/dist-packages/sbws/util/config.py", line 160, in configure_logging
    logging.config.fileConfig(fd.name)
  File "/usr/lib/python3.5/logging/config.py", line 84, in fileConfig
    handlers = _install_handlers(cp, formatters)
  File "/usr/lib/python3.5/logging/config.py", line 148, in _install_handlers
    h = klass(*args)
  File "/usr/lib/python3.5/logging/handlers.py", line 806, in __init__
    self._connect_unixsocket(address)
  File "/usr/lib/python3.5/logging/handlers.py", line 834, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

I assume the config file is missing, but don't know for sure.

Child Tickets

Change History (6)

comment:1 Changed 13 months ago by teor

Thanks for reporting this bug!

Which command did you run to get this error, and what did you do before running it?

The first error is in _connect_unixsocket, which probably means that:

  • tor isn't running, or
  • tor isn't configured with a control socket at the path that sbws is expecting it

Do the instructions tell you how to configure tor?

The second error is in configure_logging(args, conf), so maybe your log file path is missing?

The other sbws developers might be able to help more once they're available.

comment:2 Changed 13 months ago by pastly

Owner: set to pastly
Status: newassigned

comment:3 Changed 13 months ago by pastly

Status: assignedneeds_review

comment:4 Changed 13 months ago by pastly

Status: needs_reviewneeds_revision

(notes to self)

Need tests so this doesn't happen again. https://github.com/pastly/simple-bw-scanner/pull/244#issuecomment-416423613

When starting to implement tests, noticed that there's a little rot that needs taking care of. here we set --directory as an argument, but it isn't an argument anymore. I found this because I need to get the config into a file and pass it as an argument so I can launch sbws in a subprocess.

comment:5 Changed 12 months ago by juga

Resolution: fixed
Status: needs_revisionclosed

comment:6 Changed 5 months ago by teor

Milestone: sbws: 1.0.x-final

Moving closed sbws tickets to sbws: 1.0.x-final.

Note: See TracTickets for help on using tickets.