<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jun 15, 2013 at 3:03 PM, Jacob Appelbaum <span dir="ltr"><<a href="mailto:jacob@appelbaum.net" target="_blank">jacob@appelbaum.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Heya,<br>
<br>
Greetings from #404Lab in Tunis, Tunisia!<br>
<br>
I'm testing the ooniprobe in the censorship lab. I'm making a running<br>
list of issues and I'll outline them below.<br>
<br>
When running the following test:<br>
<br>
 ./bin/ooniprobe -l tunisia-404lab-netcache-000.log<br>
nettests/blocking/http_requests.py;<br>
<br>
I find that the test hangs for ~10 minutes:<br>
<br>
Log opened.<br>
[D] No test deck detected<br>
Starting Tor...<br>
[D] Setting control port as 9251<br>
[D] Setting SOCKS port as 9250<br>
[D] 10%: Finishing handshake with directory server<br>
[D] 15%: Establishing an encrypted directory connection<br>
[D] 20%: Asking for networkstatus consensus<br>
[D] 25%: Loading networkstatus consensus<br>
[D] 45%: Asking for relay descriptors<br>
[D] 80%: Connecting to the Tor network<br>
[D] 90%: Establishing a Tor circuit<br>
[D] 100%: Done<br>
[D] Building a TorState<br>
Successfully bootstrapped Tor<br>
[D] We now have the following circuits:<br>
[D]  * <Circuit 1 BUILT [154.35.32.5] for GENERAL><br>
[D]  * <Circuit 2 BUILT [31.172.30.3] for GENERAL><br>
[D]  * <Circuit 3 BUILT [198.211.114.130] for GENERAL><br>
[D]  * <Circuit 5 BUILT [194.132.32.43] for GENERAL><br>
[D]  * <Circuit 6 BUILT [31.172.30.3 46.166.174.209 93.115.241.2] for<br>
GENERAL><br>
[D]  * <Circuit 7 EXTENDED [198.211.114.130 74.120.13.132] for GENERAL><br>
[D]  * <Circuit 8 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 9 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 10 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 11 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 12 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 13 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 14 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 15 EXTENDED [] for GENERAL><br>
[D]  * <Circuit 16 EXTENDED [] for GENERAL><br>
[D] Obtained our IP address from a Tor Relay None<br>
Found your IP via Tor 41.231.22.232<br>
We will include some geo data in the report<br>
Your AS number is: AS2609<br>
Reporting using collector: httpo://nkvphnp3p6agi5qq.onion<br>
[D] adding callback for startNetTest<br>
[D] Creating ./report-http_requests_test-2013-06-15T100736Z.yamloo<br>
[D] Writing report with YAML reporter<br>
[D] Created report with <ooni.reporter.YAMLReporter object at 0x334ca90><br>
Reporting httpo://nkvphnp3p6agi5qq.onion/report<br>
[D] Sending {"software_name": "ooniprobe", "software_version": "0.0.11",<br>
"content": "---\noptions: []\nprobe_asn: AS2609\nprobe_cc: TN\nprobe_ip:<br>
41.231.22.232\nsoftware_name: ooniprobe\nsoftware_version:<br>
0.0.11\nstart_time: 1371290856.723735\ntest_name:<br>
http_requests_test\ntest_version: 0.2.3\n...\n", "test_version":<br>
"0.2.3", "test_name": "http_requests_test", "probe_asn": "AS2609"}<br>
Creating report with OONIB Reporter. Please be patient.<br>
This may take up to 1-2 minutes...<br>
[D] Created report with id<br>
2013-06-15T100948Z_AS2609_UIsgF34hqK8qn2GaxQtaynMnlIQedKCNaH2fNVoY5voh1I4Kdw<br>
[D] Created report with <ooni.reporter.OONIBReporter object at 0x334cc90><br>
[D] Starting this task <generator object generateMeasurements at 0x3c78870><br>
[D] Running <class 'nettests.blocking.http_requests.HTTPRequestsTest'><br>
test_get<br>
[D] Finished test setup<br>
<br>
...<br>
<br>
I'm not clear what will happen next - it just hangs. I killed it after<br>
around ten minutes.<br></blockquote><div><br></div><div>It looks like there is a bug where if you do not specify an input file or host argument that ooni doesn't realize this until after test setup. On my system, with the current git master (514b707df4c701a1e4c58f726c0261e26fabdb32)  I get the following error:<br>
<br> [D] Finished test setup<br>Unhandled error in Deferred:<br>Unhandled Error<br>Traceback (most recent call last):<br>  File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 380, in callback<br>
    self._startRunCallbacks(result)<br>  File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 488, in _startRunCallbacks<br>    self._runCallbacks()<br>  File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 575, in _runCallbacks<br>
    current.result = callback(current.result, *args, **kw)<br>  File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1126, in gotResult<br>    _inlineCallbacks(r, g, deferred)<br>
