Pacman-mirrors connection reset error

Hi there, I did a sudo pacman -Syyu and there was an update only for pacman-mirrors package. I proceeded and i get this below error:

Terminal Output
[sudo] password for dstyle: 
:: Synchronising package databases...
 core                          164.9 KiB   182 KiB/s 00:01 [################################] 100%
 extra                        2000.5 KiB   351 KiB/s 00:06 [################################] 100%
 community                       6.6 MiB   304 KiB/s 00:22 [################################] 100%
 multilib                      180.5 KiB   195 KiB/s 00:01 [################################] 100%
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (1) pacman-mirrors-4.20.1-1

Total Download Size:   0.14 MiB
Total Installed Size:  0.63 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 pacman-mirrors-4.20.1-1-any   142.4 KiB   106 KiB/s 00:01 [################################] 100%
(1/1) checking keys in keyring                             [################################] 100%
(1/1) checking package integrity                           [################################] 100%
(1/1) loading package files                                [################################] 100%
(1/1) checking for file conflicts                          [################################] 100%
(1/1) checking available disk space                        [################################] 100%
:: Processing package changes...
(1/1) upgrading pacman-mirrors                             [################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Configuring pacman-mirrors ...
::WARNING https://gitlab.manjaro.org '('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))'
::WARNING https://gitlab.manjaro.org '('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))'
::INFO Downloading mirrors from repo.manjaro.org
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 428, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 472, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3.9/site-packages/urllib3/util/retry.py", line 531, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3.9/site-packages/urllib3/packages/six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 428, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 472, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pacman-mirrors", line 28, in <module>
    pm.run()
  File "/usr/lib/python3.9/site-packages/pacman_mirrors/pacman_mirrors.py", line 101, in run
    httpFn.download_mirror_pool(config=self.config, tty=self.tty, quiet=self.quiet)
  File "/usr/lib/python3.9/site-packages/pacman_mirrors/functions/httpFn.py", line 190, in download_mirror_pool
    result = download_mirrors(config)
  File "/usr/lib/python3.9/site-packages/pacman_mirrors/functions/httpFn.py", line 59, in download_mirrors
    resp = requests.get(url=config["url_mirrors_json"],
  File "/usr/lib/python3.9/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
hint: use `pacman-mirrors` to generate and update your pacman mirrorlist.

The same connection reset error is happening when i did try to run pacman-mirrors --fasttrack . This may not bug me for a severe issue… but could be of a concern in the near future! Any help is appreciated!

TIA
-dstyle

pacman-mirrors always fetches the mirror-pool from gitlab - I think this is an intermittent problem with accessing Manjaro gitlab instance.

I will see if and how to reproduce the error so it could be handled another way.

From the message it seems a call to the python requests library is failing because repo doesn’t respond or the instance is restarting and the request is rejected.

  File "/usr/lib/python3.9/site-packages/pacman_mirrors/functions/httpFn.py", line 59, in download_mirrors
    resp = requests.get(url=config["url_mirrors_json"],
1 Like

well if it’s an intermittent issue no prob at all! I Will report back if it’s perpetual. For now, I still get this at the time of this post(or since 2H of OP)

I have created a test package of pacman-mirrors v4.20.2-1

The package contains extended error catching for various kinds of errors the requests module can raise.

It is available from testing and unstable repo and can be installed by pointing directly to the package using pacman -U

sudo pacman -U https://www.uex.dk/public/manjaro/pool/overlay/pacman-mirrors-4.20.2-1-any.pkg.tar.zst

I am still thinking of a method to create a reliable test - I will have to fake a connection reset - and I am speculating how to do that.

It was not that easy but I managed to recreate some unresponsiveness by using a server I control and thus being able to simulate a variety of bad responses.

pacman-mirrors now fetches the mirrors.json datafile from repo.manjaro.org.

This has been done to avoid pacman-mirrors connecting to the gitlab instance when the instance receives maintenance.

I blocked ipv6 address 2a01: 4f8: c2c: c956 :: 1 for gitlab’manjaro’org, the site opened and pacman-mirrors was updated.

1 Like