Traceback with `AttributeError: 'NoneType' object has no attribute 'data'` from interface_tls_certificates/requires.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Kubernetes API Load Balancer |
Fix Committed
|
Low
|
Adam Dyess | ||
Kubernetes Control Plane Charm |
Fix Committed
|
Low
|
Adam Dyess |
Bug Description
On new deploys, the charm logs a traceback:
Traceback (most recent call last):
File "/var/lib/
result = self.reconcile_
File "/var/lib/
self.
File "/var/lib/
cert = self.certificat
File "/var/lib/
return {cert.common_name: cert for cert in self.server_certs}
File "/var/lib/
common_name = self.relation.
AttributeError: 'NoneType' object has no attribute 'data'
This happens when the charm is first coming up, before the certificates relation has been established. The charm catches the error and enters Blocked status with the message: "Missing required certificates". The error resolves itself once the certificates relation is established.
Changed in charm-kubeapi-load-balancer: | |
status: | In Progress → Fix Committed |
Changed in charm-kubernetes-master: | |
status: | In Progress → Fix Committed |
Also affects kubernetes- control- plane from the `ops` branch. I recommend a fix in interface- tls-certificate s to handle it more gracefully when `self.relation` is None.