--- <exception caught here> ---<br>  File "/home/ooni/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks<br>    result = g.send(result)<br>  File "/home/ooni/ooni-probe/ooni/director.py", line 227, in startNetTest<br>
    self.measurementManager.schedule(net_test.generateMeasurements())<br>  File "/home/ooni/ooni-probe/ooni/managers.py", line 107, in schedule<br>    self._fillSlots()<br>  File "/home/ooni/ooni-probe/ooni/managers.py", line 58, in _fillSlots<br>
    task = self._tasks.next()<br>  File "/home/ooni/ooni-probe/ooni/nettest.py", line 508, in generateMeasurements<br>    measurement = self.makeMeasurement(test_class, method, input)<br>  File "/home/ooni/ooni-probe/ooni/nettest.py", line 483, in makeMeasurement<br>
    measurement = Measurement(test_class, test_method, test_input)<br>  File "/home/ooni/ooni-probe/ooni/tasks.py", line 114, in __init__<br>    self.testInstance.setUp()<br>  File "data/nettests/blocking/http_requests.py", line 53, in setUp<br>
    raise Exception("No input specified")<br>exceptions.Exception: No input specified<br><br> The problem is that some nettests support multiple input arguments and 
therefore cannot rely on specifying that an option is required (see: 
class NetTest __init__ requiredOptions). We should either extend the NetTest API to cleanly handle cases where NetTests can take input from either a single host argument or an input file, or axe the single host argument and make the input file a required option.<br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I followed up with the following test:<br>
<br>
./bin/ooniprobe -l tunisia-404lab-netcache-000.log<br>
nettests/manipulation/http_invalid_request_line.py;<br>
<br>
It worked without issues.<br>
<br>
The following test goes on for a while:<br>
<br>
./bin/ooniprobe -l tunisia-404lab-netcache-000.log<br>
nettests/blocking/http_requests.py -f inputs/top-1000.txt<br>
<br>
It starts throwing the following errors:<br>
Performing GET request to <a href="http://google.com.ar" target="_blank">google.com.ar</a><br>
[D] Performing request <a href="http://google.com.ar" target="_blank">google.com.ar</a> GET {'User-Agent': ['Mozilla/5.0<br>
(Windows; U; Windows NT 5.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6']}<br>
[!] Unsupported scheme: ''<br>
[!] Task <ooni.tasks.Measurement object at 0x3302d90> has failed 6 times<br>
Traceback (most recent call last):<br>
  File "/ooni-probe/ooni/managers.py", line 59, in _fillSlots<br>
    self._run(task)<br>
  File "/ooni-probe/ooni/managers.py", line 70, in _run<br>
    d = task.start()<br>
  File "/ooni-probe/ooni/tasks.py", line 91, in start<br>
    return BaseTask.start(self)<br>
  File "/ooni-probe/ooni/tasks.py", line 38, in start<br>
    self._running = defer.maybeDeferred(self.run)<br>
--- <exception caught here> ---<br>
  File<br>
"/ooniprobe/lib/python2.7/site-packages/twisted/internet/defer.py", line<br>
138, in maybeDeferred<br>
    result = f(*args, **kw)<br>
  File "/ooni-probe/ooni/tasks.py", line 129, in run<br>
    d = self.netTestMethod()<br>
  File "/ooni-probe/nettests/blocking/http_requests.py", line 117, in<br>
test_get<br>
    headers=headers)<br>
  File "/ooni-probe/ooni/templates/httpt.py", line 313, in doRequest<br>
    body_producer)<br>
  File "/ooni-probe/ooni/utils/txagentwithsocks.py", line 179, in request<br>
    return client.Agent.request(self, method, uri, headers, bodyProducer)<br>
  File "/lib/python2.7/site-packages/twisted/web/client.py", line 1218,<br>
in request<br>
    parsedURI.port)<br>
  File "/ooni-probe/ooni/utils/txagentwithsocks.py", line 199, in<br>
