diff --git a/localstack/utils/container_utils/docker_cmd_client.py b/localstack/utils/container_utils/docker_cmd_client.py index 30c113f4d1d8b..f82c3548ff3e0 100644 --- a/localstack/utils/container_utils/docker_cmd_client.py +++ b/localstack/utils/container_utils/docker_cmd_client.py @@ -291,6 +291,8 @@ def push_image(self, docker_image: str) -> None: raise AccessDenied(docker_image) if "requesting higher privileges than access token allows" in to_str(e.stdout): raise AccessDenied(docker_image) + if "access token has insufficient scopes" in to_str(e.stdout): + raise AccessDenied(docker_image) if "does not exist" in to_str(e.stdout): raise NoSuchImage(docker_image) if "connection refused" in to_str(e.stdout): diff --git a/localstack/utils/container_utils/docker_sdk_client.py b/localstack/utils/container_utils/docker_sdk_client.py index d1749fda7c072..8b65183b5d4eb 100644 --- a/localstack/utils/container_utils/docker_sdk_client.py +++ b/localstack/utils/container_utils/docker_sdk_client.py @@ -251,6 +251,8 @@ def push_image(self, docker_image: str) -> None: raise AccessDenied(docker_image) if "requesting higher privileges than access token allows" in to_str(result): raise AccessDenied(docker_image) + if "access token has insufficient scopes" in to_str(result): + raise AccessDenied(docker_image) if "connection refused" in to_str(result): raise RegistryConnectionError(result) raise ContainerException(result)