{"action":"created","issue":{"url":"https://api.github.com/repos/tornadoweb/tornado/issues/2111","repository_url":"https://api.github.com/repos/tornadoweb/tornado","labels_url":"https://api.github.com/repos/tornadoweb/tornado/issues/2111/labels{/name}","comments_url":"https://api.github.com/repos/tornadoweb/tornado/issues/2111/comments","events_url":"https://api.github.com/repos/tornadoweb/tornado/issues/2111/events","html_url":"https://github.com/tornadoweb/tornado/issues/2111","id":244323204,"number":2111,"title":"TypeError on exception handling","user":{"login":"akayunov","id":13577138,"avatar_url":"https://avatars1.githubusercontent.com/u/13577138?v=4","gravatar_id":"","url":"https://api.github.com/users/akayunov","html_url":"https://github.com/akayunov","followers_url":"https://api.github.com/users/akayunov/followers","following_url":"https://api.github.com/users/akayunov/following{/other_user}","gists_url":"https://api.github.com/users/akayunov/gists{/gist_id}","starred_url":"https://api.github.com/users/akayunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akayunov/subscriptions","organizations_url":"https://api.github.com/users/akayunov/orgs","repos_url":"https://api.github.com/users/akayunov/repos","events_url":"https://api.github.com/users/akayunov/events{/privacy}","received_events_url":"https://api.github.com/users/akayunov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-20T10:58:33Z","updated_at":"2017-07-24T08:32:50Z","closed_at":null,"body":"Jun 26 05:17:34 devfmua-ire-1 locator_v1.error[14686]: [tornado.application] ERROR: Uncaught exception GET /locator/v1.0/users/Usercra%40imqauto1uxeq22f.test (127.0.0.1)\r\nHTTPServerRequest(protocol='http', host='locator_v1', method='GET', uri='/locator/v1.0/users/Usercra%40imqauto1uxeq22f.test', version='HTTP/1.0', remote_ip='127.0.0.1', headers={'Host': 'locator_v1', 'Connection': 'close', 'Accept': '*/*', 'User-Agent': 'curl/7.26.0'})\r\nTraceback (most recent call last):\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/web.py\", line 1511, in _execute\r\n    result = yield result\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/gen.py\", line 1055, in run\r\n    value = future.result()\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/concurrent.py\", line 238, in result\r\n    raise_exc_info(self._exc_info)\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/gen.py\", line 1063, in run\r\n    yielded = self.gen.throw(*exc_info)\r\n  File \"/opt/securisync/be-2.26.4/lib/ss/tornado2/handlers/locatorservice.py\", line 298, in get\r\n    response = yield self.do_hp_request(request)\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/gen.py\", line 1055, in run\r\n    value = future.result()\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/concurrent.py\", line 238, in result\r\n    raise_exc_info(self._exc_info)\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/gen.py\", line 1063, in run\r\n    yielded = self.gen.throw(*exc_info)\r\n  File \"/opt/securisync/be-2.26.4/lib/ss/tornado2/handlers/locatorservice.py\", line 119, in do_hp_request\r\n    response = yield tornado.httpclient.AsyncHTTPClient().fetch(request)\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/gen.py\", line 1055, in run\r\n    value = future.result()\r\n  File \"/opt/securisync/virtualenv-2.24.0/local/lib/python2.7/site-packages/tornado/concurrent.py\", line 238, in result\r\n    raise_exc_info(self._exc_info)\r\n  File \"<string>\", line 3, in raise_exc_info\r\nTypeError: cannot concatenate 'str' and 'NoneType' objects"},"comment":{"url":"https://api.github.com/repos/tornadoweb/tornado/issues/comments/317354958","html_url":"https://github.com/tornadoweb/tornado/issues/2111#issuecomment-317354958","issue_url":"https://api.github.com/repos/tornadoweb/tornado/issues/2111","id":317354958,"user":{"login":"akayunov","id":13577138,"avatar_url":"https://avatars1.githubusercontent.com/u/13577138?v=4","gravatar_id":"","url":"https://api.github.com/users/akayunov","html_url":"https://github.com/akayunov","followers_url":"https://api.github.com/users/akayunov/followers","following_url":"https://api.github.com/users/akayunov/following{/other_user}","gists_url":"https://api.github.com/users/akayunov/gists{/gist_id}","starred_url":"https://api.github.com/users/akayunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akayunov/subscriptions","organizations_url":"https://api.github.com/users/akayunov/orgs","repos_url":"https://api.github.com/users/akayunov/repos","events_url":"https://api.github.com/users/akayunov/events{/privacy}","received_events_url":"https://api.github.com/users/akayunov/received_events","type":"User","site_admin":false},"created_at":"2017-07-24T08:32:50Z","updated_at":"2017-07-24T08:32:50Z","body":"Hi.\r\nI've seen this error only once on prod, and I'm afraid I can just change this code. \r\nAbout first question:\r\n\r\nDEFAULT_SSL_CA_BUNDLE = os.environ.get('REQUESTS_CA_BUNDLE', '/etc/ssl/certs/ca-certificates.crt'\r\nCONNECTION_TIMEOUT = 30\r\nDEFAULT_USER_AGENT = 'SecuriSync-PythonApp/%s'\r\n\r\n\r\ndef_request_args = {\r\n    'validate_cert': False,\r\n    'ca_certs': DEFAULT_SSL_CA_BUNDLE,\r\n    'request_timeout': CONNECTION_TIMEOUT,\r\n    'user_agent': (DEFAULT_USER_AGENT % utils.get_securisync_version()) # utils.get_securisync_version() - string from file\r\n}\r\n\r\n\r\nclass LocatorUsersHandler(LocatorHandler):\r\n    @property\r\n    def request_class_name(self):\r\n        return 'users'\r\n\r\n    @tornado.gen.coroutine\r\n    def get(self, email=None):\r\n        super(LocatorUsersHandler, self).get()\r\n        match_obj = EMAIL_ORG_TMPL0.match(email)\r\n        if not match_obj:\r\n            request = tornado.httpclient.HTTPRequest(\r\n                url=HP_BACKEND['base_url'].rstrip('/') + '/locator/users/' + email, method='GET',\r\n                headers={'X-Customization-ID': self.customization_id}, **self.def_request_args\r\n            )\r\n            response = yield self.do_hp_request(request)\r\n            ....\r\n\r\n\r\n    @tornado.gen.coroutine\r\n    def do_hp_request(self, request):\r\n        try:\r\n            response = yield tornado.httpclient.AsyncHTTPClient().fetch(request)\r\n        except tornado.httpclient.HTTPError as e:\r\n            if not e.response:\r\n                LOG.error('Unknown error code: ' + str(e))\r\n                raise SecuriSyncHTTPError('InternalHostPilot', 'Unknown error code')\r\n            else:\r\n                response = e.response\r\n        except Exception:\r\n            raise\r\n        raise tornado.gen.Return(response)"}}
{"actor":{"display_login":"akayunov"}}