From 06667d87d848f3d82ebdcdb985844a3993437ebd Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 12 Sep 2023 16:02:55 +0300 Subject: [PATCH] Edge case when there's no endpoint --- src/backups.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backups.py b/src/backups.py index 6c04064a03..aafa04ccb6 100644 --- a/src/backups.py +++ b/src/backups.py @@ -411,6 +411,9 @@ def _initialise_stanza(self) -> None: @property def _is_primary_pgbackrest_service_running(self) -> bool: + if not self.charm.primary_endpoint: + logger.warning("Failed to contact pgBackRest TLS server: no promary endpoint") + return False return_code, _, stderr = self._execute_command( [PGBACKREST_EXECUTABLE, "server-ping", "--io-timeout=10", self.charm.primary_endpoint] )