Snaps unavailable for your architecture are effectively reported as not existing at all

Bug #1701232 reported by Barry Price on 2017-06-29
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snap Store
Medium
Unassigned
snapd
Medium
Unassigned
snapd (Ubuntu)
Medium
Unassigned

Bug Description

The error message given when a certain snap exists for some architectures, but not yours, is identical to that for a snap that doesn't exist at all.

See, e.g.:

ubuntu@ubuntu:~$ uname -i
x86_64
ubuntu@ubuntu:~$ sudo snap install xyzzy-made-up-name
error: cannot install "xyzzy-made-up-name": snap not found

vs:

ubuntu@ubuntu:~$ uname -i
x86_64
ubuntu@ubuntu:~$ sudo snap install robotfindskitten
robotfindskitten 1 from 'petevg' installed

and

ubuntu@ubuntu:~$ uname -i
aarch64
ubuntu@ubuntu:~$ sudo snap install robotfindskitten
error: cannot install "robotfindskitten": snap not found
ubuntu@ubuntu:~$

It would reduce user confusion if in the second error, the message was something along the lines of:

error: cannot install "robotfindskitten": snap exists, but is not compatible with your architecture (aarch64)

Haw Loeung (hloeung) on 2017-07-19
Changed in snapd:
status: New → Confirmed
Changed in snapd (Ubuntu):
status: New → Confirmed
Michael Vogt (mvo) wrote :

Ideally the store would provide the required information. We get currently:
"""
$ http --pretty=format --print b https://api.snapcraft.io/api/v1/snaps/details/robotfindskitten X-Ubuntu-Architecture:arm64 X-Ubuntu-Series:16 fields==anon_download_url,architecture,channel,download_sha3_384,summary,description,binary_filesize,download_url,icon_url,last_updated,license,package_name,prices,publisher,ratings_average,revision,screenshot_urls,snap_id,support_url,title,content,version,origin,developer_id,private,confinement channel==edge
{
    "error_list": [
        {
            "code": "resource-not-found",
            "message": "Snap 'robotfindskitten' (CDwOz6O4zGyVXLcHbxWx9K7XTGmZCBye) has no published revisions in the given context."
        }
    ],
    "errors": [
        "Snap 'robotfindskitten' (CDwOz6O4zGyVXLcHbxWx9K7XTGmZCBye) has no published revisions in the given context."
    ],
    "result": "error"
}

"""

As a workaround we do it with the current store responses. Then we would have to do an additional http request that omits "X-Ubuntu-Architecture" after each 404. If this extra request did not give us a 404 we can print the nicer error message. But it would be preferable to have this from the store directly.

Changed in snapd:
importance: Undecided → Medium
status: Confirmed → Triaged
John Lenton (chipaca) wrote :

Omiting architecture makes it default to amd64 afaik; you'd need to know the list of architectures of the store you're querying, and loop

Michael Vogt (mvo) on 2018-01-16
Changed in snapd (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
William Grant (wgrant) on 2018-05-09
Changed in snapstore:
importance: Undecided → Medium
status: New → Triaged
Daniel Manrique (roadmr) wrote :

$ uname -i
x86_64
ubuntu@bionic-snap:~$ snap install pi-kernel
error: snap "pi-kernel" is not available on this architecture (amd64) but exists on other
       architectures (arm64, armhf).

Note I had to know the name of the snap in advance; snapd does send the architecture header which restricts what gets returned by snap find or snap info.

Changed in snapstore:
status: Triaged → Fix Released
Daniel Manrique (roadmr) wrote :

I marked the store task as fix released, but I believe the snapd tasks can be marked as such as well.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers