[JIRA] [git-plugin] (JENKINS-31429) Cannot fetch git repo with credentials

3 views
Skip to first unread message

jan.walther@phpperformance.de (JIRA)

unread,
Nov 5, 2015, 4:44:05 PM11/5/15
to jenkinsc...@googlegroups.com
Jan Walther created an issue
 
Jenkins / Bug JENKINS-31429
Cannot fetch git repo with credentials
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 05/Nov/15 9:43 PM
Environment: Jenkins 1.636
Git Plugin 2.4.0
Priority: Major Major
Reporter: Jan Walther

I want to connect a remote git repository with jenkins.
In the console cloning the repository works fine when I login as user jenkins.

But in jenkins this does not work although I entered the credentials.
Gestartet durch Benutzer anonymous
Baue in Arbeitsbereich /var/lib/jenkins/jobs/invest/workspace
No JDK named 'null' found
No JDK named 'null' found
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url ssh://daryl:lys...@192.168.178.20/volume1/git/invest # timeout=10
Fetching upstream changes from ssh://da...@192.168.178.20/volume1/git/invest
> git --version # timeout=10
> git -c core.askpass=true fetch --tags --progress ssh://da...@192.168.178.20/volume1/git/invest +refs/heads/:refs/remotes/origin/
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from ssh://da...@192.168.178.20/volume1/git/invest
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:763)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1275)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress ssh://da...@192.168.178.20/volume1/git/invest +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)
... 11 more
ERROR: null
Finished: FAILURE

I only found a lot of tips about using SSH keys but actually I want to stay with the credentials.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

jan.walther@phpperformance.de (JIRA)

unread,
Nov 5, 2015, 4:45:03 PM11/5/15
to jenkinsc...@googlegroups.com
Jan Walther updated an issue
Change By: Jan Walther
I want to connect a remote git repository with jenkins.
In the console cloning the repository works fine when I login as user jenkins.  There I am asked for the password and after typing it everything works fine.

But in jenkins this does not work although I entered the credentials.
Gestartet durch Benutzer anonymous
Baue in Arbeitsbereich /var/lib/jenkins/jobs/invest/workspace
No JDK named 'null' found
No JDK named 'null' found
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://daryl:lys...@192.168.178.20/volume1/git/invest # timeout=10
Fetching upstream changes from ssh://da...@192.168.178.20/volume1/git/invest
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress ssh://da...@192.168.178.20/volume1/git/invest +refs/heads/*:refs/remotes/origin/*

ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from ssh://da...@192.168.178.20/volume1/git/invest
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:763)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1275)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress ssh://da...@192.168.178.20/volume1/git/invest +refs/heads/*:refs/remotes/origin/*" returned status code 128:

stdout: 
stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1388)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)
... 11 more
ERROR: null
Finished: FAILURE

I only found a lot of tips about using SSH keys but actually I want to stay with the credentials.

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 5, 2015, 5:20:02 PM11/5/15
to jenkinsc...@googlegroups.com
Mark Waite resolved as Not A Defect
 

Please use the Jenkins user mailing list for configuration and support related questions. There are many more people monitoring the mailing list than are monitoring the git plugin bug queue.

Since you're specifying the ssh protocol, I'm not aware of any way to embed user name and password into the ssh protocol URL. Refer to this stackoverflow article for more details on ssh protocol and git repositories.

My attempts to use a Jenkins managed username/password credential with the ssh protocol have failed. I regularly use a Jenkins managed private key with the ssh protocol successfully.

My attempts to use a Jenkins managed username/password credential with the https protocol worked successfully in my most recent testing.

Change By: Mark Waite
Status: Open Resolved
Resolution: Not A Defect

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 22, 2019, 9:35:11 PM10/22/19
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Not A Defect
Change By: Mark Waite
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages