Snap store suggests invalid channels for unpublished snap
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.
summary: |
- Snap store suggest differenet channels for unpublished snap + Snap store suggests invalid channels for unpublished snap |
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 not-found" ,
"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" instance- key": "a-test", released- at": null,
"publisher" : {
"display- name": "Snapcrafters", Bu9SRhr2678vzyY V43",
"username" : "snapcrafters",
"validation" : "unproven" PHRrmsqV7Nr6nQR uqM", instance- key": "a-test", released- at": null,
"publisher" : {
"display- name": "Snapcrafters", Bu9SRhr2678vzyY V43",
"username" : "snapcrafters",
"validation" : "unproven" PHRrmsqV7Nr6nQR uqM", PHRrmsqV7Nr6nQR uqM"
{
"error-list": [],
"results": [
{
"error": {
"code": "revision-
"extra": {
{
},
{
},
{
},
{
},
{
},
{
}
]
},
"message": "No revision was found in the Store."
},
"
"name": "vscode",
"
"result": "error",
"snap": {
"license": "Proprietary",
"name": "vscode",
"prices": {},
"id": "eEoV9TnaNkCzfJ
},
"snap-id": "XPQdduIwHiDCZv
},
"
"name": "vscode",
"
"result": "error",
"snap": {
"license": "Proprietary",
"name": "vscode",
"prices": {},
"id": "eEoV9TnaNkCzfJ
},
"snap-id": "XPQdduIwHiDCZv
"summary": "Code editing. Redefined.",
"title": "Visual Studio Code"
},
"snap-id": "XPQdduIwHiDCZv
}
]
}
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...