Snap store suggests invalid channels for unpublished snap

Bug #2001725 reported by Ethan Myers
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snap Store Server
Triaged
Undecided
Unassigned

Bug Description

```
$ snap version

snap 2.57.6
snapd 2.57.6
series 16
ubuntu 22.04
kernel 5.15.0-56-generic
```

The snap 'vscode', as of Jan 4 2023, does not show up in snap info or on the snap store website. However, running ```snap install vscode``` will erroneously suggest installing a beta/edge/candidate version instead of latest/stable.

```
$ sudo snap install vscode
error: snap "vscode" is not available on stable but is available to install on the following
       channels:

       candidate snap install --candidate vscode
       beta snap install --beta vscode
       edge snap install --edge vscode

       Please be mindful pre-release channels may include features not completely tested or
       implemented. Get more information with 'snap info vscode'.

```

The 'real' snap is called ```code```.

I think the snap store should either actually report a not found error, or suggest the correct snap, ```code```. APT does something similar with common misspellings. Either way, snap should not report the non-working channels.

Ethan Myers (ethanmyers)
summary: - Snap store suggest differenet channels for unpublished snap
+ Snap store suggests invalid channels for unpublished snap
Revision history for this message
Guillermo Gonzalez (verterok) wrote (last edit ):
Download full text (4.1 KiB)

Thanks for reporting this.

Will state some facts/findings related to this for the next one looking at it.:

The snap is marked as unlisted.

snap info not showing it, needs further investigation.

This seems to be a problem related to the unpublishing from all channels, as vscode had releases at some point. Now the revisions are still there but the channels were cleared to prevent installs from this snap.

❯ curl -XPOST -H "Snap-Device-Architecture: amd64" -H "Snap-Device-Series: 16" -s https://api.snapcraft.io/v2/snaps/refresh -H 'Content-type: application/json' -d '{ "context": [], "actions": [{"name": "vscode", "channel": "stable", "action": "install", "instance-key": "a-test"}]}' | jq
{
  "error-list": [],
  "results": [
    {
      "error": {
        "code": "revision-not-found",
        "extra": {
          "releases": [
            {
              "architecture": "amd64",
              "channel": "candidate"
            },
            {
              "architecture": "amd64",
              "channel": "beta"
            },
            {
              "architecture": "amd64",
              "channel": "edge"
            },
            {
              "architecture": "i386",
              "channel": "candidate"
            },
            {
              "architecture": "i386",
              "channel": "beta"
            },
            {
              "architecture": "i386",
              "channel": "edge"
            }
          ]
        },
        "message": "No revision was found in the Store."
      },
      "instance-key": "a-test",
      "name": "vscode",
      "released-at": null,
      "result": "error",
      "snap": {
        "license": "Proprietary",
        "name": "vscode",
        "prices": {},
        "publisher": {
          "display-name": "Snapcrafters",
          "id": "eEoV9TnaNkCzfJBu9SRhr2678vzyYV43",
          "username": "snapcrafters",
          "validation": "unproven"
        },
        "snap-id": "XPQdduIwHiDCZvPHRrmsqV7Nr6nQRuqM",
      },
      "instance-key": "a-test",
      "name": "vscode",
      "released-at": null,
      "result": "error",
      "snap": {
        "license": "Proprietary",
        "name": "vscode",
        "prices": {},
        "publisher": {
          "display-name": "Snapcrafters",
          "id": "eEoV9TnaNkCzfJBu9SRhr2678vzyYV43",
          "username": "snapcrafters",
          "validation": "unproven"
        },
        "snap-id": "XPQdduIwHiDCZvPHRrmsqV7Nr6nQRuqM",
        "summary": "Code editing. Redefined.",
        "title": "Visual Studio Code"
      },
      "snap-id": "XPQdduIwHiDCZvPHRrmsqV7Nr6nQRuqM"
    }
  ]
}

As shown above, the error is that there are no revisions, but the snap is there.

TODO: investigate if/how the store can reply an empty list of channels for cases like this and what snapd will/can do with that. (e.g: will it barf or just handle the revision-not-found as a snap-not-found?)

Just checked the DB and the channelmap entry for this snap has releases for edge/candidate/stable with no revision number specified...which looks wrong.
   id | snap_id | risk | architecture | status | created_at | revision | rev...

Read more...

Changed in snapstore-server:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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