_getEndpoint<br>
    raise SchemeNotSupported("Unsupported xxx scheme: %r" % (scheme,))<br>
exceptions.NameError: global name 'SchemeNotSupported' is not defined<br>
[!] Permanent failure for <ooni.tasks.Measurement object at 0x3302d90><br>
Failed doing measurement: <ooni.tasks.Measurement object at 0x3302d90><br>
[D] Starting this task <ooni.tasks.ReportEntry object at 0xbf0c950><br>
[D] Starting this task <ooni.tasks.ReportEntry object at 0xbf0ca50><br>
<br></blockquote><div><br></div><div>Your input URL list should be a list of URLs (not just domains, but should specify the protocol). We should also add inputProcessor's for existing nettests so that they can take more flexible input lists. I have added inputProcessors to a few tests, but not yet http_requests.<br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It then hangs like so:<br>
<br>
[D] Checking all tasks for completion 102 == 133<br>
[D] Successfully performed report <ooni.tasks.ReportEntry object at<br>
0xc1405d0><br>
[D] None<br>
[D] Checking all tasks for completion 103 == 133<br>
[D] Successfully performed report <ooni.tasks.ReportEntry object at<br>
0xc1408d0><br>
[D] None<br>
<br>
I killed it - I'm not sure why it hangs. The host list is just the top<br>
alexa hosts.<br></blockquote><div><br></div><div>Probably is the case of an unhandled traceback (due to a bad input) -- it should get caught, retried, and eventually skipped, but clearly it doesn't.<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
 % ./bin/ooniprobe -l tunisia-404lab-netcache-000.log<br>
nettests/blocking/tcpconnect.py -f inputs/top-1000-port80.txt<br>
<br>
This worked without issue.<br></blockquote><div><br></div><div>Oh good :). BTW, I added inputProcessor support to tcpconnect so you can use it with a URL list. It doesn't currently support URLs with a specified port #, though.<br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I tried:<br>
<br>
 % ./bin/ooniprobe -l tunisia-404lab-netcache-000.log<br>
nettests/blocking/http_requests.py -f inputs/top-1000.txt<br>
<br>
I had similar hangs - so the tests never finished:<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
[D] Checking all tasks for completion 100 == 133<br>
[D] Successfully performed report <ooni.tasks.ReportEntry object at<br>
0xcc7d190><br>
[D] None<br>
[D] Checking all tasks for completion 101 == 133<br>
[D] Successfully performed report <ooni.tasks.ReportEntry object at<br>
0xcc7d490><br>
[D] None<br>
[D] Checking all tasks for completion 102 == 133<br>
[D] Successfully performed report <ooni.tasks.ReportEntry object at<br>
0xcc7d790><br>
[D] None<br>
[D] Checking all tasks for completion 103 == 133<br>
[D] Successfully performed report <ooni.tasks.ReportEntry object at<br>
0xcc7da90><br>
[D] None<br>
<br>
Thoughts?<br></blockquote><div><br></div><div>These logs aren't very descriptive, though, I'd guess it's the same URL issue as above.<br><br></div><div>--Aaron<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
All the best,<br>
Jake<br>
_______________________________________________<br>
ooni-dev mailing list<br>
<a href="mailto:ooni-dev@lists.torproject.org">ooni-dev@lists.torproject.org</a><br>
<a href="https://lists.torproject.org/cgi-bin/mailman/listinfo/ooni-dev" target="_blank">https://lists.torproject.org/cgi-bin/mailman/listinfo/ooni-dev</a><br>
</blockquote></div><br></div></div>