Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Kaniko Logs Leakage: Kaniko pod exiting before errors could be read by Skaffold or any other tool. #597

@prary

Description

@prary

Actual behavior
Do a skaffold run with Dockerfile containing invalid "FROM InvalidImageLocation".
Kaniko tries to contact to invalid artifact path and fails and deletes the Kaniko pod and container.
This happens quite fast before Skaffold logger starts streaming logs from Kaniko pod. After which skaffold check the pod status which shows Pod already in terminal phase with no output what that command gave on execution in kainko pod .

Expected behavior
Pod should wait for certain duration so skaffold can attach its logger and fetch the failure logs. Failure logs should be fetch and read by Skaffold properly.

To Reproduce
Steps to reproduce the behavior:

  1. Download Skaffold
  2. Do the required setup to run skaffold.
  3. Create skaffold.yaml file and Dockerfile.
  4. In your Dockerfile put invalid
    FROM gcr.io/invalidImageNameORUnReachableImage
  5. Do a skaffold run and your would get the following output.
    build step: building [gcr.io/invalidImageNameORUnReachableImage]: kaniko build for [gcr.io/invalidImageNameORUnReachableImage]: waiting for pod to complete: pod already in terminal phase: Failed
    Pod already in terminal phased.

Expected Output should be

     Error while retrieving image from cache: could not parse reference
     INFO[0002] Downloading base image gcr.io/invalidImageNameORUnReachableImage
     error building image: could not parse reference

Above logs are not streams to skaffold since kaniko pod terminates.

Additional Information

  • Dockerfile
FROM gcr.io/invalidImageNameORUnReachableImage
RUN yum install -y wget
COPY app.py .
EXPOSE 8080
CMD [ "python", "app.py" ]

  • Kaniko Image (fully qualified with digest)
    docker pull gcr.io/kaniko-project/executor@sha256:d9fe474f80b73808dc12b54f45f5fc90f7856d9fc699d4a5e79d968a1aef1a72

Note :
1- This error is not limited to "From InvalidImageLocation" command, all the commands logs running and failing before skaffold attaches its logger are not fetch due to Pod temination.
2- If any Docker command which on execution produces too much of output then also Kaniko terminates and the output is not passed to skaffold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/errorhandlingFor all bugs having to do with handling problems during kaniko executionpriority/p1Basic need feature compatibility with docker build. we should be working on this next.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions