[JIRA] [git-client-plugin] (JENKINS-24368) Authentication failed for https://username@bitbucket.org/project/repository.git

25 views
Skip to first unread message

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

unread,
Jun 8, 2015, 8:26:02 AM6/8/15
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-24368
 
Re: Authentication failed for https://user...@bitbucket.org/project/repository.git
Credential based access to bitbucket repository works correctly.

  Embedded user name and password in the https URL does not work with  private repositories on  bitbucket  or GitHub (even using an access token that works from the command line) or GitLab .

Embedded user name and password in the https URL works with
 other providers (like google code)  public repos on bitbucket and GitHub and GitLab .
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

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

unread,
Jun 8, 2015, 8:26:02 AM6/8/15
to jenkinsc...@googlegroups.com

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

unread,
Jun 8, 2015, 8:29:01 AM6/8/15
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-24368
Credential based access to bitbucket repository works correctly.

Embedded user name and password in the https URL does not work with private repositories on bitbucket or GitHub (even using an access token that works from the command line) or GitLab.

Embedded user name and password in the https URL works with public repos on bitbucket and GitHub and GitLab.

Jenkins credential based https access to private and public repositories works as expected on bitbucket, GitHub, and GitLab.

scm_issue_link@java.net (JIRA)

unread,
Jul 25, 2015, 7:04:03 PM7/25/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Mark Waite
Path:
src/test/java/org/jenkinsci/plugins/gitclient/CredentialsTest.java
http://jenkins-ci.org/commit/git-client-plugin/ff9c219277531dcf0f18dccd6d8665118e1827a3
Log:
Add username/password support to CredentialsTest

Help test JENKINS-26757, JENKINS-24368 and JENKINS-28460.

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

unread,
Jul 25, 2015, 10:22:01 PM7/25/15
to jenkinsc...@googlegroups.com
Mark Waite resolved as Fixed
 

The change from Jacob Keller that is current available in a [git-client-plugin pre-release of 1.18.1](https://jenkins.ci.cloudbees.com/job/plugins/job/git-client-plugin/728/org.jenkins-ci.plugins$git-client/artifact/org.jenkins-ci.plugins/git-client/1.18.1-SNAPSHOT/git-client-1.18.1-SNAPSHOT.hpi) seems to resolve this for https URL's.

I was able to embed my username and password into an https URL to a private bitbucket repository and it cloned successfully without using the credentials system.

Change By: Mark Waite
Status: Open Resolved
Resolution: Fixed

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

unread,
Jul 25, 2015, 10:22:02 PM7/25/15
to jenkinsc...@googlegroups.com


I was able to embed my username and password into an https URL to a private bitbucket repository and it cloned successfully without using the credentials system.

flavio.donze@gmx.ch (JIRA)

unread,
Jul 29, 2015, 2:34:02 AM7/29/15
to jenkinsc...@googlegroups.com

Just updated to:
GIT client plugin: 1.18.1-SNAPSHOT (private-ff9c2192-jenkins)
GIT plugin: 2.4.0

Still getting the exception, slightly different stacktrace though:

ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:/Progra~2/Git/bin/git.exe -c core.askpass=true fetch --tags --progress https://user...@bitbucket.org/project/repository.git +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: fatal: Authentication failed for 'https://sc...@bitbucket.org/scodi/tools.git/'

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1605)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1368)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:300)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:486)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1003)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:129)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1284)
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:381)

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

unread,
Jul 29, 2015, 7:37:03 AM7/29/15
to jenkinsc...@googlegroups.com
Mark Waite reopened an issue
 

Thanks for checking. I had run that test interactively and thought it worked. An automated test is definitely working in my test harness. Unfortunately, when I just attempted the same thing from a fresh docker instance of Jenkins using https://username:pass...@bitbucket.org/username/private-repo.git, it failed. I then used the same repository URL from command line git and confirmed it works correctly.

The automated test must not be matching the real world closely enough. I'll explore further as time allows.

Change By: Mark Waite
Resolution: Fixed
Status: Resolved Reopened

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

unread,
Oct 8, 2015, 5:56:04 PM10/8/15
to jenkinsc...@googlegroups.com

jim.klo@sri.com (JIRA)

unread,
Jan 20, 2016, 8:53:02 PM1/20/16
to jenkinsc...@googlegroups.com
Jim Klo commented on Bug JENKINS-24368
 
Re: Authentication failed for https://user...@bitbucket.org/project/repository.git

I am having this same issue after modifying my password within the credentials file. I'm not able to perform any git authenticated action with that user/password combination.

I discovered on my OS X Jenkins server that:

  • the temporary git<timestamp>.credentials file that extracted to the user's private temp (/var/folders/...) contained both old/new credentials!
  • after removing all stored user credentials, and then creating a new credential user, if I used Safari 9 as the browser - Junk would be stored in the password field, if I use Chrome the password is saved correctly.
  • Once I had the correct password showing up in the git*.credentials file; It still would not authenticate, however I noticed that the password was NOT correctly URL Encoded; chars ' {' and '}

    ' that are part of the password were not encoded. If I use unencoded versions of those characters in Repository URL [ https://user:passwordcontaining{}@server/foo/bar.git ] I get the authentication failure, however if I URL encode [ https://user:passwordcontaining%7B%7D@server/foo/bar.git ] everything works.

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

unread,
Dec 10, 2018, 1:16:02 PM12/10/18
to jenkinsc...@googlegroups.com
Change By: Mark Waite
Status: Reopened Open
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages