Open ElMoselYEE opened 7 years ago
I'm following the instructions here: https://medium.com/@kurt.stam/jenkins-on-kubernetes-with-private-git-repositories-4e0186a194eb#.j8cbonxdl
And I think I'm close. Now it's failing because:
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress git@bitbucket.org:dealersocket/inventory.audit-service.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: Host key verification failed.
So this seems like not an issue with fabric8 just an issue with how I'm using it. At the very least it's a duplicate of https://github.com/fabric8io/fabric8/issues/6646. We can close this issue but any assistance would be appreciated!
I'm able to (somewhat) workaround this issue by adding an entry in /var/jenkins_home/.ssh/known_hosts for bitbucket.org directly on the jenkins container:
eval $(minikube docker-env)
docker ps | grep jenkins-docker # record ID e.g. ea04a970d129
cat ~/.ssh/id_rsa | pbcopy
docker exec -it f23af9168b86 bash -c 'echo `pbpaste` > /var/jenkins_home/.ssh/id_rsa'
docker exec -it f23af9168b86 bash -c 'ssh-keyscan -t rsa bitbucket.org > ~/.ssh/known_hosts'
Edit: Looks like this hack doesn't really get me past the Host key verification failed.
issue. Now it's the ad-hoc kubernetes container that cannot do the git fetch
. Because the container is only started when the build begins, I don't know when I have a chance to manually log into the container and inject my own key before the script fails.
We can add bitbucket.org and other popular git hosting sites to the ssh configure by default. I can look at that tomorrow as i think it should just be a case of adding entries to https://github.com/fabric8io/fabric8-devops/blob/master/jenkins/src/main/fabric8/jenkins-git-ssh-secret.yml
As for the GIT_URL, that should have been replaced with your bitbucket repo after the pipeline was selected from the fabric8 console. For now you should be able to edit the Jenkinsfile in the root of your repo and replace that property. We'll need to take a look at why this didn't happen automatically.
I have to admit I've not tried importing a project from GitHub or bitbucket recently and there have been some upgrades that could affect this. Hopefully it should be straight forward to resolve any issues now that folks are back from festive holidays. Once I'm at my laptop tomorrow I'll take a look.
On 2 Jan 2017, at 17:11, ElMoselYEE notifications@github.com wrote:
I'm able to get passed this issue by adding an entry in .ssh/known_hosts for bitbucket.org:
eval $(minikube docker-env) docker ps | grep jenkins-docker # record ID e.g. ea04a970d129 docker exec -it ea04a970d129 ssh-keyscan -t rsa bitbucket.org > ~/.ssh/known_hosts Now on to debug the next issue:
groovy.lang.MissingPropertyException: No such property: GIT_URL for class: WorkflowScript
Can I ask if I'm doing something non-standard or if everyone experiences issues setting up fabric8? From the videos it looked like it'd be quick to set up but it's honestly been a challenge and I haven't succeeded in anything yet, even setting up example project.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
I've attempted to add my SSH keys to the Secrets jenkins-git-ssh, jenkins-master-ssh, and jenkins-ssh-config, but I don't see any evidence those keys are being injected into the container jenkins-docker container. When I manually copy the same keys it seems to work (on that container only, however).
any update on this issue please ? I am facing the same.
I am also facing this problem on version 2.2.311 @unoriginalbanter, you should follow this issue too.
@rawlingsj when is the correct place in the process to "add entries to jenkins-git-ssh-secret"? I've been fiddling around with this for a while but still no success, maybe if there was an example of something similar being accomplished?
FWIW, I could workaround this issue by changing the provided Jenkinsfile:
on line: git GIT_URL
to:
git credentialsId: 'id-of-the-git-creds', url: '
Hi!
This workaround is quite dirty, but I've managed to make it work on fabric8 2.4.24. I'm using an external repo (Bitbucket Server) hosted on a private server. I've created a passphrase-less SSH key pair and authorize this identity on a bitbucket project.
Jenkins configuration Add a new credential of type SSH with the private key content in plain text [jenkins-url/credentials/store/system/domain/_/newCredentials]()
Fabric8 Kubernetes secrets
I use "default" team so change your team namespace acordingly.
Add both SSH key parts on the secret default/jenkins-git-ssh
.
Add this SSH config on secret default/jenkins-ssh-config
:
Host <git-repo-host>
Port <git-repo-port>
User git
IdentityFile /root/.ssh-git/ssh-key
StrictHostKeyChecking no
Add StrictHostKeyChecking
line only if you use a self-signed certificate.
JenkinsFile of project
In mavenNode
just before git
command add:
sh 'chmod 600 /root/.ssh-git/ssh-key'
I also took inspiration of this blog post.
We are kind of passing fabric8 for now, purely because of this issue. It was reported few months back :(
Has this issue been resolved? I was able to work around it pushing and pulling from the host machine of my minikube instance, directly into the fabric8 gogs repository. However, my team would prefer to pull from Bitbucket in the long haul.
I opened the issue but don't currently have Fabric installed to confirm if the above workaround works for me. I'll try this week to swing back around and give it another go.
Summary: I persistently receive "unable to find repository" errors and when looking at the logs, fabric8 has modified my original URL and replaced the host
bitbucket.org
withgogs
. I can see the repo has authenticated in my Dashboard, but the build fails, which tells me I'm doing something wrong but am really struggling to figure out what that is.Environment:
Steps to Reproduce:
Actual Result:
Expected Result:
Relevant Observations: