Skip to content

kaniko hangs for minutes doing nothing when destination is insecure http registry #1933

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

Open
arve0 opened this issue Feb 8, 2022 · 6 comments
Labels
area/performance issues related to kaniko performance enhancement area/registry For all bugs having to do with pushing/pulling into registries kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy

Comments

@arve0
Copy link

arve0 commented Feb 8, 2022

Actual behavior
Kaniko hangs for minutes twice:

  1. In beginning, after logline Adding /var/run to initialIgnoreList, about two and a half minute.
  2. In end, after logline Pushing image to registry.default/arve0/kaniko-repro, 13 minutes.

Expected behavior
Kaniko should not try HTTPS without timeout when given --insecure-registry parameter, such that it does not hang for minutes doing nothing.

To Reproduce
Reproduced on Digital Ocean and Linode managed kubernetes.

Steps to reproduce the behavior:

  1. Deploy a local registry HTTP registry, for example https://github.com/arve0/kaniko-repro/blob/master/registry.yaml
  2. Start kaniko:
kubectl run kaniko --restart=Never --image=gcr.io/kaniko-project/executor:debug -- \
  --log-format=text \
  --verbosity=trace \
  --log-timestamp \
  --context=git://github.com/arve0/kaniko-repro \
  --insecure-registry=registry.default \
  --destination=registry.default/arve0/kaniko-repro \
  --force # force is required on linode, as runc detection does not work correctly

Alternative Reproduction
Installs registry and runs reproduction:

git clone https://github.com/arve0/kaniko-repro
cd kaniko-repro
./reproduce.sh

Additional Information

What have I tried?
I've search issues after "hang", and found similar behavior described in #1287. Workaround in comment does not work. Also, my cluster have internet access, so not same issue I believe.

Adding HTTPS on port 443 to registry resolves the issue.

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
@arve0 arve0 changed the title kaniko hangs for minutes doing nothing kaniko hangs for minutes doing nothing when destination is internal http registry Feb 8, 2022
@arve0
Copy link
Author

arve0 commented Feb 8, 2022

I've debugged some more, and it seems to only happen when using --insecure-registry=registry.default. Unable to reproduce when using same registry with ingress and cert-manager that has fully qualified domain name.

@arve0
Copy link
Author

arve0 commented Feb 8, 2022

Reproduced with --insecure and --insecure-registry registry.default also.

Unable to reproduce if Service listens on port 443, for example:

apiVersion: v1
kind: Service
metadata:
  name: registry
  namespace: default
spec:
  selector:
    app: registry
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: http
    - name: https
      protocol: TCP
      port: 443
      targetPort: http

Which of course is wrong, but hints to that kaniko tries to connect with HTTPS even when --insecure-registry is given. Or that I am using the flag wrong.

@arve0 arve0 changed the title kaniko hangs for minutes doing nothing when destination is internal http registry kaniko hangs for minutes doing nothing when destination is insecure http registry Feb 13, 2022
@tejal29
Copy link
Contributor

tejal29 commented Feb 20, 2022

we have seen this hanging issue in Skaffold's TestBuildKanikoInsecureRegistry reported here GoogleContainerTools/skaffold#7121

@agorgl
Copy link

agorgl commented Mar 20, 2022

Just bumped into this too!

@Enity
Copy link

Enity commented May 5, 2022

spent hours looking for this. bump

@brezerk
Copy link

brezerk commented Sep 2, 2022

same here. bump

@aaron-prindle aaron-prindle added kind/bug Something isn't working area/performance issues related to kaniko performance enhancement area/registry For all bugs having to do with pushing/pulling into registries priority/p2 High impact feature/bug. Will get a lot of users happy labels May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance issues related to kaniko performance enhancement area/registry For all bugs having to do with pushing/pulling into registries kind/bug Something isn't working priority/p2 High impact feature/bug. Will get a lot of users happy
Projects
None yet
Development

No branches or pull requests

6 participants