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 On Tue, Dec 20, 2016 at 6:12 AM Emma Lilliestam <[email protected]> wrote: > 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:[email protected]/***/***.git > <https://login.mailcloud.dk/owa/redir.aspx?SURL=T8Cbf2LUZR4_a2QPJcoE4PRGWUc7akysY6ANOsZ1sTuMjIaw2SjUCGgAdAB0AHAAcwA6AC8ALwBVAFMARQBSAE4AQQBNAEUAOgBQAEEAUwBTAFcATwBSAEQAQABiAGkAdABiAHUAYwBrAGUAdAAuAG8AcgBnAC8AKgAqACoALwAqACoAKgAuAGcAaQB0AA..&URL=https%3a%2f%2fUSERNAME%3aPASSWORD%40bitbucket.org%2f***%2f***.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:[email protected]/***/***.git > <https://login.mailcloud.dk/owa/redir.aspx?SURL=f6RtI05oL0gFX542GsraL0aY62M5C0MDZLLfJKr6hpvr7Yiw2SjUCGgAdAB0AHAAcwA6AC8ALwBVAFMARQBSAE4AQQBNAEUAOgBQAEEAUwBTAEAAYgBpAHQAYgB1AGMAawBlAHQALgBvAHIAZwAvACoAKgAqAC8AKgAqACoALgBnAGkAdAA.&URL=https%3a%2f%2fUSERNAME%3aPASS%40bitbucket.org%2f***%2f***.git> > # > timeout=10 > Fetching upstream changes from https://*****@bitbucket.org/****/***.git > <https://login.mailcloud.dk/owa/redir.aspx?SURL=LRmNXJLiujmU_KuCKn46ffRgWGfaL4D7sB936qt4mnvr7Yiw2SjUCGgAdAB0AHAAcwA6AC8ALwAqACoAKgAqACoAQABiAGkAdABiAHUAYwBrAGUAdAAuAG8AcgBnAC8AKgAqACoAKgAvACoAKgAqAC4AZwBpAHQA&URL=https%3a%2f%2f*****%40bitbucket.org%2f****%2f***.git> > > git --version # timeout=10 > > git fetch --tags --progress https://****@bitbucket.org/***/***.git > <https://login.mailcloud.dk/owa/redir.aspx?SURL=leDb4atZM-FbQyEw_Hv6LEEEqvJnVeyF7IA661Xt_tzr7Yiw2SjUCGgAdAB0AHAAcwA6AC8ALwAqACoAKgAqAEAAYgBpAHQAYgB1AGMAawBlAHQALgBvAHIAZwAvACoAKgAqAC8AKgAqACoALgBnAGkAdAA.&URL=https%3a%2f%2f****%40bitbucket.org%2f***%2f***.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 > <https://login.mailcloud.dk/owa/redir.aspx?SURL=-Msf2bkv7cgBzqGRHgFZXzBLYs2um-k9k6ZaqdbCRhjr7Yiw2SjUCGgAdAB0AHAAcwA6AC8ALwAqACoAKgAqAEAAYgBpAHQAYgB1AGMAawBlAHQALgBvAHIAZwAvAEUAdwBhAGgAbwBtAGUALwAqACoAKgAuAGcAaQB0AA..&URL=https%3a%2f%2f****%40bitbucket.org%2fEwahome%2f***.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 > <https://login.mailcloud.dk/owa/redir.aspx?SURL=QZh6ouVDXJt-oVbTvK-xf95xfyxgt3Zk4iPc8hOm9nPr7Yiw2SjUCGgAdAB0AHAAcwA6AC8ALwAqACoAKgAqAEAAYgBpAHQAYgB1AGMAawBlAHQALgBvAHIAZwAvACoAKgAqACoALwAqACoALgBnAGkAdAA.&URL=https%3a%2f%2f****%40bitbucket.org%2f****%2f**.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/ > <https://login.mailcloud.dk/owa/redir.aspx?SURL=luJ7FaWw5j2WSejWJcttRuG_JsReiZBYsKA-puR2pK_r7Yiw2SjUCGgAdAB0AHAAcwA6AC8ALwAqACoAKgAqACoAKgBAAGIAaQB0AGIAdQBjAGsAZQB0AC4AbwByAGcALwAqACoAKgAqAC8AKgAqACoAKgAuAGcAaQB0AC8A&URL=https%3a%2f%2f******%40bitbucket.org%2f****%2f****.git%2f> > ' > > 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 > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/CAL1iz6%2BR_%3DHAXLFYaDkCNy39-XsxRVcHpOnMKG1jhRYJz6usuQ%40mail.gmail.com > <https://groups.google.com/d/msgid/jenkinsci-users/CAL1iz6%2BR_%3DHAXLFYaDkCNy39-XsxRVcHpOnMKG1jhRYJz6usuQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHnnH8%3DVvrSRjtuRtfN8r%3DVizdjRjz6HEb5cJPOK8Xm0Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
