Incorrect series used during upgrade to a local charm and no way to specify it manually

Bug #1673122 reported by Dmitrii Shcherbakov
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Eric Claude Jones

Bug Description

Scenario:

1. I want to use a local version of a charm with an applied patch. A non-patched version is already deployed;

2. The charm supports different series including trusty;

3. The deployed version is of a 'trusty' series;

4. juju upgrade-charm --path <p> fails

ubuntu@maas:~⟫ juju status keystone
Model Controller Cloud/Region Version
default foundations-controller cpe 2.1.1

App Version Status Scale Charm Store Rev OS Notes
keystone 9.2.0 active 3 keystone jujucharms 0 ubuntu
keystone-hacluster active 3 hacluster jujucharms 33 ubuntu

Unit Workload Agent Machine Public address Ports Message
keystone/0 active idle 3/lxd/6 172.16.10.41 5000/tcp Unit is ready
  keystone-hacluster/2 active idle 172.16.10.41 Unit is ready and clustered
keystone/1* active idle 1/lxd/7 172.16.10.35 5000/tcp Unit is ready
  keystone-hacluster/0* active idle 172.16.10.35 Unit is ready and clustered
keystone/3 active idle 2/lxd/12 172.16.10.5 5000/tcp Unit is ready
  keystone-hacluster/3 active idle 172.16.10.5 Unit is ready and clustered

Machine State DNS Inst id Series AZ
1 started 172.16.10.253 fkrbrg trusty default
1/lxd/7 started 172.16.10.35 juju-43d9c4-1-lxd-7 trusty
2 started 172.16.10.2 fxxtes trusty default
2/lxd/12 started 172.16.10.5 juju-43d9c4-2-lxd-12 trusty
3 started 172.16.10.3 sph73g trusty default
3/lxd/6 started 172.16.10.41 juju-43d9c4-3-lxd-6 trusty

...

ubuntu@maas:~⟫ juju config keystone | grep -P 'openstack-origin:|trusty-mitaka'
  openstack-origin:
    value: cloud:trusty-mitaka

# upgrade fails

ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/charm-keystone
Added charm "local:xenial/keystone-1" to the model.
ERROR cannot upgrade application "keystone" to charm "local:xenial/keystone-1": cannot change an application's series

# the charm supports multiple series, trusty included
1 ubuntu@maas:~⟫ grep -P 'xenial|trusty|yakkety|zesty' ~/build/charm-keystone/metadata.yaml
  - xenial
  - zesty
  - trusty
  - yakkety

# shouldn't have to but
ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/charm-keystone --force-series
Added charm "local:xenial/keystone-2" to the model.
ERROR cannot upgrade application "keystone" to charm "local:xenial/keystone-2": cannot change an application's series

If I remove older versions from metadata.yaml it deploys just fine.

ubuntu@maas:~⟫ sed -i -e '/- xenial/d' ~/build/charm-keystone/metadata.yaml
ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/charm-keystone
Added charm "local:zesty/keystone-0" to the model.
ERROR cannot upgrade application "keystone" to charm "local:zesty/keystone-0": cannot change an application's series

# note that I haven't deleted yakkety and it is below zesty and xenial. It worked due to the order of processing

ubuntu@maas:~⟫ cat ~/build/charm-keystone/metadata.yaml | grep series -A3
series:
  - trusty
  - yakkety
extra-bindings:

ubuntu@maas:~⟫ juju upgrade-charm keystone --path ~/build/charm-keystone
Added charm "local:trusty/keystone-0" to the model.

tags: added: charm charmers upgrade-charm
Changed in juju:
status: New → Triaged
tags: added: cpe
Changed in juju:
importance: Undecided → High
Revision history for this message
John A Meinel (jameinel) wrote :

So the issue is that when doing "juju upgrade-charm --path" we are inferring what series we should use as the "default" series from the charm, which is always the first item listed in the series.

So if you move "trusty" to be the first series in the series list, then it should work (you shouldn't have to remove xenial, just switch trusty to be the first item).

We should have 'upgrade-charm' know what series the existing application is, and check if its one of the supported series from the charm, and if so, use it. Rather than only supporting the default series.

Tim Penhey (thumper)
tags: added: talisman
removed: charm charmers cpe upgrade-charm
tags: added: cpe upgrade-charm
Chris Gregan (cgregan)
tags: added: cdo-qa-blocker
Changed in juju:
milestone: none → 2.2-beta2
Tim Penhey (thumper)
Changed in juju:
assignee: nobody → Eric Claude Jones (ecjones)
Changed in juju:
status: Triaged → In Progress
Changed in juju:
milestone: 2.2-beta2 → 2.2-beta3
Revision history for this message
John A Meinel (jameinel) wrote :

see a similar (but not exactly the same) bug #1663510 about 'juju deploy' not using model-config default-series over the default series in the charm itself.

Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → 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.