Skip to content

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

Closed

Description

@andreoliwa

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:

  • socket.gaierror: [Errno -3] Temporary failure in name resolution
  • urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f930948b910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
  • urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /andreoliwa/nitpick/develop/styles/editorconfig.toml (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f930948b910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

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

Details
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('<urllib3.connection.HTTPSConnection object at 0x7f930948b910>: 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(
           │          └ <function create_connection at 0x7f9309ca3280>
           └ <module 'urllib3.util.connection' from '/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/u...
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
               │      │           │     │     │       │      └ <SocketKind.SOCK_STREAM: 1>
               │      │           │     │     │       └ <module 'socket' from '/usr/lib/python3.8/socket.py'>
               │      │           │     │     └ <AddressFamily.AF_UNSPEC: 0>
               │      │           │     └ 443
               │      │           └ 'raw.githubusercontent.com'
               │      └ <function getaddrinfo at 0x7f930adb3f70>
               └ <module 'socket' from '/usr/lib/python3.8/socket.py'>
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               │       │           │     │     │       │     │      └ 0
               │       │           │     │     │       │     └ 0
               │       │           │     │     │       └ <SocketKind.SOCK_STREAM: 1>
               │       │           │     │     └ <AddressFamily.AF_UNSPEC: 0>
               │       │           │     └ 443
               │       │           └ 'raw.githubusercontent.com'
               │       └ <built-in function getaddrinfo>
               └ <module '_socket' (built-in)>

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(
                       │    └ <function HTTPConnectionPool._make_request at 0x7f9309c72670>
                       └ <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f9309587970>
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
    │    │              └ <urllib3.connection.HTTPSConnection object at 0x7f930948b910>
    │    └ <function HTTPSConnectionPool._validate_conn at 0x7f9309c72b80>
    └ <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f9309587970>
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
    │    └ <function HTTPSConnection.connect at 0x7f9309c57550>
    └ <urllib3.connection.HTTPSConnection object at 0x7f930948b910>
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect
    conn = self._new_conn()
           │    └ <function HTTPConnection._new_conn at 0x7f9309c56f70>
           └ <urllib3.connection.HTTPSConnection object at 0x7f930948b910>
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
          └ <class 'urllib3.exceptions.NewConnectionError'>

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f930948b910>: 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(
           │    └ <function HTTPConnectionPool.urlopen at 0x7f9309c728b0>
           └ <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f9309587970>
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
              │       └ <function Retry.increment at 0x7f9309cae9d0>
              └ 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'
          │             │      │    │        └ <class 'urllib3.exceptions.ResponseError'>
          │             │      │    └ NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f930948b910>: Failed to establish a new connection: [Err...
          │             │      └ '/andreoliwa/nitpick/develop/styles/editorconfig.toml'
          │             └ <urllib3.connectionpool.HTTPSConnectionPool object at 0x7f9309587970>
          └ <class 'urllib3.exceptions.MaxRetryError'>

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /andreoliwa/nitpick/develop/styles/editorconfig.toml (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f930948b910>: 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 <module>
    sys.exit(nitpick_cli())
    │   │    └ <Group nitpick-cli>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0x7f930a56d3a0>
           └ <Group nitpick-cli>
  File "/pc/clone/_aHRZyvbSoGfjjVZ4daquw/py_env-python3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
         │    │      └ <click.core.Context object at 0x7f930af3aa90>
         │    └ <function MultiCommand.invoke at 0x7f930a56e160>
         └ <Group nitpick-cli>
  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))
           │               │       │       │      └ <click.core.Context object at 0x7f930afb1490>
           │               │       │       └ <function Command.invoke at 0x7f930a56dd30>
           │               │       └ <Command run>
           │               └ <click.core.Context object at 0x7f930afb1490>
           └ <function MultiCommand.invoke.<locals>._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}
           │   │      │    │           └ <click.core.Context object at 0x7f930afb1490>
           │   │      │    └ <function run at 0x7f9309d1c670>
           │   │      └ <Command run>
           │   └ <function Context.invoke at 0x7f930a56ae50>
           └ <click.core.Context object at 0x7f930afb1490>
  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}
           │         └ ()
           └ <function run at 0x7f9309d1c670>
  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)

Activity

  1. asottile commented on Mar 23, 2021

    @asottile
    Member

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions