default bases don't include jammy

Bug #1995483 reported by Jordan Barrett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
Fix Released
High
Guillermo Gonzalez

Bug Description

We are noticing in Juju 3.0 that when deploying certain charms, they default to focal instead of jammy. This is strange because deployed machines default to jammy on Juju 3.0.

We've looked into it and think there's a bug in the Charmhub API. We're making a request to the API with
```
"base":{"architecture":"amd64","name":"NA","channel":"NA"}
```
to try and get the supported bases for the charm. For some reason, it's not returning jammy in the list of default bases, even though the charm supports jammy (and Charmhub info API says that it supports jammy too).
```
"default-bases":[{"architecture":"amd64","channel":"18.04","name":"ubuntu"},{"architecture":"amd64","channel":"20.04","name":"ubuntu"}]
```
We've noticed this with both the `juju-dashboard` charm and the `tiny-bash` charm. The logs below should give some more context with our request and the response from Charmhub.
```
machine-0: 16:12:30 TRACE juju.apiserver.charms.charmhubrepo.client charmhub POST request POST /v2/charms/refresh HTTP/1.1
Host: api.charmhub.io
Accept: application/json
Content-Type: application/json
User-Agent: Juju/3.0.1

{"context":[],"actions":[{"action":"install","instance-key":"10bba603-4da0-4fb6-80c1-c2f1388ef79f","name":"tiny-bash","channel":"stable","base":{"architecture":"amd64","name":"NA","channel":"NA"}}],"fields":["bases","config-yaml","download","id","license","metadata-yaml","name","publisher","resources","revision","summary","type","version"]}

machine-0: 16:12:30 TRACE juju.apiserver.charms.charmhubrepo.client charmhub POST response HTTP/1.1 200 OK
Content-Length: 531
Content-Type: application/json
Date: Tue, 01 Nov 2022 15:12:30 GMT
Server: gunicorn/20.0.4
Snap-Store-Version: 50
X-Request-Id: 3EA8230BD3E40A83255C01BB6361375E49A5CB45
X-Vcs-Revision: 9a1852f6
X-View-Name: snapdevicegw.webapi_refresh_charm.charm_refresh

{"error-list":[],"results":[{"charm":null,"error":{"code":"invalid-charm-base","extra":{"default-bases":[{"architecture":"amd64","channel":"18.04","name":"ubuntu"},{"architecture":"amd64","channel":"20.04","name":"ubuntu"}]},"message":"Instance key '10bba603-4da0-4fb6-80c1-c2f1388ef79f' invalid 'base' in 'install' for charm_id=URvt1LraV3i6PhhfLNsFF3GDHzzPPuaq name=tiny-bash"},"id":"URvt1LraV3i6PhhfLNsFF3GDHzzPPuaq","instance-key":"10bba603-4da0-4fb6-80c1-c2f1388ef79f","name":"tiny-bash","released-at":null,"result":"error"}]}
```

Revision history for this message
Daniel Manrique (roadmr) wrote :

I’m fairly sure it’s going to be the hardcoded list of LTSes in (devicegw? snaprevs?) which considers Focal the most recent LTS we give out. We need to clear the decision with the Juju team but the fix is likely going to be adding Jammy to that list and making Jammy the preferred/default Ubuntu release / base.

Changed in snapstore-server:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Jonathan Hartley (tartley) wrote :

Agreed with Daniel's assessment.

Revision history for this message
Jordan Barrett (barrettj12) wrote :

That sounds like the right fix. I think we still want to default to focal on 2.9, but we can do that on the Juju end.

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi Jordan,

do we need to wait for a 2.9.x release before doing our side of the changes?

Thanks

Revision history for this message
John A Meinel (jameinel) wrote :

My position is that a Juju *controller* should default to Focal for 2.9, but as 2.9 does support Jammy as a target, it is fine for a charm that says it wants to be deployed on Jammy to do so, even with 2.9.

Revision history for this message
Heather Lanigan (hmlanigan) wrote :

I don't believe that juju should rely on the order of bases in the manifest. Either juju chooses based on criteria defined, (there is a juju bug I need to file) or the charm author can define a preferred base. However it should be explicit, not based on a order than most authors never really knew about.

Changed in snapstore-server:
status: Confirmed → In Progress
assignee: nobody → Guillermo Gonzalez (verterok)
Changed in snapstore-server:
status: In Progress → Fix Released
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.