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

Unexpected end of JSON input on Task Inputs and Outputs example #1210

Closed
moficodes opened this issue Aug 16, 2019 · 5 comments
Closed

Unexpected end of JSON input on Task Inputs and Outputs example #1210

moficodes opened this issue Aug 16, 2019 · 5 comments

Comments

@moficodes
Copy link
Contributor

Expected Behavior

Run the tutorial to have a build image.

Actual Behavior

kubectl logs build-docker-image-from-git-source-task-run-pod-acf4c7 -c step-build-and-push
INFO[0000] Downloading base image golang:1.12.6-alpine3.9
2019/08/16 18:21:46 No matching credentials were found, falling back on anonymous
INFO[0000] Unpacking rootfs as cmd RUN go build -o /web . requires it.
INFO[0006] Taking snapshot of full filesystem...
INFO[0007] Skipping paths under /kaniko, as it is a whitelisted directory
INFO[0007] Skipping paths under /proc, as it is a whitelisted directory
INFO[0007] Skipping paths under /var/run, as it is a whitelisted directory
INFO[0007] Skipping paths under /sys, as it is a whitelisted directory
INFO[0007] Skipping paths under /dev, as it is a whitelisted directory
INFO[0007] Skipping paths under /builder/home, as it is a whitelisted directory
INFO[0007] Skipping paths under /builder/tools, as it is a whitelisted directory
INFO[0007] Skipping paths under /workspace, as it is a whitelisted directory
INFO[0009] Using files from context: [/workspace/docker-source/examples/microservices/leeroy-web/web.go]
INFO[0009] COPY web.go .
INFO[0009] Taking snapshot of files...
INFO[0009] RUN go build -o /web .
INFO[0009] cmd: /bin/sh
INFO[0009] args: [-c go build -o /web .]
INFO[0010] Taking snapshot of full filesystem...
INFO[0011] Skipping paths under /kaniko, as it is a whitelisted directory
INFO[0011] Skipping paths under /proc, as it is a whitelisted directory
INFO[0011] Skipping paths under /var/run, as it is a whitelisted directory
INFO[0011] Skipping paths under /sys, as it is a whitelisted directory
INFO[0011] Skipping paths under /dev, as it is a whitelisted directory
INFO[0011] Skipping paths under /builder/home, as it is a whitelisted directory
INFO[0011] Skipping paths under /builder/tools, as it is a whitelisted directory
INFO[0011] Skipping paths under /workspace, as it is a whitelisted directory
INFO[0011] Adding whiteout for /root/.cache/go-build/e3/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-d
INFO[0011] Adding whiteout for /root/.cache/go-build/31/311571a11a5934d4f63ba6daaa1b0a1e578ee13a1a373547131af1d9d157dbb4-d
INFO[0011] Adding whiteout for /root/.cache/go-build/98/9816bb371bccde8cb7bf5a44febdb32bbc327a0a5c2e940d9b8b3a402f62e4f0-d
INFO[0011] Adding whiteout for /root/.cache/go-build/77/77a522d1008cfd60284c5bd5cc6fc283abe7ef012d61d06d0fd6b1ff03becc68-a
INFO[0011] Adding whiteout for /root/.cache/go-build/c4/c483d510e0608431902a9e3aa9e162e4b88f745b790a07a1a4b45f22ef9013f4-a
INFO[0011] Adding whiteout for /root/.cache/go-build/e0/e0d9637a42516f6aa3defff56cc9a4d3deaf96b2ade546448835c41bd63d82bc-a
INFO[0011] Adding whiteout for /root/.cache/go-build/b5/b5cb5076dbba489139e99e802f57979f0f7f4f96806267201ca4e383513a312b-a
INFO[0011] Adding whiteout for /root/.cache/go-build/5e/5eddca62332aaa6cb767cf6e8b4ce6b00d97ee63b3f549ac9586becdaea0f26c-d
INFO[0013] Storing source image from stage 0 at path /kaniko/stages/0
INFO[0020] Deleting filesystem...
INFO[0023] Downloading base image alpine:3.9
2019/08/16 18:22:09 No matching credentials were found, falling back on anonymous
INFO[0023] Taking snapshot of full filesystem...
INFO[0024] Skipping paths under /kaniko, as it is a whitelisted directory
INFO[0024] Skipping paths under /proc, as it is a whitelisted directory
INFO[0024] Skipping paths under /var/run, as it is a whitelisted directory
INFO[0024] Skipping paths under /sys, as it is a whitelisted directory
INFO[0024] Skipping paths under /dev, as it is a whitelisted directory
INFO[0024] Skipping paths under /builder/home, as it is a whitelisted directory
INFO[0024] Skipping paths under /builder/tools, as it is a whitelisted directory
INFO[0024] Skipping paths under /workspace, as it is a whitelisted directory
INFO[0024] CMD ["./web"]
INFO[0024] COPY --from=builder /web .
INFO[0024] Taking snapshot of files...
error pushing image: failed to push to destination us.icr.io/moficodes/leeroy-web:latest: unexpected end of JSON input

I think two lines to notice is

2019/08/16 18:21:46 No matching credentials were found, falling back on anonymous

and

error pushing image: failed to push to destination us.icr.io/moficodes/leeroy-web:latest: unexpected end of JSON input

If this is a secret issue, maybe we can see little better error messages.
But I should have the right credentials set. In this namespace I can pull image from the same source.

Might be missing something.

Steps to Reproduce the Problem

  • Run through the Task Inputs and Outputs tutorial.

Additional Info

Run on a vanilla k8s on IKS 1.15

@bobcatfish
Copy link
Collaborator

Hi again! :D

@moficodes looking at the output:

error pushing image: failed to push to destination us.icr.io/moficodes/leeroy-web:latest: unexpected end of JSON input

I think maybe us.icr.io should be us.gcr.io?

@moficodes
Copy link
Contributor Author

Hey @bobcatfish no its the ibm cloud container registry. 😬

I will try testing with some other container registry next and see if thats why its failing.

@bobcatfish
Copy link
Collaborator

Hey @bobcatfish no its the ibm cloud container registry. 😬

image

hahaha sorry about that! I tried to go to us.icr.io in my browser with no luck and thought that was the end of it XD

This probably has something to do with how kaniko is doing the auth then - GoogleContainerTools/kaniko#425 looks like a related issue tho i dont think it points at a clear answer 🤔

If this is a secret issue, maybe we can see little better error messages.

Unfortunately that error is coming from kaniko so you might be able to find more on how to get thi to work at https://github.com/GoogleContainerTools/kaniko

Also our docs on our kaniko catalog task might help: https://github.com/tektoncd/catalog/tree/master/kaniko#serviceaccount

@moficodes
Copy link
Contributor Author

The service account secret was the culprit.

More specifically

  annotations:
    tekton.dev/docker-0: https://gcr.io # Described below

Adding this annotation and pointing it to the right base.
Its a bit weird. But the image is created and pushed to the cloud. 🤘🏽

Thank you @bobcatfish for your help.

Closing.

@bobcatfish
Copy link
Collaborator

Glad you were able to get it working @moficodes !!! Seems a bit odd that you have to use an annotation with gcr.io when you're actually using icr.io 😅 Feel free to open another issue if it's something you feel we should look into further 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants