juju deploy doesn't pick one default series, focal sometimes then jammy other times

Bug #1998896 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Won't Fix
Undecided
Unassigned
Snap Store Server
New
Undecided
Unassigned

Bug Description

At this moment, it's probably impossible to know which series to be used for a charm deployment in advance. Previously this behavior never happened because there was a value for "default-series" in model-config out of the box.

$ juju version
2.9.37-ubuntu-amd64

$ juju model-config | grep series
default-series default ""

^^^ the default-series is empty by default probably after this change:
https://github.com/juju/juju/pull/14659

$ juju deploy ubuntu

Located charm "ubuntu" in charm-hub, revision 21
Deploying "ubuntu" from charm-hub charm "ubuntu", revision 21 in channel stable on focal

^^^ focal was deployed (the charm supports both focal and jammy)

$ juju deploy --channel edge magpie

Located charm "magpie" in charm-hub, revision 8
Deploying "magpie" from charm-hub charm "magpie", revision 8 in channel edge on jammy

^^^ jammy was deployed (the charm supports both focal and jammy)

This is a surprising behavior since focal is used for some charm deployments while jammy is used for other charms. Comparing two outputs below, it's not obvious which series would be picked.

$ juju info ubuntu | grep supports:
supports: xenial, bionic, focal, jammy

$ juju info --channel edge magpie | grep supports:
supports: bionic, focal, impish, jammy, kinetic

[After setting an explicit default series]

$ juju model-config default-series=focal

$ juju deploy ubuntu ubuntu-with-explicit-default-series
Located charm "ubuntu" in charm-hub, revision 21
Deploying "ubuntu-with-explicit-default-series" from charm-hub charm "ubuntu", revision 21 in channel stable on focal

^^^ focal was deployed

$ juju deploy --channel edge magpie magpie-with-explicit-default-series
Located charm "magpie" in charm-hub, revision 8
Deploying "magpie-with-explicit-default-series" from charm-hub charm "magpie", revision 8 in channel edge on focal

^^^ focal was deployed

Revision history for this message
Nobuto Murata (nobuto) wrote :

$ juju deploy ubuntu --dry-run --show-log --logging-config='<root>=TRACE'
...
16:54:09 TRACE juju.rpc.jsoncodec codec.go:227 -> {"request-id":5,"type":"Charms","version":5,"request":"ResolveCharms","params":{"resolve":[{"reference":"ch:ubuntu","charm-origin":{"source":"charm-hub","type":"","id":"","architecture":"amd64","base":{"name":"","channel":""}}}]}}
16:54:10 TRACE juju.rpc.jsoncodec codec.go:121 <- {"request-id":5,"response":{"Results":[{"url":"ch:amd64/focal/ubuntu-21","charm-origin":{"source":"charm-hub","type":"charm","id":"","risk":"stable","revision":21,"architecture":"amd64","base":{"name":"","channel":""},"series":"focal","os":"ubuntu","channel":"20.04"},"supported-series":["focal","bionic","xenial","jammy"]}]}}
16:54:10 TRACE juju.cmd.juju.application.deployer charm.go:494 Using series "focal" from [focal bionic xenial jammy] to deploy ch:ubuntu
"ubuntu" from charm-hub charm "ubuntu", revision 21 in channel stable on focal would be deployed

$ juju deploy --channel edge magpie --dry-run --show-log --logging-config='<root>=TRACE'
...
16:52:56 TRACE juju.rpc.jsoncodec codec.go:227 -> {"request-id":5,"type":"Charms","version":5,"request":"ResolveCharms","params":{"resolve":[{"reference":"ch:magpie","charm-origin":{"source":"charm-hub","type":"","id":"","risk":"edge","architecture":"amd64","base":{"name":"","channel":""}}}]}}
16:52:57 TRACE juju.rpc.jsoncodec codec.go:121 <- {"request-id":5,"response":{"Results":[{"url":"ch:amd64/jammy/magpie-8","charm-origin":{"source":"charm-hub","type":"charm","id":"","risk":"edge","revision":8,"architecture":"amd64","base":{"name":"","channel":""},"series":"jammy","os":"ubuntu","channel":"22.04"},"supported-series":["jammy","focal","bionic","impish"]}]}}
16:52:57 TRACE juju.cmd.juju.application.deployer charm.go:494 Using series "jammy" from [jammy focal bionic impish] to deploy ch:magpie
"magpie" from charm-hub charm "magpie", revision 8 in channel edge on jammy would be deployed

Changed in juju:
status: New → Won't Fix
Revision history for this message
Joseph Phillips (manadart) wrote :

When deploying without any arguments indicating which base to use, we make a parameter-less query to Charmhub. Charmhub responds with an error that includes valid revisions/bases for the charm, and we choose the first of those in the subsequent request (as you see in the logged output).

The patch you referenced removed the default-series configuration based on a change in behaviour for that article.

The solution is to explicitly set it as desired for your model.

Revision history for this message
Nobuto Murata (nobuto) wrote (last edit ):

I get your perspective. But in a bigger picture, this is a regression in the middle of juju 2.9 stable releases.

The following procedure always worked. But it fails now that the default-series is empty.

$ juju add-machine
created machine 0

$ juju status
Model Controller Cloud/Region Version SLA Timestamp
test localhost localhost/localhost 2.9.37 unsupported 13:27:18Z

Machine State Address Inst id Series AZ Message
0 pending pending focal acquiring LXD image

$ juju deploy --channel edge magpie --to 0
Located charm "magpie" in charm-hub, revision 8
Deploying "magpie" from charm-hub charm "magpie", revision 8 in channel edge on jammy
ERROR cannot add application "magpie": cannot deploy to machine 0: series does not match

I'm not familiar with how the default series is determined in the store server side, but there is no hint to users on which one is the default in juju info output or anywhere as far as I see.

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.