The error 'inappropriate relation-changed for <unit>: unit has not joined' during upgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
Just the unit gnocchi/2 has a failed state during upgrading juju controllers and models to 2.8.1, other units are all in active state.
$ juju status | grep -E "error|
gnocchi 4.2.5 error 2/3 gnocchi jujucharms 30 ubuntu
gnocchi/2 active failed 11/lxd/4 10.139.108.126 8041/tcp
However, we indeed see the flag run-default-
The customer said they just ran 'juju upgrade-juju' to upgrade juju controllers and models, they didn't run 'upgrade-charm'. I'm not sure if juju upgrade-juju' will trigger upgrade-charm hook, so I did a test, which shows 'juju upgrade-juju' will not trigger upgrade-charm hook. Who triggered upgrade-charm is a mystery to me now.
We put aside who triggered upgrade-charm and went on to find two possible clues from the log:
1, the error 'TypeError: expected str, bytes or os.PathLike object, not NoneType'
2, lots of error 'inappropriate relation-changed for <unit>: unit has not joined'
2020-07-27 06:01:36 ERROR juju.worker.uniter agent.go:31 resolver loop error: preparing operation "run relation-changed (78; unit: mysql/2) hook": inappropriate "relation-changed" for "mysql/2": unit has not joined
2020-07-27 06:01:36 ERROR juju.worker.
Above error 1) is gone now after applying for one patch [2] by hand and run the following two commands, but gnocchi/2 is still in a failed state.
juju run --unit gnocchi/2 -- 'charms.reactive -p clear_flag run-default-
juju run --unit gnocchi/2 -- 'hooks/
For above error 2), wallyworld told me juju 2.8.2 can fix the problem, it could be related to the change in how unit state is stored, 2.8.2 includes code changes necessary to address the hook execution bug.
My question is that even if 2.8.2 can fix the problem, but it was caused during upgrading controllers and models to 2.8.1, how can we continue to upgrade controllers and models from 2.8.1 to 2.8.2 when gnocchi/2 is still in a failed state, is there a manual step that needs to be done to fix already upgraded systems?
We also checked the log of mysql/2
2020-07-22 12:23:36 INFO juju-log Unit is ready
2020-07-22 12:23:53 ERROR juju.worker.
2020-07-22 12:23:53 ERROR juju.worker.
2020-07-22 12:23:53 ERROR juju.worker.uniter agent.go:31 resolver loop error: could not acquire lock: cancelled acquiring mutex
2020-07-22 12:23:53 ERROR juju.worker.
2020-07-22 12:23:53 ERROR juju.worker.
2020-07-22 12:23:53 ERROR juju.worker.
2020-07-22 12:23:53 ERROR juju.worker.uniter agent.go:34 updating agent status: connection is shut down
2020-07-22 12:23:57 ERROR juju.worker.
2020-07-22 12:24:01 ERROR juju.worker.
and checked the relation between gnocchi/2 and mysql/2
$ juju run -u gnocchi/2 -- relation-ids shared-db
shared-db:78
$ juju run -u gnocchi/2 -- relation-list -r shared-db:78
Nothing replied.
That's all the context history and logs I have of the case, if you need anthing else, pls let me know. thanks.
[1] https:/
[2] https:/
[3] https:/
This may be a duplicate of https:/ /bugs.launchpad .net/juju/ +bug/1890828. I need more data to confirm please.
Can you confirm if the unit upgraded before or after the relation failures? It will be in the unit's log. I look for "running jujud".
The best recovery might be to remove the gnocchi/2 unit and add a new unit to replace it.
The errors from mysql/2 look to be a duplicate of: https:/ /bugs.launchpad .net/juju/ +bug/1891234