Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lippertto opened this issue Oct 7, 2019 · 15 comments
Closed
Assignees
Labels
area/gcb good first issue Good for newcomers priority/p0 Highest priority. Break user flow. We are actively looking at delivering it. work-around-available

Comments

@lippertto
Copy link

lippertto commented Oct 7, 2019

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
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@tadeas22
Copy link

tadeas22 commented Oct 7, 2019

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

Yes

@lippertto
Copy link
Author

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.

@huguesalary
Copy link
Contributor

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

I'm using --cache true

@MichaelBrandt4994
Copy link

MichaelBrandt4994 commented Oct 9, 2019

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

@purificant
Copy link

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.

@tejal29 tejal29 added area/gcb priority/p0 Highest priority. Break user flow. We are actively looking at delivering it. good first issue Good for newcomers labels Oct 16, 2019
@cvgw cvgw self-assigned this Oct 30, 2019
@cvgw
Copy link
Contributor

cvgw commented Nov 1, 2019

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

@purificant
Copy link

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.

@cvgw
Copy link
Contributor

cvgw commented Nov 11, 2019

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.

@ghost
Copy link

ghost commented Nov 14, 2019

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

@ghost
Copy link

ghost commented Nov 18, 2019

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.

@RJPercival
Copy link

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.

@cvgw
Copy link
Contributor

cvgw commented Nov 22, 2019

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

@cvgw cvgw closed this as completed Nov 22, 2019
@purificant
Copy link

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

@anuragslab
Copy link

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

@viktorvillalobos
Copy link

I am still having this issue, what is the solution?

I'm following the official documentation: https://cloud.google.com/build/docs/kaniko-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gcb good first issue Good for newcomers priority/p0 Highest priority. Break user flow. We are actively looking at delivering it. work-around-available
Projects
None yet
Development

No branches or pull requests

10 participants