-
Notifications
You must be signed in to change notification settings - Fork 195
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
Error authenticating using github token #461
Comments
One of the more common issues is that one of the credential items has an accidental newline added in the base64 encoded values. |
I did check this a couple of times as I thought this was the error, however I would've expected to see a message more to the tune of "authentication failed" rather than "authentication required" |
Oh! I think I found the real issue, it's the |
I was also facing the same issue "error: authentication required". @Carles-Figuerola Thanks for pointing out the addition of a new line in base64 value. I created a secret using kubectl command line and it worked. The source controller was able to fetch the code from SCM. Sharing the command below I hope it will help others too.
|
We offer commands in Flux CLI for generating secrets properly, see https://fluxcd.io/docs/cmd/flux_create_secret_git/ |
Hi @stefanprodan, the issue I was having was not about having a stray |
@Carles-Figuerola can you use that token to clone a repo locally with the Git CLI? My guess is that the token issue is not specific to Flux but to the GH permissions. Note for a PAT to work, your user must have admin rights on that repo and the token should be generated with all |
I'm having some trouble setting up a
GitRepository
pointing to an Enterprise GitHub host using user tokens for authentication. It works properly using github.com and there is no proxy needed to access it (so #131 shouldn't apply). The error messages are very similar to fluxcd/flux2#529 but that issue was closed without a good explanation.I create a
secret
:and a
GitRepository
that references that secret.However, the repository does not pull:
Enabling debug on source-controller I can see:
actual error message:
multiline stacktrace from above:
Using
gitImplementation: libgit2
:actual error message:
multiline stacktrace from above:
I have tried different password/token configurations as that
github-credentials
secret. If thesecretRef
object inGitRepository
is missing, I get the same error message and if the secret itself does not exist, I get:auth secret error: Secret \"github-credentials\" not found
, which makes me think that the secret is being loaded, but not used for the actual authentication to github.The text was updated successfully, but these errors were encountered: