-
Notifications
You must be signed in to change notification settings - Fork 72
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
Getting 'auth error: EOF' when referencing a GitRepository pulling via SSH #210
Comments
Are you certain the SSH key used is a read-write one? Bitbucket "Access Keys" analog to "Deploy Keys" from GitHub and friends, are read-only without any read-write option on Bitbucket Cloud. ImageUpdateAutomation writes to the repo, so it needs a read-write key. I am not certain how this error presents from Bitbucket on push when a key with read-only access is used, so I would be suspicious of any auth error from Bitbucket as potentially due to this issue. (You could add your SSH key to a machine account with write access to work around this issue, if that is the case.) |
To make it more explicit, yes, this project in on Bitbucket, as subtly hinted at in the manifests.
We have a full-fledged Flux bot user. On that user, we have setup ssh keys to access our multiple k8s clusters. The same way that my own user have a ssh key for working with git/Bitbucket. Then, the access to the repositories are managed on a repo basis: each repository decide which users/groups have access, and at what level (read/write/admin). On the relevant repos that we want Flux to automate, we setup the bot user with write access. I even tried with admin, but it didn't help. If the GitRepository is working over ssh, ImageUpdateAutomation won't be able to push commits. To test it all out, we made a setup where we used an App Password (with read/write permission for repositories). By setting the GitRepository with those credentials, and the appropriate url, ImageUpdateAutomation is able to push commits. The thing is, those are not brand new ssh keys or a brand new setup for accessing our repos. Those were setup and used by our Flux v1 integration (which had auto image update enabled). :/ |
Hmm! So you are able to work around with an app password, but this uses HTTP auth and this is probably undesirable (Moreover, if there is a bug in the SSH implementation, you will not be the only users affected and we will want to have a bead on the issue.) I have a Flux cluster set up on Bitbucket cloud, but I have not tested ImageUpdateAutomation there with SSH. I will get around to it within the next couple of days, then perhaps we can debug the issue on our own without taking up your time. Thank you for the report! Can you please confirm what version of Flux are you using, and re-confirm if it is anything earlier than 0.16.2 whether the problem is still in force if you upgrade to the last Flux version? |
I did this
The last few steps are just a minimal way to get the automation to make commits -- I go and edit the image version in the file to an old one and commit that, it updates to the latest. Then I tried different kinds of key by recreating the secret with
(and pasting the fingerprint into bitbucket). I found that it worked both with an RSA key and with EDRSA (default number of bits / curve). With an ED25519 key, image-automation-controller fails to clone the repo with the error message @wolfmah Can you see any significant differences between what I've done and your setup? |
@kingdonb
Here's what was already in place:
Now, for the new stuff:
The rest is pretty much the same: create ImageRepository + ImagePolicy, along with the GitRepository + Kustomization. Then the ImageUpdateAutomation, pointing to the GitRepository and either the HTTPS or SSH secret. Then, pushing some commit and letting our CI generate a new Docker artifact that will eventually get picked up by the ImagePolicy. It feels like I'm missing something, because squaremo, if you are able to work with Bitbucket and SSH, I should be able too. :/ |
Making the SSH secret with Terraform is a difference -- are you able to try using |
The latest release of the image-automation-controller ( NB: if the issue continues to exist, I think it is happening due to a handshake issue and you may want to confirm the key in |
I just tested in 0.18.2 and the same problem happen. But...
It is indeed a difference that I didn't account for before. I don't know how the old keys were generated, but I can see that they are RSA keys. Though, for testing, I personally created a new key-pair and used
Using that new secret inside my already existing |
Thanks for reporting back! 👍
It may just be that the fields in |
When creating an
ImageUpdateAutomation
that reference aGitRepository
in HTTPS mode,ImageUpdateAutomation
is able to reconcile. When referencing aGitRepository
in SSH mode, it gives this error:auth error: EOF
.GitRepository
in HTTPS mode:GitRepository
in SSH mode:ImageUpdateAutomation
(onlyspec.sourceRef.name
changes while testing the twoGitRepository
):The status result when
spec.sourceRef.name == my-app-ssh
:The status result when
spec.sourceRef.name == my-app-https
:The text was updated successfully, but these errors were encountered: