error: cannot refresh "kubectl": snap "kubectl" has running apps (kubectl)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Kubernetes Control Plane Charm |
New
|
Undecided
|
Unassigned | ||
Kubernetes Worker Charm |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
When new revisions for the kubectl snap are released we are seeing this error in the k-c-p logs as well as the unit being in error state:
2022-06-19 23:57:18 INFO unit.kubernetes
2022-06-19 23:57:18 WARNING unit.kubernetes
2022-06-19 23:57:18 ERROR unit.kubernetes
Traceback (most recent call last):
File "/var/lib/
bus.dispatch(
File "/var/lib/
_invoke(
File "/var/lib/
handler.invoke()
File "/var/lib/
self._action(*args)
File "/var/lib/
snap.join_
File "lib/charms/
subprocess.
File "/usr/lib/
**kwargs).stdout
File "/usr/lib/
output=stdout, stderr=stderr)
subprocess.
I believe that this is similar to LP#1978005 [1] and LP#1975714 [2]. The fix for this is currently in version 2.57, which is in candidate. Once this is released, AIUI the kubectl snap would need to be changed to set `refresh-mode: ignore-running` in order for refreshes to be processed [3][4].
[1] https:/
[2] https:/
[3] https:/
[4] https:/
Changed in charm-kubernetes-master: | |
milestone: | none → 1.29 |
Changed in charm-kubernetes-worker: | |
milestone: | none → 1.29 |
Changed in charm-kubernetes-master: | |
assignee: | nobody → George Kraft (cynerva) |
Changed in charm-kubernetes-worker: | |
assignee: | nobody → George Kraft (cynerva) |
Changed in charm-kubernetes-master: | |
status: | Triaged → In Progress |
Changed in charm-kubernetes-worker: | |
status: | Triaged → In Progress |
Changed in charm-kubernetes-master: | |
status: | In Progress → Fix Committed |
Changed in charm-kubernetes-worker: | |
status: | In Progress → Fix Committed |
tags: | added: backport-needed |
Changed in charm-kubernetes-master: | |
milestone: | 1.29 → 1.29+ck1 |
Changed in charm-kubernetes-worker: | |
milestone: | 1.29 → 1.29+ck1 |
Changed in charm-kubernetes-master: | |
assignee: | George Kraft (cynerva) → nobody |
Changed in charm-kubernetes-worker: | |
assignee: | George Kraft (cynerva) → nobody |
tags: | removed: backport-needed |
I'm able to repro by running a snap refresh to a different revision while running kubectl in the background.
The documentation around `refresh-mode: ignore-running` suggests that it's for daemons[1], but I'll give it a try and see if it works for non-daemon apps too.
[1]: https:/ /snapcraft. io/docs/ services- and-daemons