When trying to load relation data, it is possible to have the relation be available but the databag unreadable. The lib is running into an error when loading the databag because it doesn't handle the case where relation is available but the databag contents aren't.
def _load_provider_certificates(self, relation: Relation) -> List[_Certificate]:
try:
provider_relation_data = _ProviderApplicationData.load(relation.data[self.charm.app])
except DataValidationError:
logger.debug("Invalid provider relation data")
return []
return copy.deepcopy(provider_relation_data.certificates)
relation.data[self.charm.app] is breaking in the above.