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

Skaffold should throw the exact error #2730

Closed
prary opened this issue Aug 27, 2019 · 6 comments
Closed

Skaffold should throw the exact error #2730

prary opened this issue Aug 27, 2019 · 6 comments
Labels
area/cli kind/bug Something isn't working kind/feature-request priority/p2 May take a couple of releases

Comments

@prary
Copy link
Contributor

prary commented Aug 27, 2019

In skaffold build using kaniko when skaffold tries to copies the context to init container. It tries to run

kubectl.Run(ctx, f, nil, "exec", "-i", p.Name, "-c", initContainer, "-n", p.Namespace, "--", "tar", "-xzf", "-", "-C", constants.DefaultKanikoEmptyDirMountPath)

If a user does not have permission to exec into pod then above build simply fails with following error

modifying kaniko pod: copying and extracting buildcontext to empty dir: exit status 1

Expected behavior

Error message should contain exact error which was return by above command

Actual behavior

Actual error is not tracked. We should have kubectl.RunErr() utility which should print error if any.

Information

  • Skaffold version: latest
  • Operating system: any
  • Contents of skaffold.yaml:

Steps to reproduce the behavior

  1. skaffold run with kaniko with user not having pod exec permission
@tejal29 tejal29 added area/cli kind/question User question priority/p2 May take a couple of releases labels Aug 27, 2019
@tejal29
Copy link
Member

tejal29 commented Aug 27, 2019

Does skaffold <args> -v=debug solve your problem ?
I like the idea of kubectl.RunErr utility. We should definitely have that

@prary
Copy link
Contributor Author

prary commented Nov 5, 2019

skaffold <args> -v=debug didn't help.

@mgoltzsche
Copy link
Contributor

In my case the log looks as follows:

time="2019-11-24T16:55:20Z" level=debug msg="overlaying profile on config for field Deploy"
time="2019-11-24T16:55:20Z" level=debug msg="overlaying profile on config for field DeployType"
time="2019-11-24T16:55:20Z" level=info msg="no values found in profile for field DeployType, using original config values"
time="2019-11-24T16:55:20Z" level=debug msg="overlaying profile on config for field statusCheckDeadlineSeconds"
time="2019-11-24T16:55:20Z" level=debug msg="overlaying profile on config for field kubeContext"
time="2019-11-24T16:55:20Z" level=debug msg="overlaying profile on config for field PortForward"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct SkaffoldConfig"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct Metadata"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct Pipeline"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct BuildConfig"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct Artifact"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct ArtifactType"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct KanikoArtifact"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct KanikoBuildContext"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct LocalDir"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct TagPolicy"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct GitTagger"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct BuildType"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct ClusterDetails"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct DeployConfig"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct DeployType"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct KustomizeDeploy"
time="2019-11-24T16:55:20Z" level=debug msg="validating yamltags of struct KubectlFlags"
time="2019-11-24T16:55:20Z" level=info msg="Using kubectl context: "
time="2019-11-24T16:55:20Z" level=debug msg="Using builder: cluster"
time="2019-11-24T16:55:20Z" level=debug msg="setting Docker user agent to skaffold-v1.0.1"
Generating tags...
 - registry.example.org/myimage-pipeline -> time="2019-11-24T16:55:20Z" level=debug msg="Running command: [git describe --tags --always]"
time="2019-11-24T16:55:20Z" level=debug msg="Command output: [6a8dd29\n]"
time="2019-11-24T16:55:20Z" level=debug msg="Running command: [git status . --porcelain]"
time="2019-11-24T16:55:20Z" level=debug msg="Command output: []"
registry.example.org/myimage-pipeline:6a8dd29
time="2019-11-24T16:55:20Z" level=info msg="Tags generated in 5.446285ms"
Checking cache...
time="2019-11-24T16:55:20Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
time="2019-11-24T16:55:22Z" level=debug msg="FIXME: Got an status-code for which error does not match any expected type!!!: -1" module=api status_code=-1
time="2019-11-24T16:55:24Z" level=debug msg="Found dependencies for dockerfile: [{main.go /go true}]"
 - registry.example.org/myimage-pipeline: Not found. Building
time="2019-11-24T16:55:24Z" level=info msg="Cache check complete in 3.402365206s"
Creating kaniko secret [build/registry-deployment-push-credentials]...
time="2019-11-24T16:55:24Z" level=debug msg="getting client config for kubeContext: ``"
time="2019-11-24T16:55:24Z" level=debug msg="no kube-context set and no kubeConfig found, attempting in-cluster config"
time="2019-11-24T16:55:24Z" level=debug msg="No pull secret specified. Checking for one in the cluster."
Building [registry.example.org/myimage-pipeline]...
Storing build context at /tmp/context-deb84d9104e94f745e310e912be0632f.tar.gz
time="2019-11-24T16:55:25Z" level=debug msg="Found dependencies for dockerfile: [{main.go /go true}]"
time="2019-11-24T16:55:25Z" level=debug msg="getting client config for kubeContext: ``"
time="2019-11-24T16:55:25Z" level=debug msg="no kube-context set and no kubeConfig found, attempting in-cluster config"
time="2019-11-24T16:55:26Z" level=debug msg="getting client config for kubeContext: ``"
time="2019-11-24T16:55:26Z" level=debug msg="no kube-context set and no kubeConfig found, attempting in-cluster config"
time="2019-11-24T16:55:26Z" level=info msg="Waiting for kaniko-78krl to be initialized"
time="2019-11-24T16:55:45Z" level=debug msg="Running command: [kubectl --context  exec -i kaniko-78krl -c kaniko-init-container -n build -- tar -xzf - -C /kaniko/buildcontext]"
time="2019-11-24T16:55:46Z" level=fatal msg="build failed: build failed: building [registry.example.org/myimage-pipeline]: kaniko build for [registry.example.org/myimage-pipeline]: modifying kaniko pod: copying and extracting buildcontext to empty dir: exit status 1"

@mgoltzsche
Copy link
Contributor

With skaffold 1.1.0 this is still an issue.

@nkubala
Copy link
Contributor

nkubala commented Feb 28, 2020

@mgoltzsche thanks for the update on this. we have plans on our 2020 roadmap to overhaul our error messaging in skaffold to provide more actionable error messages, and I think this would fall under that. this will probably be prioritized by the team later in the year, but if anyone is interested in sending a PR for this specific issue, contributions are always welcome :)

@tstromberg tstromberg added kind/bug Something isn't working and removed kind/question User question labels Apr 27, 2020
@dgageot
Copy link
Contributor

dgageot commented Apr 28, 2020

This was fixed with #4023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli kind/bug Something isn't working kind/feature-request priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

7 participants