"List of bases on invalid base" response is broken for charms with default track and no `latest` track
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snap Store Server |
Fix Released
|
High
|
Shane M. Pelletier |
Bug Description
When Juju does the initial "discovery" request to see which bases are available for a charm, it uses a bogus base. Charmhub then replies with an "invalid-
curl -XPOST -s https:/
{
"error-list": [],
"results": [
{
"charm": null,
"error": {
"code": "invalid-
"extra": {
{
}
]
},
"message": "Instance key 'a-test' invalid 'base' in 'install' for charm_id=
},
"id": "aQVXlrbsLWBTiA
"
"name": "nginx-
"
"result": "error"
}
]
}
However, for a charm that has the following configuration:
1) A non-latest track
2) Said track is set as the default track
3) `latest` is closed
the response is revision-not-found instead, which confuses Juju and makes it say there is no revision to install.
I think the code that handles the invalid base and sends invalid-charm-base is unaware of default tracks, which should be preferred if they exist. Usual behavior:
1) if `latest` is specified, then use that (this will rightfully fail because there is no latest track).
2) if latest is not given, in the case of this charm which has a default track, return data for the *default* track instead.
3) (for completeness) If latest is not given, and the charm does NOT have a default track, then use "latest" by default (this is typical behavior fwiw).
The confusing thing for this charm is as mentioned that it has a default track *and* latest has been closed.
$ curl -XPOST -s https:/
{
"error-list": [],
"results": [
{
"charm": null,
"error": {
"code": "revision-
"extra": {
{
},
},
{
},
},
{
},
},
{
},
}
]
},
"message": "No revision was found in the Store."
},
"id": "F8CtvgcznoeRSu
"
"name": "mysql",
"
"result": "error"
}
]
}
For more info, this is the actual request Juju makes :
curl -XPOST -s https:/
Changed in snapstore-server: | |
importance: | Undecided → High |
status: | New → Triaged |
status: | Triaged → Confirmed |
Changed in snapstore-server: | |
status: | Confirmed → Fix Committed |
assignee: | nobody → Shane M. Pelletier (shanepelletier) |
Changed in snapstore-server: | |
status: | Fix Committed → Fix Released |
Dear Daniel, please check https:/ /chat.charmhub. io/charmhub/ pl/ct994gu8ybdj xx7cthjiicpmcw
If possible, please rise the priority for this bugreport. Thank you in advance!