charmhub: deploying mysql from edge channel causes Juju to deploy a very old xenial stable revision
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
High
|
Unassigned | ||
Snap Store Server |
Fix Released
|
High
|
Guillermo Gonzalez |
Bug Description
The charm mysql has been adopted by a new team (taking over an old imported charm).
They have decided to take it out of 'stable' and only have an 'edge' channel for the new code that they are releasing.
The info for `juju info mysql` looks sane (it only lists the edge channel as available, which only supports focal), which matches https:/
```
name: mysql
charm-id: F8CtvgcznoeRSup
summary: MySQL is a fast, stable and true multi-user, multi-threaded SQL database
publisher: Data Platform
tags: cloud, databases
subordinate: false
store-url: https:/
description: |
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.
relations:
provides:
db-router: mysql-router
shared-db: mysql-shared
requires: {}
channels: |
latest/stable: –
latest/candidate: –
latest/beta: –
latest/edge: 67 2022-07-08 (67) 2MB
```
If you do:
`juju deploy mysql`
You do get told that you cannot install it but there are other channels available:
```
$ juju deploy mysql
ERROR selecting releases: charm or bundle not found for channel "", platform "amd64"
available releases are:
channel "candidate": available series are: bionic, xenial, trusty, precise, artful, zesty
channel "beta": available series are: bionic, xenial, trusty, precise, artful, zesty
channel "edge": available series are: focal, bionic, xenial, trusty, precise, artful, zest
```
However, the 'refresh' api is now telling us about lots of channels and os versions, which 'info' doesn't seem to want to exist.
If you then do try to deploy with --channel=edge:
$ juju deploy mysql --channel edge Located charm "mysql" in charm-hub, revision 58
Deploying "mysql" from charm-hub charm "mysql", revision 58 in channel stable on xenial
Suddenly we are redirected to xenial stable instead of edge.
I have dumps of the charmhub interaction (sorry for the canonical private links, I'm not sure if there are secrets here that we don't want to make public)
`juju deploy mysql` https:/
`juju deploy mysql --channel=edge` https:/
From what I can tell, Juju is asking charmhub about 'edge' and it returns 'no valid bases, here are some valid bases, 16.04, 18.04, 14.04.
Note that we asked about edge, but only got pointed to old stable release, ignoring the request for edge. So Focal isn't even listed. Also, Xenial is the default (even if Bionic would be available)
machine-0: 09:00:00 TRACE juju.apiserver.
Host: api.charmhub.io
Accept: application/json
Content-Type: application/json
User-Agent: Juju/2.9.33
{"context"
machine-0: 09:00:00 TRACE juju.apiserver.
Content-Length: 582
Content-Type: application/json
Date: Wed, 13 Jul 2022 13:00:00 GMT
Server: gunicorn/20.0.4
Snap-Store-Version: 49
X-Request-Id: AE4645A7FC560A8
X-Vcs-Revision: 9abffbb1
X-View-Name: snapdevicegw.
{"error-
We then do a follow up to ask for the edge of xenial channel (the edge channel might be closed):
machine-0: 09:00:00 TRACE juju.apiserver.
Host: api.charmhub.io
Accept: application/json
Content-Type: application/json
User-Agent: Juju/2.9.33
{"context"
machine-0: 09:00:00 TRACE juju.apiserver.
Content-Length: 582
Content-Type: application/json
Date: Wed, 13 Jul 2022 13:00:00 GMT
Server: gunicorn/20.0.4
Snap-Store-Version: 49
X-Request-Id: AE4645A7FC560A8
X-Vcs-Revision: 9abffbb1
X-View-Name: snapdevicegw.
{"error-
This response causes us to resolve to xenial stable:
machine-0: 09:00:01 TRACE juju.apiserver.
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → High |
Changed in snapstore-server: | |
status: | Confirmed → In Progress |
assignee: | nobody → Guillermo Gonzalez (verterok) |
Changed in snapstore-server: | |
status: | In Progress → Fix Committed |
Changed in snapstore-server: | |
status: | Fix Committed → Fix Released |
first Juju does this
curl -XPOST -s https:/ /api.charmhub. io/v2/charms/ refresh -H 'Content-type: application/json' -d '{ "context": [], "actions": [{"name": "mysql", "base": {"name": "NA", "channel": "NA", "architecture": "amd64"} , "channel": "edge" , "action": "install", "instance-key": "a-test"}]}' | jq .
it gets the list of bases and picks the first one, then does this with that:
curl -XPOST -s https:/ /api.charmhub. io/v2/charms/ refresh -H 'Content-type: application/json' -d '{ "context": [], "actions": [{"name": "mysql", "base": {"name": "ubuntu", "channel": "16.04", "architecture": "amd64"} , "channel": "edge" , "action": "install", "instance-key": "a-test"}]}' | jq .