diff --git a/flytekit/image_spec/image_spec.py b/flytekit/image_spec/image_spec.py index 57073db77b..cd2f51131e 100644 --- a/flytekit/image_spec/image_spec.py +++ b/flytekit/image_spec/image_spec.py @@ -715,7 +715,11 @@ def should_build(self, image_spec: ImageSpec) -> bool: return True click.secho(f"Image {img_name} found. Skip building.", fg="blue") else: - click.secho(f"Flytekit assumes the image {img_name} already exists.", fg="blue") + raise RuntimeError( + f"Could not verify if image {img_name} exists. " + f"Please ensure Docker is running and AWS CLI is configured for ECR access. " + f"You can also set FLYTE_FORCE_PUSH_IMAGE_SPEC=1 to force rebuild." + ) return False