model upgrade tries to upgrade the lxd profile and fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Client 2.6.4-trusty-amd64 (snap). Controller is one (trusty) machine.
Tried to upgrade a model from 2.5.7 to 2.6.4, and all the lxd units are now reporting their machine status as 'error' with the message "cannot upgrade machine's lxd profile: 0/lxd/0: not found".
The machine-0.log on the host shows:
2019-06-26 04:29:49 INFO juju.cmd supercommand.go:57 running jujud [2.6.4 gc go1.11.11]
2019-06-26 04:29:49 DEBUG juju.cmd supercommand.go:58 args: []string{
2019-06-26 04:29:49 DEBUG juju.utils gomaxprocs.go:24 setting GOMAXPROCS to 40
2019-06-26 04:29:49 DEBUG juju.agent agent.go:545 read agent config, format "2.0"
2019-06-26 04:29:49 INFO juju.cmd.jujud agent.go:133 setting logging config to "<root>=WARNING; unit=INFO"
2019-06-26 04:29:57 WARNING juju.worker.
2019-06-26 04:30:06 ERROR juju.worker.
2019-06-26 04:30:06 ERROR juju.worker.
2019-06-26 04:30:07 ERROR juju.worker.
2019-06-26 04:30:08 ERROR juju.worker.
2019-06-26 04:30:09 ERROR juju.worker.
2019-06-26 04:30:09 ERROR juju.worker.
2019-06-26 04:30:10 ERROR juju.worker.
2019-06-26 04:30:10 ERROR juju.worker.
2019-06-26 04:30:10 ERROR juju.worker.
2019-06-26 04:30:10 ERROR juju.worker.
2019-06-26 04:30:11 ERROR juju.worker.
2019-06-26 04:30:11 ERROR juju.worker.
2019-06-26 04:30:12 ERROR juju.worker.
2019-06-26 04:30:12 ERROR juju.worker.
2019-06-26 04:30:21 ERROR juju.worker.
2019-06-26 04:30:25 ERROR juju.worker.
2019-06-26 04:30:26 ERROR juju.worker.
2019-06-26 04:30:27 ERROR juju.worker.
2019-06-26 04:30:27 ERROR juju.worker.
... etc.
Note: this is due to a failure in the upgrade of the model previously from Juju 1 to Juju 2.
The machine IDs are listed as juju-machine-x and not juju-abc123-x (the model suffix). That breaks the lxd integration.
The fix is in the db:
db.instanceData .find( {'instanceid': { $regex: /juju-machine.*/ }}).forEach( uuid"]. substr( 30,6); "].substr( 12);
print( "updating "+ doc._id + " instanceid to " + newID);
db.instanceDat a.update( {_id: doc._id}, {$set: {"instanceid": newID}})
function(doc) {
var modelSuffix = doc["model-
var newID = "juju-" + modelSuffix + doc["instanceid
})