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

get a warning “appears to need SSH authentication but no SSH credentials have been provided” in the pipelinerun log #1220

Open
ma0ziyuan opened this issue Nov 19, 2023 · 3 comments

Comments

@ma0ziyuan
Copy link

ma0ziyuan commented Nov 19, 2023

Expected Behavior

no warning in the pipelinerun log when i use the task “git-clone” to pull the source code from my gitlab server using ssh protocol

Actual Behavior

get a warning in the pipelinerun log when i use the task “git-clone” to pull the source code from my gitlab server using ssh protocol,but the source code was pulled successfully

[fetch-source : clone] {"level":"warn","ts":1700370900.1551552,"caller":"git/git.go:271","msg":"URL(\"ssh://git@gitlab.xxx.com:1022/yyy/zzz.git\") appears to need SSH authentication but no SSH credentials have been provided"}

Steps to Reproduce the Problem

1.the pipeline version is v0.52.1
2.the “git-clone” task version is 0.9
3.the git-init image is "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.40.2"
4. follow the steps in the https://tekton.dev/docs/how-to-guides/clone-repository/

Additional Info

i am not sure the real reason,because i am not familiar with the Go language and the pipeline source code. i can only guess the problem maybe from the source codes below:

os.Stat(filepath.Join(credsDir, ".ssh"))
https://github.com/tektoncd/pipeline/blob/a172b76d9055fec57a61f7955cd33869aaa18698/pkg/git/git.go#L262-L273

validateGitAuth(logger, pipeline.CredsDir, spec.URL)
https://github.com/tektoncd/pipeline/blob/a172b76d9055fec57a61f7955cd33869aaa18698/pkg/git/git.go#L74-L86

CredsDir = "/tekton/creds" // #nosec
https://github.com/tektoncd/pipeline/blob/23581c5f9f67f6855f1956775ca8be03ba1ed86f/pkg/apis/pipeline/paths.go#L17-L31

@nostra
Copy link

nostra commented Jan 9, 2024

Related #1220 and #1169, both erroneously (IMO) closed. I encounter the same problem.

@wesleyvandermeer
Copy link

Bump!

@wesleyvandermeer
Copy link

I have figured out that libcrypto needs a new line at the end of the private key file.

My solution:

Open your "id_rsa" file, at the end, add a new line and save it.

Then use the following instruction to create the k8s secret:

kubectl create secret generic --from-file=/path/to/id_rsa_with_newline --output yaml --dry-run=client

I always use kubeseal when i do not have the luxury to external secret providers:

kubectl create secret generic --from-file=/path/to/id_rsa_with_newline --output yaml --dry-run=client | kubeseal -o yaml

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

3 participants