Repository navigation
Driver Manager reports "You appear to be offline": archive.ubuntu.com returns 403 to default Python-urllib User-Agent #110
Description
Summary
Driver Manager incorrectly reports "You appear to be offline" on a fully online system. The connectivity probe in mintdrivers.py is a single urllib.request.urlopen("http://archive.ubuntu.com", timeout=10) call with the default Python-urllib/X.Y User-Agent, which archive.ubuntu.com now answers with HTTP 403 Forbidden. The bare except: then classifies any failure as "offline".
This is a separate regression from #108 (closed 2026-01-16), but on the same code path: that issue was resolved by reverting the probe to archive.ubuntu.com, and now that endpoint itself rejects the request. The mintdrivers connectivity check has now broken twice on Mint 22.x; it would be worth replacing it with something more durable (see suggestions below).
Environment
- Linux Mint 22 (wilma)
mintdrivers1.8.1- Python 3.12.3
- NetworkManager:
nmcli networking connectivity checkreturnsfull - Browser,
apt,curl: all work
Reproduction
$ curl -sS -o /dev/null -w '%{http_code}\n' -A 'Python-urllib/3.12' http://archive.ubuntu.com
403
$ curl -sS -o /dev/null -w '%{http_code}\n' -A 'Mozilla/5.0' http://archive.ubuntu.com
200
$ curl -sS -o /dev/null -w '%{http_code}\n' -A '' http://archive.ubuntu.com
200
$ python3 -c "import urllib.request; urllib.request.urlopen('http://archive.ubuntu.com', timeout=10)"
urllib.error.HTTPError: HTTP Error 403: ForbiddenLaunching mintdrivers then prints:
Checking Internet connectivity...
--> Computer is offline
…and shows the offline page, even though the machine is online.
Root cause
/usr/lib/linuxmint/mintdrivers/mintdrivers.py, lines ~162–180:
def check_connectivity(self, reference):
try:
urllib.request.urlopen(reference, timeout=10)
return True
except:
return False
@idle
def check_internet_or_live_media(self, widget=None):
self.show_page("refresh_page")
print ("Checking Internet connectivity...")
try:
urllib.request.urlopen("http://archive.ubuntu.com", timeout=10)
...
except:
print (" --> Computer is offline")Two design problems:
- Default
Python-urllib/*User-Agent is filtered server-side byarchive.ubuntu.com. This is a global condition (every Mint user is affected), not a local misconfiguration. - Bare
except:silently turns any error (HTTP 4xx/5xx, TLS issue, captive-portal HTML, redirect loop, proxy quirk) into "offline", which is a poor signal.
Suggested fix
In order of increasing robustness:
(a) Minimal change — set a non-default User-Agent on the probe:
req = urllib.request.Request(
"http://archive.ubuntu.com",
headers={"User-Agent": "mintdrivers/1.8.1"},
)
urllib.request.urlopen(req, timeout=10)(b) Better — probe the user's actual configured mirror (as suggested by @svalentin1984 in #108), e.g. read it from /etc/apt/sources.list.d/official-package-repositories.list or via python3-apt. That makes the probe representative of what apt will actually do, and immune to anti-bot filtering on the upstream Ubuntu mirror.
(c) Best — delegate the decision to NetworkManager, which already maintains an authoritative connectivity state used everywhere else in Mint:
from gi.repository import NM
client = NM.Client.new(None)
online = client.get_connectivity() == NM.ConnectivityState.FULLThis eliminates the network call from mintdrivers entirely — no hard-coded host, no UA, no bare except:. NM already does the probe (against connectivity-check.ubuntu.com) and exposes the verdict via D-Bus.
Impact
Every Mint 22 user without a custom workaround currently sees the offline page in Driver Manager and cannot install drivers despite being online. The trigger is server-side, so this will keep happening to new users until the probe is changed. Given that #108 was opened in January and the same connectivity check has now broken in a different way, a more durable approach (NM API, or the user's configured mirror) seems worth doing once.
Activity
FabioLeitao commentedon Jun 6, 2026
This appears to be fixed in the current master by commit 186bebd (released in 1.8.8, 2026-01-16).
The connectivity probe was iteratively reworked:
urllib.request.urlopenwithsocket.create_connection— removed the User-Agent issue entirely8.8.8.8:53toarchive.ubuntu.com:443to probe the actual APT repositoryCurrent code in
mintdrivers.py:No HTTP request is made, so there is no User-Agent to filter. The bug described here no longer exists in 1.8.8+. Feel free to close if you confirm.