Fwiw, I saw a similar test failure in e.g. snap download tests and some other tests. It seems like the store had some issues in the last hours, I also noticed increased timeouts in our tests, e.g.:
May 17 18:49:56 autopkgtest snapd[16392]: 2017/05/17 18:49:56.988020 retry.go:61: DEBUG: The retry loop for https://search.apps.ubuntu.com/api/v1/snaps/details/test-snapd-control-consumer?channel=edge&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cdeltas%2Cbinary_filesize%2Cdownload_url%2Cepoch%2Cicon_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Cscreenshot_urls%2Csnap_id%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cprivate%2Cconfinement%2Cchannel_maps_list finished after 4 retries, elapsed time=40.008731626s, status: Get https://search.apps.ubuntu.com/api/v1/snaps/details/test-snapd-control-consumer?channel=edge&fields=anon_download_url%2Carchitecture%2Cchannel%2Cdownload_sha3_384%2Csummary%2Cdescription%2Cdeltas%2Cbinary_filesize%2Cdownload_url%2Cepoch%2Cicon_url%2Clast_updated%2Cpackage_name%2Cprices%2Cpublisher%2Cratings_average%2Crevision%2Cscreenshot_urls%2Csnap_id%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cprivate%2Cconfinement%2Cchannel_maps_list: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
the key is finished after 4 retries, elapsed time=40.008731626s, status: Get https://search.apps.ubuntu.com/api/v1/snaps/details/test-snapd-control-consumer?
i.e. snapd retried 4 times and for a total of 40s without success.
Interestingly your log and my log have similar timestamps.
We need to get this fixed into snapd itself right away. It felt like a bad idea at the time, and now it’s pretty obvious that it’s a bad idea to rely on general HTTP codes as meaning something specific.
We already had a discussion with you and Pete around fixing it somehow in snapd, we didn’t reach an agreement, we don’t have the right information at that point unless we shuffle some things in snap/info.go etc … otherwise the only cheap snapd approach is to make the error much more vague until the store does better. Of course here the store is turning what should be a 50x into a 401 , that’s an extreme case of bad error reporting.