Jenkins stuck at password when starting any build. Jenkins on docker and repository at container host

Hi. I’m new to jenkins and it seems there is some kind of issue with the connecting to my repository which prevent to start the building of a simple git repository. Help would be very much appreciated.

I’m running jenkins in a docker container and the repository is at the host machine of the docker container. The repository is a git repo with only a python script to print “hello”.

When I make a Multibranch Pipeline and save, the execution timeouts after 10 minutes and I get:

hudson.plugins.git.GitException: Command "git ls-remote --symref -- user@10.2.5.51:/home/user/testjenkins/" returned status code 128:
stdout: 
stderr: fatal: Could not read from remote repository.

I executed the command in a terminal inside the container and it worked fine.

Then I proceeded to check “docker logs“ and I could see it was asking if trusting the host for shh.

I started another time the command line inside the docker container and connected through ssh to the host and accepted the host as trusted.

I went to “Scan Multibranch Pipeline now” and again it times out.

Currently “docker logs” shows me the following lines for every time I do the scan:

user@10.2.5.51s password: connecting (yes/no/[fingerprint])?
user@10.2.5.51s password:

Did I forgot to configure something, I made up the credentials bad? Maybe another problem I’m not aware?

The repository is configured like this:

user@10.2.5.51:/home/user/testjenkins/

and the credentials used is username and password.

The docker image is: jenkins/jenkins:2.553

I also tried with a freestyle project and ended up with the same results.

Any help is more than welcome!

TL;DR

When trying to build a project it ends up in failure because there is no connection to the repository. It seems the execution waiting for a password internally and gets stuck there even if credentials are provided.

Thanks!

I think I got my answer myself exploring about the git plugin.
As per today it seems the git plugin only accepts using SSH privatekey credential for ssh connections.

When the remote repository is accessed with the ssh protocol, the plugin requires an ssh private key credential. Other credential types will not work with the ssh protocol.

The issue must be that I’m using username and password credential.

I hope at least this post can help other people who have a similar issue.

Thanks to the people who read this and tried to help!