snap find --private without snap name yields 401 error

Bug #1750646 reported by Bret Barker
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
Fix Released
Low
Unassigned

Bug Description

Revision history for this message
Bret Barker (noise) wrote :

$ snap version
snap 2.31.1
snapd 2.31.1
series 16
ubuntu 16.04
kernel 4.4.0-112-generic

Revision history for this message
Bret Barker (noise) wrote :

I have been unable to repro this on other systems, yet consistently on that one. Odd but closing unless I see it elsewhere.

Changed in snapstore:
status: New → Invalid
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

FWIW, I'm able to reproduce on xenial, but not on artful.

$ snap find --private
error: cannot search: got unexpected HTTP status code 401 via GET to
       "https://api.snapcraft.io/api/v1/snaps/search?confinement=strict%2Cclassic&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%2Clicense%2Cbase%2Csupport_url%2Ccontact%2Ctitle%2Ccontent%2Cversion%2Corigin%2Cdeveloper_id%2Cprivate%2Cconfinement%2Cchannel_maps_list&private=true&q=&section=featured"
$ snap find --private foo
No matching snaps for "foo"
$ snap version
snap 2.31.1
snapd 2.31.1
series 16
ubuntu 16.04
kernel 4.13.0-32-generic

$ snap find --private
No matching snaps for "" in section "featured"
$ snap find --private foo
No matching snaps for "foo"
$ snap version
snap 2.31.1
snapd 2.31.1
series 16
ubuntu 17.10
kernel 4.13.0-36-generic

Bret Barker (noise)
Changed in snapstore:
status: Invalid → Confirmed
importance: Undecided → Low
Revision history for this message
Matias Bordese (matiasb) wrote :

FYI, the problem here seems to be that when not query is passed (a section request) to the search endpoint in a private request, the first thing we do is verify auth and if it fails, return a 401.
Meanwhile, if a filter is given (like a name), we filter at a deeper level (snapident) without returning authenticated/private results if auth is not ok or missing (and without raising an error).

Revision history for this message
Bret Barker (noise) wrote :

Can't repro right now, marking fixed, we can reopen if it crops up again.

Changed in snapstore:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.