juju refresh --switch ./local fails for metadata v1 charm

Bug #1925670 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Simon Richardson

Bug Description

I'm testing some things out, and I published a charm to charmhub. I then went to try to switch to the local version of the charm. It is currently using metadata v1, only I edit the .charm file to remove manifest.yaml because of our series vs metadata.yaml bug.

$ juju upgrade-charm jam-k8s-api-test --switch ./jam-k8s-api-test.charm
Looking up metadata for charm-hub charm "jam-k8s-api-test" from channel stable
ERROR series "focal" not supported by charm, supported series are: kubernetes

Revision history for this message
Joseph Phillips (manadart) wrote :

if this was prior to landing the change to assume series means V1 metadata (https://github.com/juju/juju/pull/12915) then we probably reasoned about the charm as V2 when it was in the store, then V1 when manifest.yaml was deleted locally.

It raises the question though, whether changing metadata format version *downward* should be supported.

summary: - juju upgrade-charm --switch ./local fails for metadata v1 charm
+ juju refresh --switch ./local fails for metadata v1 charm
Revision history for this message
Simon Richardson (simonrichardson) wrote :

So I've just tested this locally and can't reproduce anymore:

    $ juju bootstrap lxd test
    $ juju deploy juju-qa-test-v2

Wait for unit to become active...

    $ cd ./testcharms/charm-hub/charms/juju-qa-test-v2
    $ charmcraft build
    $ zip -d juju-qa-test-v2.charm "manifest.yaml"
    $ cd -
    $ juju refresh juju-qa-test-v2 --path ./testcharms/charm-hub/charms/juju-qa-test-v2/juju-qa-test-v2.charm

Worked for me...

Changed in juju:
status: Triaged → Fix Released
status: Fix Released → Incomplete
Revision history for this message
Simon Richardson (simonrichardson) wrote :

Marking as incomplete until John is happy with this QA steps.

Changed in juju:
milestone: 2.9.1 → 2.9.2
Changed in juju:
milestone: 2.9.2 → 2.9.3
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1925670] Re: juju refresh --switch ./local fails for metadata v1 charm

In 2.9.3 I cannot reproduce this because it fails with many different ways:
```
$ /snap/bin/juju upgrade-charm --switch ./postgresql-k8s_36c7ec5.charm
postgresql-k8s
ERROR cannot parse name and/or revision in URL
"ch:./postgresql-k8s_36c7ec5.charm": name "postgresql-k8s_36c7ec5.charm"
not valid
$ /snap/bin/juju upgrade-charm --switch ./postgresql-k8s postgresql-k8s
ERROR cannot parse architecture in URL "ch:./postgresql-k8s": architecture
name "." not valid
$ /snap/bin/juju upgrade-charm --path ./postgresql-k8s postgresql-k8s
ERROR series "focal" not supported by charm, supported series are:
kubernetes
$ /snap/bin/juju upgrade-charm --path ./postgresql-k8s_36c7ec5.charm
postgresql-k8s
```
In all the cases switching to local doesn't work. With "--switch" it force
prepends ch: which seems odd, but with --path it does at least find the
charm but then it refuses based on the series of the charm.

On Mon, May 24, 2021 at 9:45 PM Canonical Juju QA Bot <
<email address hidden>> wrote:

> ** Changed in: juju
> Milestone: 2.9.2 => 2.9.3
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1925670
>
> Title:
> juju refresh --switch ./local fails for metadata v1 charm
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1925670/+subscriptions
>

Changed in juju:
milestone: 2.9.3 → 2.9.4
John A Meinel (jameinel)
Changed in juju:
status: Incomplete → Triaged
Changed in juju:
milestone: 2.9.4 → 2.9.5
John A Meinel (jameinel)
summary: - juju refresh --switch ./local fails for metadata v1 charm
+ juju refresh --switch ./local fails for metadata v2 charm
summary: - juju refresh --switch ./local fails for metadata v2 charm
+ juju refresh --switch ./local fails for metadata v1 charm
Changed in juju:
milestone: 2.9.5 → 2.9.6
Changed in juju:
milestone: 2.9.6 → 2.9.7
Changed in juju:
assignee: nobody → Simon Richardson (simonrichardson)
Revision history for this message
Pen Gale (pengale) wrote :

Marking as fix committed, as everything should be done. @jam: please mark as in progress if you'd like to ask Simon to make more changes.

Changed in juju:
status: Triaged → 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.