Authentication problem: Error fetching remote repo 'origin'

2,211 views
Skip to first unread message

Emma Lilliestam

unread,
Dec 20, 2016, 8:12:26 AM12/20/16
to jenkins...@googlegroups.com
Hi, 
I'm trying to set up a project on a Jenkins server running on an aws machine, building from a private bitbucket repo. Everything works fine if I use a public repo. I'm using username+password authentication and have put those parameters in both at credentials and in the URL. 

I've been googling the issue and I have not found anyone who has had a similar problem with a setup like this one. I hope this is a really simple problem, but I fear it's not. 

I notice that the log outputs the password in https://USERNAME:PASS...@bitbucket.org/***/***.git as another than the one that I have put in there.

Building in workspace /var/lib/jenkins/workspace/Jenkins-test
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://USERNAME:PA...@bitbucket.org/***/***.git # timeout=10
Fetching upstream changes from https://*****@bitbucket.org/****/***.git
 > git --version # timeout=10
 > git fetch --tags --progress https://****@bitbucket.org/***/***.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://****@bitbucket.org/Ewahome/***.git
        at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)
        at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
        at hudson.scm.SCM.checkout(SCM.java:495)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
        at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
        at hudson.model.Run.execute(Run.java:1729)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:404)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://****@bitbucket.org/****/**.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
fatal: Authentication failed for 'https://******@bitbucket.org/****/****.git/'

        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
        at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:801)
        ... 11 more
ERROR: null
Finished: FAILURE

Best regards,
E

Mark Waite

unread,
Dec 21, 2016, 10:52:47 AM12/21/16
to jenkins...@googlegroups.com
I think you will be better served by using the URL without embedding the credentials into the URL, then assign a Jenkins credential in that job definition.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAL1iz6%2BR_%3DHAXLFYaDkCNy39-XsxRVcHpOnMKG1jhRYJz6usuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages