migration: subordinate with multiple principals imports incorrectly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
Critical
|
Christian Muirhead |
Bug Description
Deploy two principal applications and relate them both to one subordinate:
ubuntu/0
telegraf/0
mysql/0
telegraf/1
Migrate that model to another controller.
Then run the following commands (waiting for the status to settle after each):
1. juju remove-relation ubuntu telegraf
2. juju relate ubuntu telegraf
3. juju remove-relation mysql telegraf
After step 3 the agent status for telegraf/1 will become `failed` and these messages will be in the model debug log:
unit-telegraf-1: 09:43:40 INFO unit.telegraf/
unit-telegraf-1: 09:43:40 INFO unit.telegraf/
unit-telegraf-1: 09:43:40 INFO unit.telegraf/
unit-telegraf-1: 09:43:40 ERROR juju.worker.uniter agent.go:28 resolver loop error: committing operation "run relation-broken (8) hook": permission denied
unit-telegraf-1: 09:43:40 ERROR juju.worker.
unit-telegraf-1: 09:43:44 ERROR juju.worker.uniter agent.go:28 resolver loop error: committing operation "skip run relation-broken (8) hook": unknown relation: 8
unit-telegraf-1: 09:43:44 ERROR juju.worker.
unit-telegraf-1: 09:43:47 ERROR juju.worker.uniter agent.go:28 resolver loop error: committing operation "skip run relation-broken (8) hook": unknown relation: 8
(and more of the same from then on.)
Changed in juju: | |
status: | In Progress → Fix Committed |
milestone: | none → 2.2.4 |
Changed in juju: | |
status: | Fix Committed → Fix Released |
I'm not totally sure that step 2 is required.
The problem is caused by invalid relationscopes being created when the model is imported - so for the example above, after the import telegraf/1 is recorded as being in scope for the ubuntu-telegraf relation, and similarly telegraf/0 is in scope for mysql-telegraf. Those relationscopes aren't in the source DB or in the model, but they're created by the code at https:/ /github. com/juju/ juju/blob/ 2.2/state/ migration_ import. go#L1090 which doesn't check whether the relation unit is valid.