Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #13663

Closed (moved)
Open
Opened Nov 04, 2014 by Micah Anderson@hacim

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()
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#13663