diff --git a/ops-sunbeam/ops_sunbeam/charm.py b/ops-sunbeam/ops_sunbeam/charm.py index 11f6921d..3f82c9c1 100644 --- a/ops-sunbeam/ops_sunbeam/charm.py +++ b/ops-sunbeam/ops_sunbeam/charm.py @@ -675,8 +675,12 @@ class OSBaseOperatorCharmK8S(OSBaseOperatorCharm): def _retry_db_sync(self, cmd): container = self.unit.get_container(self.db_sync_container_name) logging.debug("Running sync: \n%s", cmd) - process = container.exec(cmd, timeout=5 * 60) - out, err = process.wait_output() + try: + process = container.exec(cmd, timeout=5 * 60) + out, err = process.wait_output() + except ops.pebble.ExecError as e: + logger.warning(f"DB Sync pebble exec error: {str(e)}") + raise e if err: for line in err.splitlines(): logger.warning("DB Sync stderr: %s", line.strip())