juju upgrade-charm requires --switch for local charms

Bug #1571861 reported by Casey Marshall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

Latest master (5f385be). Steps to reproduce:

1. Deploy a local charm (you can get gogs with `charm pull cs:~cmars/gogs` if you like):

$ juju deploy ~/trusty/gogs

2. Try to upgrade it

$ juju upgrade-charm gogs --force-units
ERROR unknown schema for charm URL "local:trusty/gogs"

You can workaround by using --switch, but this probably isn't the intended UX:

$ juju upgrade-charm gogs --force-units --switch ~/trusty/gogs
Added charm "local:trusty/gogs-1" to the model.

Tags: tech-debt
Revision history for this message
Casey Marshall (cmars) wrote :

I don't know if you need to change the local charm contents or not to get upgrade-charm to realize that it has work to do... If you do, a `make clean all` in gogs will do the trick.

description: updated
Revision history for this message
Ian Booth (wallyworld) wrote :

Ah, this looks like fallout from removing local repo support.

Changed in juju-core:
milestone: none → 2.0-rc1
importance: Undecided → High
status: New → Triaged
assignee: nobody → Ian Booth (wallyworld)
Revision history for this message
Ian Booth (wallyworld) wrote :

When you upgrade a local charm, you must (re)supply the path to the charm.

$ juju upgrade-charm gogs --force-units

^^^^^ requires a path. So the cmd should flag that and abort the upgrade.

Revision history for this message
Casey Marshall (cmars) wrote :

Ah, that makes sense, it's certainly a side-effect of getting rid of local repos. As long as we make it clear to the user what to do in the error message, I think it's fine. As a new charmer I probably would have been stuck if I hadn't known about --switch and how it works.

Ian Booth (wallyworld)
Changed in juju-core:
status: Triaged → Fix Committed
Curtis Hovey (sinzui)
tags: added: tech-debt
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta5 → none
milestone: none → 2.0-beta5
Revision history for this message
feng xia (fengxia41103) wrote :

I'm not seeing document on `--switch`. Could someone pls point me to its introduction?

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.