Juju fails to upgrade k8s charm to a newer base
Description
Cross-track upgrades are currently broken/impossible. This is a problem because we don't want to keep releasing charms with old LTS versions just to enable cross-track upgrades.
Juju version
3.6.9
Cloud
Kubernetes
Expected behaviour
Juju should allow refreshing the charm container to a newer base.
Reproduce / Test
$ juju deploy grafana-k8s graf9 --channel=1/stable --trust
Deployed "graf9" from charm-hub charm "grafana-k8s", revision 160 in channel 1/stable on [email protected]/stable
$ juju refresh graf9 --channel=2/edge
ERROR selecting releases: charm or bundle not found for channel "2/edge", base "amd64/ubuntu/20.04"
available releases are:
channel "1/edge": available bases are: [email protected]
channel "2/edge": available bases are: [email protected]
channel "1/stable": available bases are: [email protected]
channel "1/candidate": available bases are: [email protected]
channel "1/beta": available bases are: [email protected]
Notes & References
No response
Discovered a hint:
$ juju refresh graf9 --channel=2/edge --revision=164
ERROR cannot upgrade from single base "[email protected]" charm to a charm supporting ["[email protected]"]. Use --force-series to override.
But this still doesn't work:
$ juju refresh graf9 --channel=2/edge --force-series
ERROR selecting releases: charm or bundle not found for channel "2/edge", base "amd64/ubuntu/20.04"
available releases are:
channel "1/candidate": available bases are: [email protected]
channel "1/beta": available bases are: [email protected]
channel "1/stable": available bases are: [email protected]
channel "1/edge": available bases are: [email protected]
channel "2/edge": available bases are: [email protected]
With --revision the command is accepted, but then fails:
$ juju refresh graf9 --channel=2/edge --revision=164 --force-base
Added charm-hub charm "grafana-k8s", revision 164 in channel 2/edge, to the model
ERROR unable to locate charm "grafana-k8s" with matching channel "2/edge"
Finally, dropping the --channel works
$ juju refresh graf9 --revision=164 --force-base
Added charm-hub charm "grafana-k8s", revision 164 in channel 1/stable, to the model
no change to endpoints in space "alpha": catalogue, certificates, charm-tracing, database, grafana, grafana-auth, grafana-dashboard, grafana-metadata, grafana-source, ingress, metrics-endpoint, oauth, profiling-endpoint, receive-ca-cert, replicas, workload-tracing
But upgrade-charm hook failed because of unmet dependency:
unit-graf9-0: 02:17:44 WARNING unit.graf9/0.upgrade-charm Traceback (most recent call last):
unit-graf9-0: 02:17:44 WARNING unit.graf9/0.upgrade-charm File "/var/lib/juju/agents/unit-graf9-0/charm/src/charm.py", line 28, in <module>
unit-graf9-0: 02:17:44 WARNING unit.graf9/0.upgrade-charm from cosl import JujuTopology
unit-graf9-0: 02:17:44 WARNING unit.graf9/0.upgrade-charm ModuleNotFoundError: No module named 'cosl'
unit-graf9-0: 02:17:44 ERROR juju.worker.uniter.operation hook "upgrade-charm" (via hook dispatching script: dispatch) failed: exit status 1
unit-graf9-0: 02:17:49 WARNING unit.graf9/0.upgrade-charm Traceback (most recent call last):
unit-graf9-0: 02:17:49 WARNING unit.graf9/0.upgrade-charm File "/var/lib/juju/agents/unit-graf9-0/charm/src/charm.py", line 28, in <module>
unit-graf9-0: 02:17:49 WARNING unit.graf9/0.upgrade-charm from cosl import JujuTopology
unit-graf9-0: 02:17:49 WARNING unit.graf9/0.upgrade-charm ModuleNotFoundError: No module named 'cosl'
unit-graf9-0: 02:17:50 ERROR juju.worker.uniter.operation hook "upgrade-charm" (via hook dispatching script: dispatch) failed: exit status 1
Thanks @carlcsaposs-canonical, I confirm this works! In that case seems like we only need to streamline the error messages coming out of the juju cli.
This bug has now been triaged. JUJU-8889
@wallyworld it is not possible to triage this issue because it is:
- missing a kind label (e.g. kind/bug)
Once these problems are fixed you can add the triaged label again.