revision-not-found error on install action returning all bases rather than bases of charm at top of channel stack

Bug #1999402 reported by Heather Lanigan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
New
Undecided
Unassigned

Bug Description

$ curl -s https://api.snapcraft.io/v2/charms/refresh -H 'Content-type: application/json' -d '{"context":[],"actions":[{"action":"install","instance-key":"28243d18-076a-4711-8b26-09c4f83e7eea","name":"nginx-ingress-integrator","channel":"edge","base":{"architecture":"amd64","name":"NA","channel":"NA"}}],"fields":["bases","config-yaml","download","id","license","metadata-yaml","name","publisher","resources","revision","summary","type","version"]}' | jq .
{
  "error-list": [],
  "results": [
    {
      "charm": null,
      "error": {
        "code": "invalid-charm-base",
        "extra": {
          "default-bases": [
            {
              "architecture": "amd64",
              "channel": "22.04",
              "name": "ubuntu"
            },
            {
              "architecture": "amd64",
              "channel": "20.04",
              "name": "ubuntu"
            }
          ]
        },
        "message": "Instance key '28243d18-076a-4711-8b26-09c4f83e7eea' invalid 'base' in 'install' for charm_id=aQVXlrbsLWBTiAiQF0lilvUFolDOpKaE name=nginx-ingress-integrator"
      },
      "id": "aQVXlrbsLWBTiAiQF0lilvUFolDOpKaE",
      "instance-key": "28243d18-076a-4711-8b26-09c4f83e7eea",
      "name": "nginx-ingress-integrator",
      "released-at": null,
      "result": "error"
    }
  ]
}

However ubuntu/22.04 is supported by charm revision 44, not revision 52 which is at the top of the edge channel's stack. This is a recession of a change made to only report bases for the charm at the top of the channel's stack when a base with name and channel of NA is provided.

It's causing issues for some users:
https://chat.charmhub.io/charmhub/pl/7uy97zjnhfdxieii13mwo95zzr

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.