Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • T torflow
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Network Health
  • torflow
  • Issues
  • #13663
Closed
Open
Issue created Nov 04, 2014 by micah@micahOwner

silent failure when scan-data directories don't exist

I ran the bwauthority scripts for several days and watched it pull files and write to log files and wonder why the aggregation wasn't getting any nodes at all.

Eventually, tired of waiting with no clue, I took a dive into the code and found that it was wanting to write to the out_dir configured directory in each scanner.*/bwauthority.cfg, and I didn't have that directory. I'm surprised that things just kept going without an error, but I was more surprised that this wasn't handled in the code.

I think something like the following would be a trivial change to make this not be a problem for people in the future:

diff --git a/NetworkScanners/BwAuthority/bwauthority_child.py b/NetworkScanners/BwAuthority/bwauthority_child.py
index 28b89c2..296662a 100755
--- a/NetworkScanners/BwAuthority/bwauthority_child.py
+++ b/NetworkScanners/BwAuthority/bwauthority_child.py 
 
 # Do NOT modify this object directly after it is handed to PathBuilder
@@ -210,6 +210,12 @@ def speedrace(hdlr, start_pct, stop_pct, circs_per_node, save_every, out_dir,
 
   attempt = 0
   successful = 0
+
+  # make sure necessary out_dir directory exists
+  dir = os.getcwd()+'/'+out_dir
+  if not os.path.exists(dir):
+    os.makedirs(dir)
+
   while True:
     if hdlr.is_count_met(circs_per_node, successful): break
     hdlr.wait_for_consensus()
Assignee
Assign to
Time tracking