add-apt-repository has a misleading error message when the launchpad api is down
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
software-properties (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
On Ubuntu 22.04.2
Package software-
During the launchpad outage on the 23rd June 2023, add-apt-repository was crashing with the following:
Traceback (most recent call last):
File "/usr/bin/
sys.exit(0 if addaptrepo.main() else 1)
File "/usr/bin/
shortcut = handler(source, **shortcut_params)
File "/usr/lib/
return handler(shortcut, **kwargs)
File "/usr/lib/
if self.lpppa.
File "/usr/lib/
self._lpppa = self.lpteam.
File "/usr/lib/
self._lpteam = self.lp.
File "/usr/lib/
self._lp = login_func("%s.%s" % (self.__module__, self.__
File "/usr/lib/
return cls(
File "/usr/lib/
super(
File "/usr/lib/
self.
File "/usr/lib/
response, content = self._request(url, extra_headers=
File "/usr/lib/
response, content = self._request_
File "/usr/lib/
response, content = self._connectio
File "/usr/lib/
(response, content) = self._request(
File "/usr/lib/
response, content = super(Launchpad
File "/usr/lib/
return super(RestfulHttp, self)._request(
File "/usr/lib/
(response, content) = self._conn_
File "/usr/lib/
conn.connect()
File "/usr/lib/
address_info = socket.
File "/usr/lib/
for res in _socket.
OSError: [Errno 16] Device or resource busy
This was misleading as it seemed to indicate a problem with the client and not with the server. The error message should be improved as to make it clear where the error is located.
Note that this was due to a very specialized kind of outage, namely where the machine-readable API description file fetched from api.launchpad.net refers to api.launchpad.test (which only exists in some development setups and shouldn't be referred to from production). This part of the problem was on us (the Launchpad team), and we've fixed it.
It's also a little surprising, since we had other reports of clients (including at least one that was also running Ubuntu 22.04) instead raising the rather clearer `httplib2. error.ServerNot FoundError: Unable to find the server at api.launchpad.test` (still a bit confusing of course, but it points to the problem about as well as it can). I don't know why `socket. getaddrinfo` would raise `EBUSY` in this case, though.