Juju incorrectly sets the charm origin during charm switches
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
High
|
Jack Shaw |
Bug Description
Replicated in juju 3.3 and 2.9
```
$ juju deploy ubuntu
Located charm "ubuntu" in charm-hub, revision 24
Deploying "ubuntu" from charm-hub charm "ubuntu", revision 24 in channel stable on focal
$ juju refresh ubuntu --switch ./ubuntu
Added local charm "ubuntu", revision 12, to the model
$ juju mongo
juju:PRIMARY> db.applications
...
{
"_id" : "e87c04ee-
"name" : "ubuntu",
"model-uuid" : "e87c04ee-
"series" : "focal",
"subordinate" : false,
"charmurl" : "local:
"cs-channel" : "stable",
"charm-origin" : {
"source" : "local",
"id" : "DksXQKAQTZfsUm
"hash" : "9b2877f7ebf04b
"revision" : 24,
"channel" : {
"risk" : "stable"
},
"platform" : {
"architecture" : "amd64",
"os" : "ubuntu",
"series" : "focal"
}
},
"charmmodified
"forcecharm" : false,
"life" : 0,
"unitcount" : 1,
"relationcount" : 0,
"minunits" : 0,
"txn-revno" : NumberLong(5),
"metric-
"exposed" : false,
"scale" : 0,
"passwordhash" : "",
"provisioning-
"txn-queue" : [
"65291ff89dc5
]
}
```
NOTE: the charm origin has been fixed to state the source is local, but the id, hash and channel are present (which is not valid for a local charm) and the revision is 24, despite the revision being changed to 12
The following I have only been able to replicate in 3.3. This does not happen in 2.9
The problems continue when we switch back to a charmhub charm
```
$ juju refresh ubuntu --switch postgresql
$ juju mongo
juju:PRIMARY> db.applications
...
{
"_id" : "1005126d-
"name" : "ubuntu",
"model-uuid" : "1005126d-
"subordinate" : false,
"charmurl" : "ch:amd64/
"charm-origin" : {
"source" : "charm-hub",
"type" : "charm",
"id" : "DksXQKAQTZfsUm
"hash" : "9b2877f7ebf04b
"revision" : 288,
"channel" : {
"track" : "14",
"risk" : "stable"
},
"platform" : {
"architecture" : "amd64",
"os" : "ubuntu",
"channel" : "22.04"
}
},
"charmmodified
"forcecharm" : false,
"life" : 0,
"unitcount" : 1,
"relationcount" : 2,
"minunits" : 0,
"txn-revno" : NumberLong(5),
"metric-
"exposed" : false,
"scale" : 0,
"passwordhash" : "",
"provisioning-
}
```
Notice how the channel, source, platform and revision have all correctly switched. But the id and hash have not changed
Changed in juju: | |
assignee: | nobody → Jack Shaw (jack-shaw) |
Changed in juju: | |
status: | New → Triaged |
importance: | Undecided → High |
This has been mostly resolved, but not entirely
See: /github. com/juju/ juju/pull/ 16796#issuecomm ent-1910010705
https:/