{"action":"created","issue":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/2969","repository_url":"https://api.github.com/repos/mitmproxy/mitmproxy","labels_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/2969/labels{/name}","comments_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/2969/comments","events_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/2969/events","html_url":"https://github.com/mitmproxy/mitmproxy/issues/2969","id":302978317,"number":2969,"title":"Setting View Filter shows Addon Error in Eventlog","user":{"login":"fenilgandhi","id":9128903,"avatar_url":"https://avatars0.githubusercontent.com/u/9128903?v=4","gravatar_id":"","url":"https://api.github.com/users/fenilgandhi","html_url":"https://github.com/fenilgandhi","followers_url":"https://api.github.com/users/fenilgandhi/followers","following_url":"https://api.github.com/users/fenilgandhi/following{/other_user}","gists_url":"https://api.github.com/users/fenilgandhi/gists{/gist_id}","starred_url":"https://api.github.com/users/fenilgandhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenilgandhi/subscriptions","organizations_url":"https://api.github.com/users/fenilgandhi/orgs","repos_url":"https://api.github.com/users/fenilgandhi/repos","events_url":"https://api.github.com/users/fenilgandhi/events{/privacy}","received_events_url":"https://api.github.com/users/fenilgandhi/received_events","type":"User","site_admin":false},"labels":[{"id":429899749,"url":"https://api.github.com/repos/mitmproxy/mitmproxy/labels/area/core","name":"area/core","color":"fef2c0","default":false},{"id":174959532,"url":"https://api.github.com/repos/mitmproxy/mitmproxy/labels/help%20wanted","name":"help wanted","color":"fbca04","default":true},{"id":79336502,"url":"https://api.github.com/repos/mitmproxy/mitmproxy/labels/kind/bug","name":"kind/bug","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-07T06:22:18Z","updated_at":"2018-03-19T07:57:39Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"    error: Addon error: Traceback (most recent call last):\r\n        File \"/home/coldfire/Projects/mitmproxy/mitmproxy/addons/view.py\", line 521, in update\r\n            idx = self._view.index(f)\r\n        File \"/home/coldfire/Projects/mitmproxy/venv/lib/python3.6/site-packages/sortedcontainers/sortedlist.py\", line 2343, in index\r\n            raise ValueError('{0!r} is not in list'.format(val))\r\n        File \"/home/coldfire/Projects/mitmproxy/mitmproxy/http.py\", line 182, in __repr__\r\n            return s.format(flow=self)\r\n        File \"/home/coldfire/Projects/mitmproxy/mitmproxy/connections.py\", line 215, in __repr__\r\n            host=self.address[0],\r\n    TypeError: 'NoneType' object is not subscriptable\r\n\r\n\r\n##### Steps to reproduce the problem:\r\n1. Open `mitmproxy`\r\n2.  set a value for `view_filter` in Options or using the ` : set view_filter={str} `\r\n3. Open a attached browser and open any url\r\n4. Quit the browser and Open the Eventlog in mitmproxy. \r\n\r\n\r\n##### Any other comments? What have you tried so far?\r\nAnother error occuring for the view_filter option. I was working on a fix for #2801 #2951 when i noticed this other error occurs if any value is setup in view_filter. I think it requires a complete patch once and for all. \r\n\r\n##### System information\r\nMitmproxy: 4.0.0.dev103 (commit 77ed33b) \r\nPython:    3.6.4\r\nOpenSSL:   OpenSSL 1.1.0g  2 Nov 2017\r\nPlatform:  Linux-4.14.21-1-MANJARO-x86_64-with-arch-Manjaro-Linux\r\n"},"comment":{"url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/comments/374128191","html_url":"https://github.com/mitmproxy/mitmproxy/issues/2969#issuecomment-374128191","issue_url":"https://api.github.com/repos/mitmproxy/mitmproxy/issues/2969","id":374128191,"user":{"login":"kajojify","id":20267977,"avatar_url":"https://avatars2.githubusercontent.com/u/20267977?v=4","gravatar_id":"","url":"https://api.github.com/users/kajojify","html_url":"https://github.com/kajojify","followers_url":"https://api.github.com/users/kajojify/followers","following_url":"https://api.github.com/users/kajojify/following{/other_user}","gists_url":"https://api.github.com/users/kajojify/gists{/gist_id}","starred_url":"https://api.github.com/users/kajojify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kajojify/subscriptions","organizations_url":"https://api.github.com/users/kajojify/orgs","repos_url":"https://api.github.com/users/kajojify/repos","events_url":"https://api.github.com/users/kajojify/events{/privacy}","received_events_url":"https://api.github.com/users/kajojify/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T07:57:38Z","updated_at":"2018-03-19T07:57:38Z","author_association":"CONTRIBUTOR","body":"@fenilgandhi I have an assumption concerning this issue. I am not sure it is absolutely correct.\r\nAs you can see the issue appears when mitmproxy tries to give us a representation of `ServerConnection` object, when `ValueError` is raised inside https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/addons/view.py#L521\r\n\r\nFor some reasons for some flows `self.address` is still `None`, when we need it to be available in `ServerConnection`. When we write time.sleep(1), we suspend execution of the calling thread for 1 second. **Perhaps** mitmproxy switches to other available thread and this thread set the value for `self.address`. The problem is that suspended thread is `MainThread` and every new case with `self.address is None` almost all mitmproxy functions will stop for 1 second.\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"kajojify"}}