Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit: Temporary failure in name resolution #164

Closed
Avasam opened this issue Mar 24, 2023 · 3 comments
Closed

pre-commit: Temporary failure in name resolution #164

Avasam opened this issue Mar 24, 2023 · 3 comments

Comments

@Avasam
Copy link

Avasam commented Mar 24, 2023

I am unable to use this action with pre-commit.ci, see this run: https://results.pre-commit.ci/run/github/590722908/1679661177.MbHCS6NnRWWUN9bswKc3Eg

/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/nodeenv.py:26: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
  import pipes
Traceback (most recent call last):
  File "/usr/lib/python3.11/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 1447, in connect
    super().connect()
  File "/usr/lib/python3.11/http/client.py", line 941, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 827, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/nodeenv.py", line 1519, in <module>
    main()
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/nodeenv.py", line 1093, in main
    args.node = get_last_stable_node_version()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/nodeenv.py", line 1026, in get_last_stable_node_version
    return _get_versions_json()[0]['version'].lstrip('v')
           ^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/nodeenv.py", line 1002, in _get_versions_json
    response = urlopen('%s/index.json' % src_base_url)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/nodeenv.py", line 624, in urlopen
    return urllib2.urlopen(req)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
Traceback (most recent call last):
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/bin/pyright", line 8, in <module>
    sys.exit(entrypoint())
             ^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/cli.py", line 34, in entrypoint
    sys.exit(main(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/cli.py", line 19, in main
    return run(*args, **kwargs).returncode
           ^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/cli.py", line 25, in run
    pkg_dir = install_pyright(args, quiet=None)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/_utils.py", line 61, in install_pyright
    node.run(
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/node.py", line 98, in run
    binary = _ensure_available(target)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/node.py", line 37, in _ensure_available
    return Binary(path=_ensure_node_env(target), strategy=Strategy.NODEENV)
                       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/node.py", line 64, in _ensure_node_env
    _install_node_env()
  File "/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/lib/python3.11/site-packages/pyright/node.py", line 91, in _install_node_env
    subprocess.run(args, check=True)
  File "/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/pc/clone/uy_ziTtWRGGmDsK6CW-fSA/py_env-python3/bin/python', '-m', 'nodeenv', '/tmp/cache/pyright-python/nodeenv']' returned non-zero exit status 1.
@kzndotsh
Copy link

@Avasam
Copy link
Author

Avasam commented Aug 31, 2024

I know pre-commit hooks don't have internet access at runtime on the CI (only at download/setup) for the free tier. Could this be related? For example if the action is calling npx or trying to check for an update online.

@RobertCraigie
Copy link
Owner

Yes this will be because the pre-commit hook doesn't have internet access.

I'm going to close this in favour of #231 as once the pyright npm package is bundled, this will be resolved.

@RobertCraigie RobertCraigie closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants