robgjansen / onionperf

A utility to track the performance of Tor and Tor onion services
Other
19 stars 24 forks source link

NoneType error when casting circuit_id to Int #28

Closed hiromipaw closed 7 years ago

hiromipaw commented 7 years ago

I have noticed some of my measurements file are empty because of a NoneType to Int casting error. Details below:

 onionperf analyze -t --tgen=tgen-client/log_archive/onionperf_2017-03-15_23\:59\:59.tgen.log --torctl=tor-client/log_archive/onionperf_2017-03-15_23\:59\:59.torctl.log -p=twistd/docroot/
2017-03-20 09:50:02 1490003402.446086 [onionperf] [INFO] parsing log file at /home/cloud/onionperf/onionperf-data/tgen-client/log_archive/onionperf_2017-03-15_23:59:59.tgen.log
2017-03-20 09:50:03 1490003403.142353 [onionperf] [INFO] parsing log file at /home/cloud/onionperf/onionperf-data/tor-client/log_archive/onionperf_2017-03-15_23:59:59.torctl.log
545 795
2017-03-20 09:50:15 1490003415.877429 [onionperf] [INFO] saving analysis results to /home/cloud/onionperf/onionperf-data/twistd/docroot/onionperf.analysis.json.xz
2017-03-20 09:50:24 1490003424.114065 [onionperf] [INFO] done!
2017-03-20 09:50:24 1490003424.114919 [onionperf] [INFO] saving analysis results to /home/cloud/onionperf/onionperf-data/twistd/docroot/op-us-5242880-2017-03-20.tpf.xz
Traceback (most recent call last):
  File "/usr/local/bin/onionperf", line 472, in <module>
    if __name__ == '__main__': sys.exit(main())
  File "/usr/local/bin/onionperf", line 318, in main
    args.func(args)
  File "/usr/local/bin/onionperf", line 392, in analyze
    analysis.export_torperf_version_1_0(output_prefix=args.prefix, do_compress=True)
  File "/usr/local/lib/python2.7/dist-packages/onionperf/analysis.py", line 207, in export_torperf_version_1_0
    circid = int(stream_db['circuit_id'])
TypeError: int() argument must be a string or a number, not 'NoneType'
robgjansen commented 7 years ago

Closed by #27, thanks @hiromipaw!