diff --git a/pyproject.toml b/pyproject.toml index b5b71358b2..3dc20e66df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ [tool.poetry] package-mode = false +requires-poetry = ">=2.0.0" [tool.poetry.dependencies] python = "^3.10" diff --git a/src/backups.py b/src/backups.py index 4d905f8e21..7c33abcbbd 100644 --- a/src/backups.py +++ b/src/backups.py @@ -18,7 +18,7 @@ import boto3 as boto3 import botocore -from botocore.exceptions import ClientError +from botocore.exceptions import ClientError, ParamValidationError, SSLError from charms.data_platform_libs.v0.s3 import ( CredentialsChangedEvent, S3Requirer, @@ -284,6 +284,9 @@ def _create_bucket_if_not_exists(self) -> None: except ClientError: logger.warning("Bucket %s doesn't exist or you don't have access to it.", bucket_name) exists = False + except SSLError as e: + logger.error(f"error: {e!s} - Is TLS enabled and CA chain set on S3?") + raise e if exists: return @@ -798,7 +801,7 @@ def _on_s3_credential_changed_primary(self, event: HookEvent) -> bool: try: self._create_bucket_if_not_exists() - except (ClientError, ValueError): + except (ClientError, ValueError, ParamValidationError, SSLError): self._s3_initialization_set_failure(FAILED_TO_ACCESS_CREATE_BUCKET_ERROR_MESSAGE) return False