antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
17.03k stars 3.27k forks source link

Antlr4 failing to reach out to Maven repository #4703

Open Cazra opened 2 days ago

Cazra commented 2 days ago

This morning, I've been having trouble trying to do anything at all with Antlr4. I can't use it to build any of my grammars, and not even antlr4 --help works.

I get the following error output:

Traceback (most recent call last):
  File "/usr/local/bin/antlr4", line 8, in <module>
    sys.exit(tool())
  File "/usr/local/lib/python3.10/dist-packages/antlr4_tool_runner.py", line 141, in tool
    run_cli('org.antlr.v4.Tool')
  File "/usr/local/lib/python3.10/dist-packages/antlr4_tool_runner.py", line 132, in run_cli
    args, version = process_args()
  File "/usr/local/lib/python3.10/dist-packages/antlr4_tool_runner.py", line 126, in process_args
    args.version or os.environ.get("ANTLR4_TOOLS_ANTLR_VERSION") or latest_version()
  File "/usr/local/lib/python3.10/dist-packages/antlr4_tool_runner.py", line 27, in latest_version
    with urlopen(f"https://search.maven.org/solrsearch/select?q=a:antlr4-master+g:org.antlr", timeout=10) as response:
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.10/urllib/request.py", line 1352, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.10/http/client.py", line 1375, in getresponse
    response.begin()
  File "/usr/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.10/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.10/socket.py", line 705, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.10/ssl.py", line 1303, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.10/ssl.py", line 1159, in read
    return self._sslobj.read(len, buffer)
TimeoutError: The read operation timed out

It appears to be timing out when it reaches out to its Maven repository.

kaby76 commented 2 days ago

https://search.maven.org/solrsearch/select?q=a:antlr4-master+g:org.antlr. I mentioned this here. https://github.com/antlr/antlr4/issues/4698#issuecomment-2376841225. The change, which should be in the antlr4-tools repo, looks instead to https://repo1.maven.org/maven2/org/antlr/antlr4/, avoiding search.maven.org entirely, which is not robust, frequently down--more often than not!