Musicbrainz network error

It’s entirely random, but sometimes during a long import, I’ll get a network error and my import will stop. I don’t mind it that much, except it causes all of my non-music sorting to get skipped on said albums. Is it just a case of my internet is spotty, or is there actually something in my config that I’ve done that may be triggering this?

Here’s the -vv of one such case:

No album ID found.
Search terms: Vitamin String Quartet - String In The New Year! The New Year's String Collection
Album might be VA: False
Searching for MusicBrainz releases with: {'release': "string in the new year! the new year's string collection", 'artist': 'vitamin string quartet', 'tracks': '12'}
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 1298, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1344, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1293, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1052, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 990, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 1463, in connect
    super().connect()
  File "/usr/lib/python3.11/http/client.py", line 956, 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] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/musicbrainzngs/musicbrainz.py", line 497, in _safe_read
    f = opener.open(req)
        ^^^^^^^^^^^^^^^^
  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] Try again>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/beets/autotag/mb.py", line 729, in match_album
    res = musicbrainzngs.search_releases(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/musicbrainzngs/musicbrainz.py", line 978, in search_releases
    return _do_mb_search('release', query, fields, limit, offset, strict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/musicbrainzngs/musicbrainz.py", line 782, in _do_mb_search
    return _do_mb_query(entity, '', [], params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/musicbrainzngs/musicbrainz.py", line 728, in _do_mb_query
    return _mb_request(path, 'GET', auth_required, args=args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/musicbrainzngs/musicbrainz.py", line 417, in __call__
    return self.fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/musicbrainzngs/musicbrainz.py", line 690, in _mb_request
    resp = _safe_read(opener, req, body)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/musicbrainzngs/musicbrainz.py", line 525, in _safe_read
    raise NetworkError(cause=exc)
musicbrainzngs.musicbrainz.NetworkError: caused by: <urlopen error [Errno -3] Try again>

Error: MusicBrainz not reachable in release search with query {'release': "string in the new year! the new year's string collection", 'artist': 'vitamin string quartet', 'tracks': '12'}
abc@8e4fe40f4a2b:/$ 

If needed I can post my config (it’s quite long)

I had problems with both Musicbrainz and Discogs halting unexpectedly (and seemingly at random) while processing large collections. The problem went on for several years until the network equipment (router, switch) was upgraded and the issue essentially disappeared (knock on wood!). I suspect the culprit was the router as it was ancient but have no proof. Regarding your “spotty” connection, as the Internet is a “collection of routers”, so to speak, it could be that as well. I still see occasional long pauses while processing tracks but have not seen an indefinite one for some time. I hope this helps.

Hey, I appreciate your experience with it. My internet’s not bad as I’ve never actually noticed any issues with connections until this, but yeah maybe it’s time for me to upgrade some of the network. Hope your connection issues are gone for good!