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

User cancelled hostkey check on Azure DevOps #106

Closed
containerpope opened this issue Feb 9, 2021 · 0 comments · Fixed by #109
Closed

User cancelled hostkey check on Azure DevOps #106

containerpope opened this issue Feb 9, 2021 · 0 comments · Fixed by #109
Labels
bug Something isn't working

Comments

@containerpope
Copy link

Currently the imageautomationupdate I created is failing with the error: ** error: user cancelled hostkey check**

The system is setup as follows:

---
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
  name: base-backend-repo
  namespace: tenant-backend
spec:
  interval: 2m0s
  ref:
    branch: main
  url: ssh://[email protected]/v3/XXX/XXX/XXX
  gitImplementation: libgit2 # Special for azure devops
  secretRef:
    name: ssh-credentials
  ignore: |
    .git/
    .github/
    scripts/
apiVersion: image.toolkit.fluxcd.io/v1alpha1
kind: ImageUpdateAutomation
metadata:
  name: tenant-backend-image-update
  namespace: tenant-backend
spec:
  checkout:
    branch: main
    gitRepositoryRef:
      name: base-backend-repo
  commit:
    authorEmail: [email protected]
    authorName: fluxcdbot
    messageTemplate: '[ci skip] update image'
  interval: 1m0s
  update:
    strategy: Setters

This results in the following:

│   Conditions:                                                                                                                                                                                                                                                                                                                                                  │
│     Last Transition Time:  2021-02-05T17:27:30Z                                                                                                                                                                                                                                                                                                                │
│     Message:               unable to clone 'ssh://[email protected]/v3/XXX/XXX/XXX', error: user cancelled hostkey check                                                                                                                                                                                                │
│     Reason:                ReconciliationFailed                                                                                                                                                                                                                                                                                                                │
│     Status:                False                                                                                                                                                                                                                                                                                                                               │
│     Type:                  Ready                                                                                                                                                                                                                                                                                                                               │
│   Observed Generation:     1                                                                                                                                                                                                                                                                                                                                   │
│ Events:                                                                                                                                                                                                                                                                                                                                                        │
│   Type    Reason  Age                      From                         Message                                                                                                                                                                                                                                                                                │
│   ----    ------  ----                     ----                         -------                                                                                                                                                                                                                                                                                │
│   Normal  error   4m21s (x334 over 3d15h)  image-automation-controller  unable to clone 'ssh://[email protected]/v3/XXX/XXX/XXX', error: user cancelled hostkey check

The ssh credentials are correct, because all other processes are working as expected, so there seems to be only an issue in the image update controller.

@stefanprodan stefanprodan added the bug Something isn't working label Feb 9, 2021
squaremo added a commit that referenced this issue Feb 11, 2021
The "auth strategy", which depends on the GitImplementation, was
hard-wired to the "gogit" constant, but it should come from the
GitRepository spec. When the implementation is "libgit2" and the git
URL entails SSH, the result would normally include a callback for
checking the host key against known_hosts; but since it was
hard-wired, it was missing that callback.

This explains at least some instances of the error `user cancelled
hostkey check` from #106. The error, or a close relative, might also
arise if the callback rejects the host key because the host as it
appears in the known_hosts doesn't match that host as passed to the
callback -- see
fluxcd/source-controller#287.

Signed-off-by: Michael Bridgen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants