Kaniko: Kaniko executor image fails to start (unknown command true for executor)

Created on 7 Oct 2019  路  14Comments  路  Source: GoogleContainerTools/kaniko

Actual behavior
The Kaniko executor image fails to start.

gcloud build submit fails with the following error message:

Pulling image: gcr.io/kaniko-project/executor:latest
latest: Pulling from kaniko-project/executor
Digest: sha256:fb27a2ca60b0943d124100abb66e937bfcf81821d2c79eb7813b7e74637958d0
Status: Downloaded newer image for gcr.io/kaniko-project/executor:latest gcr.io/kaniko-project/executor:latest
Error: unknown command "true" for "executor"
Run 'executor --help' for usage.
ERROR
ERROR: build step 0 "gcr.io/kaniko-project/executor:latest" failed: exit status 1

Expected behavior
Image is built using kaniko

To Reproduce
submit a build with a minimal dockerfile, e.g. with FROM python:3.7

gcloud config set builds/use_kaniko True gcloud builds submit --tag $IMAGE_NAME:$IMAGE_TAG

Additional Information

  • Dockerfile
    See above. A minimal file causes the error.
  • Build Context
    Only the dockerfile
  • Kaniko Image (fully qualified with digest)
    gcr.io/kaniko-project/executor:latest
    Digest: sha256:fb27a2ca60b0943d124100abb66e937bfcf81821d2c79eb7813b7e74637958d0

Triage Notes for the Maintainers

| Description | Yes/No |
|----------------|---------------|
| Please check if this a new feature you are proposing |

  • - [ ]
|
| Please check if the build works in docker but not in kaniko |
  • - [x]
|
| Please check if this error is seen when you use --cache flag |
  • - [x]
|
| Please check if your dockerfile is a multistage dockerfile |
  • - [x]
|

aregcb good first issue prioritp0 work-around-available

Most helpful comment

This issue is fixed in v272.0.0 of the gcloud sdk (released on 2019-11-19)

I've verified that it works with kaniko versions v0.13.0 and v0.14.0

All 14 comments

Please check if this error is seen when you use --cache flag

Yes

I do not explicitly set the cache flag, because kaniko is triggered by GCP's cloud build, but according to the documentation the option that I set with gcloud config set builds/use_kaniko True causes the cache to be enabled.

So, yes, the problem is seen when I use the cache flag.

I'm running into the same issue. It was still working well yesterday at 2pm PST.

I'm using --cache true

I'm using a cloudbuild.yaml and running into the same issue.

As a quickfix I'm using --cache=true

EDIT:

only --cache is working too

I have the same issue, kaniko is enabled with gcloud config set builds/use_kaniko True as per docs here: https://cloud.google.com/cloud-build/docs/kaniko-cache without an explicit cloudbuild.yaml.

We are working on a fix for this issue.

As a potential work around you can try using v0.12.0 image of kaniko
gcloud config set builds/kaniko_image gcr.io/kaniko-project/executor:v0.12.0

Downgrading to kaniko v0.12.0 with gcloud config set builds/kaniko_image gcr.io/kaniko-project/executor:v0.12.0 worked for me! Thank you. Can confirm that versions v0.13.0 and v0.14.0 are affected.

Downgrading to kaniko v0.12.0 with gcloud config set builds/kaniko_image gcr.io/kaniko-project/executor:v0.12.0 worked for me! Thank you. Can confirm that versions v0.13.0 and v0.14.0 are affected.

Indeed, both v0.13.0 and v0.14.0 have this issue.

thank you for this thread too much. I have the same issues, use v.0.12.0, works

v0.12.0

We are working on a fix for this issue.

As a potential work around you can try using v0.12.0 image of kaniko
gcloud config set builds/kaniko_image gcr.io/kaniko-project/executor:v0.12.0

I tried v0.12.0, it CAN WORK, but there are a lot warning message
"Error while retrieving image from cache: getting file info: stat /cache/sha256:f6c42959bcc1619c55898bbff2c3a9bff5d4a1e90bf79c491e9f016a88105eea: no such file or directory"

even I didn't change any byte, build again, it still builds from the base image, the cache doesn't work. hope I can get the latest version work.

You can ignore those "Error while retrieving image from cache: getting file info" messages, they're a red herring. They're caused by Kaniko searching a local /cache directory before checking your container registry. One way you can tell whether a cache is being created by Kaniko is looking for a "cache" directory next to the images it pushes to your container registry.

This issue is fixed in v272.0.0 of the gcloud sdk (released on 2019-11-19)

I've verified that it works with kaniko versions v0.13.0 and v0.14.0

Thank you! Switched to latest kaniko version, using up to date gcloud, no issue.

Just received this error i have checked all above details and all correct Kaniko version, sdk all latest. any thoughts how i can resolve this
Step #1: error building image: error building stage: waiting for process to exit: exit status 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/kaniko-project/executor@sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870" failed: step exited with non-zero status: 1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WesCossick picture WesCossick  路  3Comments

fkorotkov picture fkorotkov  路  3Comments

r2d4 picture r2d4  路  5Comments

vvbogdanov87 picture vvbogdanov87  路  4Comments

BenHizak picture BenHizak  路  4Comments