pre-commit-ci / issues

public issues for https://pre-commit.ci
17 stars 4 forks source link

Request failed with HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded #47

Closed andreoliwa closed 3 years ago

andreoliwa commented 3 years ago

First of all, thank you for https://pre-commit.com/ and https://pre-commit.ci/!

I'm getting connection errors accessing a raw GitHub URL, but only when the hook runs on pre-commit.ci. Full log here.

Errors:

More info:

  1. "It works on my machine"... 😅 I haven't seen this error so far when running pre-commit locally.
  2. The referenced URL exists: raw GitHub URL and corresponding GitHub URL.
  3. Here is the pre-commit.ci result.
  4. The full log is also copied in the collapsible details below.
  5. I tried configuring max_retries on requests.

CC @jaysonsantos

``` Nitpick (CLI, apply changes).............................................Passed - hook id: nitpick-run - duration: 0.44s 2021-03-22 23:14:57.677 | DEBUG | nitpick.project:find_root:58 - Searching root from current dir: '/code' 2021-03-22 23:14:57.678 | DEBUG | nitpick.project:find_root:60 - All files/dirs in the current dir: /code/.git /code/.gitignore /code/.cz.toml /code/README.md /code/nitpick-style.toml /code/.pre-commit-config.yaml /code/tests /code/src /code/Cargo.lock /code/build.rs /code/Cargo.toml /code/.github /code/.editorconfig /code/docker-compose.yaml 2021-03-22 23:14:57.678 | DEBUG | nitpick.project:find_root:66 - Climbing dir: /code 2021-03-22 23:14:57.678 | DEBUG | nitpick.project:find_root:71 - Project files seen: {PosixPath('/code/.pre-commit-config.yaml')} 2021-03-22 23:14:57.678 | DEBUG | nitpick.project:find_root:85 - Root dirs: {PosixPath('/code')} 2021-03-22 23:14:57.679 | DEBUG | nitpick.project:find_root:66 - Climbing dir: / 2021-03-22 23:14:57.679 | DEBUG | nitpick.project:find_root:71 - Project files seen: set() 2021-03-22 23:14:57.679 | DEBUG | nitpick.project:find_root:98 - Top root dir found: /code 2021-03-22 23:14:57.789 | INFO | nitpick.style:find_initial_styles:126 - Found style climbing the directory tree: /code/nitpick-style.toml 2021-03-22 23:14:57.789 | DEBUG | nitpick.style:fetch_style_from_local_path:326 - Loading style from local path /code/nitpick-style.toml 2021-03-22 23:14:57.790 | DEBUG | nitpick.style:fetch_style_from_url:240 - URL: raw https://raw.githubusercontent.com/andreoliwa/nitpick/develop/styles/editorconfig.toml 2021-03-22 23:14:57.791 | DEBUG | nitpick.style:fetch_from_url_or_cache:283 - Requesting style from URL https://raw.githubusercontent.com/andreoliwa/nitpick/develop/styles/editorconfig.toml 2021-03-22 23:14:57.795 | WARNING | nitpick.style:fetch_style_from_url:254 - Content of /etc/hosts: 127.0.0.1 localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts 127.0.1.1 442834e8634a tender_stonebraker 2021-03-22 23:14:57.796 | ERROR | nitpick.style:fetch_style_from_url:255 - Request failed with HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /andreoliwa/nitpick/develop/styles/editorconfig.toml (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( │ └ └ │ │ │ │ │ └ │ │ │ │ └ │ │ │ └ 443 │ │ └ 'raw.githubusercontent.com' │ └ └ File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): │ │ │ │ │ │ │ └ 0 │ │ │ │ │ │ └ 0 │ │ │ │ │ └ │ │ │ │ └ │ │ │ └ 443 │ │ └ 'raw.githubusercontent.com' │ └ └ socket.gaierror: [Errno -3] Temporary failure in name resolution During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) │ │ └ │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect conn = self._new_conn() │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn raise NewConnectionError( └ urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno -3] Temporary failure in name resolution During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen retries = retries.increment( │ └ └ Retry(total=0, connect=None, read=False, redirect=None, status=None) File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) │ │ │ │ │ └ 'unknown' │ │ │ │ └ │ │ │ └ NewConnectionError(': Failed to establish a new connection: [Err... │ │ └ '/andreoliwa/nitpick/develop/styles/editorconfig.toml' │ └ └ urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /andreoliwa/nitpick/develop/styles/editorconfig.toml (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/bin/nitpick", line 8, in sys.exit(nitpick_cli()) │ │ └ │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) │ │ └ │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) │ │ │ │ └ │ │ │ └ │ │ └ │ └ └ ._process_result at 0x7f930b0a91f0> File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) │ │ │ │ │ └ {'verbose': True, 'files': (), 'check_only': False} │ │ │ │ └ │ │ │ └ │ │ └ │ └ └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) │ │ └ {'verbose': True, 'files': (), 'check_only': False} │ └ () └ File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) │ │ │ └ {'verbose': True, 'files': (), 'check_only': False} │ │ (output truncated) ```
asottile commented 3 years ago

pre-commit.ci intentionally does not allow network access at runtime for free tier as this is easy to abuse (miners, etc.)

this may be offered in the pro tier in the future, but for now make sure any installation is done at install time instead of at runtime