Comment 1 for bug 2039251

Revision history for this message
Laurent Goudet (laurentgoudet) wrote : Re: (Intermittently) cannot add PPA in Ubuntu

This is reproducible using cURL, something seems cooked with the launchpad API servers:

curl -sS -D - -o /dev/null -H 'Accept: application/json' https://launchpad.net/api/1.0/~maxmind/+archive/ubuntu/ppa
HTTP/1.1 200 OK
Date: Fri, 13 Oct 2023 13:52:15 GMT
Server: gunicorn
Content-Type: application/json
x-powered-by: Zope (www.zope.org), Python (www.python.org)
Content-Length: 0
content-security-policy: frame-ancestors 'self';
ETag: "4da4ac44a91c53ba7dbeb3fcc6e16eab40eff6b9-5b65841c4222b140eee5758e4d96403bbb8d6d1b"
strict-transport-security: max-age=15552000
Vary: Accept
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-launchpad-revision: bd6cfd0cfc024dbe1dcd7d5d91165fb4f6a6c596
x-lazr-notifications: []
x-xss-protection: 1; mode=block
x-vcs-revision: bd6cfd0cfc024dbe1dcd7d5d91165fb4f6a6c596
x-request-id: c070f93a-02d4-430c-9567-a4ec9ad45b6b
Age: 973
X-Cache: HIT from juju-98d295-prod-launchpad-29
X-Cache-Lookup: HIT from juju-98d295-prod-launchpad-29:3128
Via: 1.1 juju-98d295-prod-launchpad-29 (squid/4.10)

Notice above the "Content-Length: 0", i.e. API servers return empty 0-byte responses. Running the same command a couple of seconds later show:

curl -sS -D - -o /dev/null -H 'Accept: application/json' https://launchpad.net/api/1.0/~maxmind/+archive/ubuntu/ppa
HTTP/1.1 200 OK
Date: Fri, 13 Oct 2023 11:07:37 GMT
Server: gunicorn
x-powered-by: Zope (www.zope.org), Python (www.python.org)
Content-Length: 977
content-security-policy: frame-ancestors 'self';
Content-Type: application/json
ETag: "4da4ac44a91c53ba7dbeb3fcc6e16eab40eff6b9-5b65841c4222b140eee5758e4d96403bbb8d6d1b"
strict-transport-security: max-age=15552000
Vary: Accept,Accept-Encoding
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-launchpad-revision: bd6cfd0cfc024dbe1dcd7d5d91165fb4f6a6c596
x-lazr-notifications: []
x-xss-protection: 1; mode=block
x-vcs-revision: bd6cfd0cfc024dbe1dcd7d5d91165fb4f6a6c596
x-request-id: d843e87b-38a0-48da-98b3-cf5940204043
Age: 976
X-Cache: HIT from juju-98d295-prod-launchpad-29
X-Cache-Lookup: HIT from juju-98d295-prod-launchpad-29:3128
Via: 1.1 juju-98d295-prod-launchpad-29 (squid/4.10)

A noticeable difference here is the "Vary: Accept" vs "Vary: Accept,Accept-Encoding", but in short the edge servers seem to be caching/serving 0-byte responses, which causes apt-add-repository to fail to find the packages.