calico workload status in error due to hook failed: "update-status"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Calico Charm |
Fix Released
|
High
|
George Kraft |
Bug Description
Solutions QA team has a failed run where calico charm errors due to update-status hook failing.
The failure happens within the kubernetes-maas layer.
From the logs:
unit-calico-0: 11:36:05 INFO unit.calico/
unit-calico-0: 11:36:05 INFO unit.calico/
unit-calico-0: 11:36:05 INFO unit.calico/
unit-calico-0: 11:36:05 INFO unit.calico/
unit-calico-0: 11:36:16 ERROR unit.calico/
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
node = calicoctl_
File "/var/lib/
result = yaml.safe_
File "/var/lib/
return load(stream, SafeLoader)
File "/var/lib/
return loader.
File "/var/lib/
node = self.get_
File "/var/lib/
if not self.check_
File "/var/lib/
self.
File "/var/lib/
raise ParserError(None, None,
yaml.parser.
in "<byte string>", line 2, column 1:
apiVersion: projectcalico.
^
Test run:
https:/
Logs:
https:/
Changed in charm-calico: | |
milestone: | none → 1.26+ck1 |
milestone: | 1.26+ck1 → 1.26 |
assignee: | nobody → George Kraft (cynerva) |
status: | Triaged → In Progress |
Changed in charm-calico: | |
status: | In Progress → Fix Committed |
Changed in charm-calico: | |
status: | Fix Committed → Fix Released |
Interesting. It looks like `calicoctl get node <node-name` returned unexpected output - something in line 1 closed the YAML document. I'm guessing it logged a warning to stderr that got captured[1] and interpreted as a YAML sequence, or something.
Recommended fix: ParserError is raised in calicoctl_get so we can see what it failed to parse
1. Remove the stderr=STDOUT pipe when calling calicoctl
2. Add debug logging when yaml.parser.
[1]: https:/ /github. com/charmed- kubernetes/ layer-calico/ blob/d6af078547 0d3370c3791dc17 df51874a87da0db /reactive/ calico. py#L619