{"action":"closed","issue":{"url":"https://api.github.com/repos/Valloric/ycmd/issues/418","repository_url":"https://api.github.com/repos/Valloric/ycmd","labels_url":"https://api.github.com/repos/Valloric/ycmd/issues/418/labels{/name}","comments_url":"https://api.github.com/repos/Valloric/ycmd/issues/418/comments","events_url":"https://api.github.com/repos/Valloric/ycmd/issues/418/events","html_url":"https://github.com/Valloric/ycmd/issues/418","id":138877286,"number":418,"title":"Problem running example_client.py","user":{"login":"vincentwoo","id":613320,"avatar_url":"https://avatars.githubusercontent.com/u/613320?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentwoo","html_url":"https://github.com/vincentwoo","followers_url":"https://api.github.com/users/vincentwoo/followers","following_url":"https://api.github.com/users/vincentwoo/following{/other_user}","gists_url":"https://api.github.com/users/vincentwoo/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentwoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentwoo/subscriptions","organizations_url":"https://api.github.com/users/vincentwoo/orgs","repos_url":"https://api.github.com/users/vincentwoo/repos","events_url":"https://api.github.com/users/vincentwoo/events{/privacy}","received_events_url":"https://api.github.com/users/vincentwoo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-03-07T03:42:02Z","updated_at":"2016-03-13T01:35:43Z","closed_at":"2016-03-13T01:35:43Z","body":"When running `example_client.py`, I see the following error (sometimes):\r\n\r\n```\r\n==== Sending code-completion request ====\r\nPOST /completions HTTP/1.1\r\nAccept: application/json\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nContent-Length: 990\r\nHost: 127.0.0.1:45649\r\nUser-Agent: HTTPie/0.9.3\r\nX-Ycm-Hmac: x/fb4YnMWm6IeZD3RcausQ2CwSmUUu1d0P716Gn0Rik=\r\ncontent-type: application/json\r\n\r\n{\r\n    \"column_num\": 6,\r\n    \"file_data\": {\r\n        \"/ycmd/examples/samples/some_python.py\": {\r\n            \"contents\": \"# Copyright (C) 2014 Google Inc.\\n#\\n# Licensed under the Apache License, Version 2.0 (the \\\"License\\\");\\n# you may not use this file except in compliance with the License.\\n# You may obtain a copy of the License at\\n#\\n#     http://www.apache.org/licenses/LICENSE-2.0\\n#\\n# Unless required by applicable law or agreed to in writing, software\\n# distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n# See the License for the specific language governing permissions and\\n# limitations under the License.\\n\\nclass Example( object ):\\n  def __init__( self ):\\n    self.x = 1\\n    self.y = 2\\n    self.z = 3\\n\\n\\nif __name__ == \\\"__main__\\\":\\n  ex = Example()\\n  # location after the dot is line 25, column 6\\n  ex.\\n\",\r\n            \"filetypes\": [\r\n                \"python\"\r\n            ]\r\n        }\r\n    },\r\n    \"filepath\": \"/ycmd/examples/samples/some_python.py\",\r\n    \"line_num\": 25\r\n}\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 7116\r\nContent-Type: application/json\r\nDate: Mon, 07 Mar 2016 03:36:22 GMT\r\nServer: waitress\r\nX-Ycm-Hmac: Q1xBuFkEi2OdyrWVdDO/Avj2g9PeR1mtTTeYVj8oX84=\r\n\r\n{\r\n    \"completion_start_column\": 6,\r\n    \"completions\": [],\r\n    \"errors\": [\r\n        {\r\n            \"exception\": {\r\n                \"TYPE\": \"ConnectionError\",\r\n                \"request\": {\r\n                    \"TYPE\": \"PreparedRequest\",\r\n                    \"_cookies\": {\r\n                        \"TYPE\": \"RequestsCookieJar\",\r\n                        \"_cookies\": {},\r\n                        \"_cookies_lock\": \"<_thread.RLock owner=0 count=0>\",\r\n                        \"_now\": 1457321782,\r\n                        \"_policy\": {\r\n                            \"TYPE\": \"DefaultCookiePolicy\",\r\n                            \"_allowed_domains\": null,\r\n                            \"_blocked_domains\": [],\r\n                            \"_now\": 1457321782,\r\n                            \"hide_cookie2\": false,\r\n                            \"netscape\": true,\r\n                            \"rfc2109_as_netscape\": null,\r\n                            \"rfc2965\": false,\r\n                            \"strict_domain\": false,\r\n                            \"strict_ns_domain\": 0,\r\n                            \"strict_ns_set_initial_dollar\": false,\r\n                            \"strict_ns_set_path\": false,\r\n                            \"strict_ns_unverifiable\": false,\r\n                            \"strict_rfc2965_unverifiable\": true\r\n                        }\r\n                    },\r\n                    \"body\": \"b'{\\\"col\\\": 5, \\\"source_path\\\": \\\"/ycmd/examples/samples/some_python.py\\\", \\\"line\\\": 25, \\\"source\\\": \\\"# Copyright (C) 2014 Google Inc.\\\\\\\\n#\\\\\\\\n# Licensed under the Apache License, Version 2.0 (the \\\\\\\\\\\"License\\\\\\\\\\\");\\\\\\\\n# you may not use this file except in compliance with the License.\\\\\\\\n# You may obtain a copy of the License at\\\\\\\\n#\\\\\\\\n#     http://www.apache.org/licenses/LICENSE-2.0\\\\\\\\n#\\\\\\\\n# Unless required by applicable law or agreed to in writing, software\\\\\\\\n# distributed under the License is distributed on an \\\\\\\\\\\"AS IS\\\\\\\\\\\" BASIS,\\\\\\\\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\\\\\\\n# See the License for the specific language governing permissions and\\\\\\\\n# limitations under the License.\\\\\\\\n\\\\\\\\nclass Example( object ):\\\\\\\\n  def __init__( self ):\\\\\\\\n    self.x = 1\\\\\\\\n    self.y = 2\\\\\\\\n    self.z = 3\\\\\\\\n\\\\\\\\n\\\\\\\\nif __name__ == \\\\\\\\\\\"__main__\\\\\\\\\\\":\\\\\\\\n  ex = Example()\\\\\\\\n  # location after the dot is line 25, column 6\\\\\\\\n  ex.\\\\\\\\n\\\"}'\",\r\n                    \"headers\": {\r\n                        \"TYPE\": \"CaseInsensitiveDict\",\r\n                        \"_store\": {\r\n                            \"accept\": [\r\n                                \"Accept\",\r\n                                \"*/*\"\r\n                            ],\r\n                            \"accept-encoding\": [\r\n                                \"Accept-Encoding\",\r\n                                \"gzip, deflate\"\r\n                            ],\r\n                            \"connection\": [\r\n                                \"Connection\",\r\n                                \"keep-alive\"\r\n                            ],\r\n                            \"content-length\": [\r\n                                \"Content-Length\",\r\n                                \"897\"\r\n                            ],\r\n                            \"content-type\": [\r\n                                \"content-type\",\r\n                                \"application/json\"\r\n                            ],\r\n                            \"user-agent\": [\r\n                                \"User-Agent\",\r\n                                \"python-requests/2.9.1\"\r\n                            ],\r\n                            \"x-jedihttp-hmac\": [\r\n                                \"x-jedihttp-hmac\",\r\n                                \"b'yJCu5eRJU1K1dh1oNeChza+xkLN1x+qThp+YMgn6Kjg='\"\r\n                            ]\r\n                        }\r\n                    },\r\n                    \"hooks\": {\r\n                        \"response\": []\r\n                    },\r\n                    \"method\": \"POST\",\r\n                    \"url\": \"http://127.0.0.1:49298/completions\"\r\n                },\r\n                \"response\": null\r\n            },\r\n            \"message\": \"HTTPConnectionPool(host='127.0.0.1', port=49298): Max retries exceeded with url: /completions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused',))\",\r\n            \"traceback\": \"Traceback (most recent call last):\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connection.py\\\", line 137, in _new_conn\\n    (self.host, self.port), self.timeout, **extra_kw)\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py\\\", line 91, in create_connection\\n    raise err\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py\\\", line 81, in create_connection\\n    sock.connect(sa)\\nConnectionRefusedError: [Errno 111] Connection refused\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py\\\", line 559, in urlopen\\n    body=body, headers=headers)\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py\\\", line 353, in _make_request\\n    conn.request(method, url, **httplib_request_kw)\\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 1088, in request\\n    self._send_request(method, url, body, headers)\\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 1126, in _send_request\\n    self.endheaders(body)\\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 1084, in endheaders\\n    self._send_output(message_body)\\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 922, in _send_output\\n    self.send(msg)\\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 857, in send\\n    self.connect()\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connection.py\\\", line 162, in connect\\n    conn = self._new_conn()\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connection.py\\\", line 146, in _new_conn\\n    self, \\\"Failed to establish a new connection: %s\\\" % e)\\nrequests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n  File \\\"/ycmd/third_party/requests/requests/adapters.py\\\", line 376, in send\\n    timeout=timeout\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py\\\", line 609, in urlopen\\n    _stacktrace=sys.exc_info()[2])\\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/util/retry.py\\\", line 273, in increment\\n    raise MaxRetryError(_pool, url, error or ResponseError(cause))\\nrequests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=49298): Max retries exceeded with url: /completions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused',))\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n  File \\\"/ycmd/ycmd/../ycmd/handlers.py\\\", line 112, in GetCompletions\\n    .ComputeCandidates( request_data ) )\\n  File \\\"/ycmd/ycmd/../ycmd/completers/completer.py\\\", line 169, in ComputeCandidates\\n    candidates = self._GetCandidatesFromSubclass( request_data )\\n  File \\\"/ycmd/ycmd/../ycmd/completers/completer.py\\\", line 185, in _GetCandidatesFromSubclass\\n    raw_completions = self.ComputeCandidatesInner( request_data )\\n  File \\\"/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py\\\", line 255, in ComputeCandidatesInner\\n    for completion in self._JediCompletions( request_data ) ]\\n  File \\\"/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py\\\", line 260, in _JediCompletions\\n    request_data )[ 'completions' ]\\n  File \\\"/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py\\\", line 197, in _GetResponse\\n    headers = extra_headers )\\n  File \\\"/ycmd/third_party/requests/requests/api.py\\\", line 53, in request\\n    return session.request(method=method, url=url, **kwargs)\\n  File \\\"/ycmd/third_party/requests/requests/sessions.py\\\", line 468, in request\\n    resp = self.send(prep, **send_kwargs)\\n  File \\\"/ycmd/third_party/requests/requests/sessions.py\\\", line 576, in send\\n    r = adapter.send(request, **kwargs)\\n  File \\\"/ycmd/third_party/requests/requests/adapters.py\\\", line 437, in send\\n    raise ConnectionError(e, request=request)\\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=49298): Max retries exceeded with url: /completions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused',))\\n\"\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\nIs there a connection pool or concurrency setting I need to twiddle with somewhere? Here's a more human readable version of the error in that block:\r\n\r\n```\r\nHTTPConnectionPool(host='127.0.0.1', port=49298): Max retries exceeded with url: /completions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused')\r\n\r\nTraceback (most recent call last):\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connection.py\\\", line 137, in _new_conn\r\n    (self.host, self.port), self.timeout, **extra_kw)\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py\\\", line 91, in create_connection\r\n    raise err\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/util/connection.py\\\", line 81, in create_connection\r\n    sock.connect(sa)\r\nConnectionRefusedError: [Errno 111] Connection refused\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py\\\", line 559, in urlopen\r\n    body=body, headers=headers)\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py\\\", line 353, in _make_request\r\n    conn.request(method, url, **httplib_request_kw)\r\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 1088, in request\r\n    self._send_request(method, url, body, headers)\r\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 1126, in _send_request\r\n    self.endheaders(body)\r\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 1084, in endheaders\r\n    self._send_output(message_body)\r\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 922, in _send_output\r\n    self.send(msg)\r\n  File \\\"/usr/lib/python3.4/http/client.py\\\", line 857, in send\r\n    self.connect()\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connection.py\\\", line 162, in connect\r\n    conn = self._new_conn()\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connection.py\\\", line 146, in _new_conn\r\n    self, \\\"Failed to establish a new connection: %s\\\" % e)\r\nrequests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \\\"/ycmd/third_party/requests/requests/adapters.py\\\", line 376, in send\r\n    timeout=timeout\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/connectionpool.py\\\", line 609, in urlopen\r\n    _stacktrace=sys.exc_info()[2])\r\n  File \\\"/ycmd/third_party/requests/requests/packages/urllib3/util/retry.py\\\", line 273, in increment\r\n    raise MaxRetryError(_pool, url, error or ResponseError(cause))\r\nrequests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=49298): Max retries exceeded with url: /completions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused',))\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \\\"/ycmd/ycmd/../ycmd/handlers.py\\\", line 112, in GetCompletions\r\n    .ComputeCandidates( request_data ) )\r\n  File \\\"/ycmd/ycmd/../ycmd/completers/completer.py\\\", line 169, in ComputeCandidates\r\n    candidates = self._GetCandidatesFromSubclass( request_data )\r\n  File \\\"/ycmd/ycmd/../ycmd/completers/completer.py\\\", line 185, in _GetCandidatesFromSubclass\r\n    raw_completions = self.ComputeCandidatesInner( request_data )\r\n  File \\\"/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py\\\", line 255, in ComputeCandidatesInner\r\n    for completion in self._JediCompletions( request_data ) ]\r\n  File \\\"/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py\\\", line 260, in _JediCompletions\r\n    request_data )[ 'completions' ]\r\n  File \\\"/ycmd/ycmd/../ycmd/completers/python/jedi_completer.py\\\", line 197, in _GetResponse\r\n    headers = extra_headers )\r\n  File \\\"/ycmd/third_party/requests/requests/api.py\\\", line 53, in request\r\n    return session.request(method=method, url=url, **kwargs)\r\n  File \\\"/ycmd/third_party/requests/requests/sessions.py\\\", line 468, in request\r\n    resp = self.send(prep, **send_kwargs)\r\n  File \\\"/ycmd/third_party/requests/requests/sessions.py\\\", line 576, in send\r\n    r = adapter.send(request, **kwargs)\r\n  File \\\"/ycmd/third_party/requests/requests/adapters.py\\\", line 437, in send\r\n    raise ConnectionError(e, request=request)\r\nrequests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=49298): Max retries exceeded with url: /completions (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fe8fcbcd208>: Failed to establish a new connection: [Errno 111] Connection refused',))\r\n```"}}