Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75216

Unable to get password from credentials during git fetch using App password

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None

      Sometimes we are getting following error:

      11:27:16  Branch indexing
      11:27:17  Obtained Jenkinsfile-build from 9c9734aad213a0fc68b9ba54c1436e0b86cf11ad
      11:27:17  [Pipeline] Start of Pipeline
      11:27:18  [Pipeline] node
      11:27:18  Running on FleetCloud i-090b7c41e5d8c3f17 in /var/jenkins/workspace/*****-frontend_development
      11:27:18  [Pipeline] {
      11:27:19  [Pipeline] stage
      11:27:19  [Pipeline] { (Declarative: Checkout SCM)
      11:27:19  [Pipeline] checkout
      11:27:19  The recommended git tool is: NONE
      11:27:20  using credential 95d0461f-5b1e-44d1-980d-b22d6f44ab11
      11:27:20  Cloning the remote Git repository
      11:27:20  Cloning with configured refspecs honoured and without tags
      11:27:20  ERROR: Error cloning remote repo 'origin'
      11:27:20  hudson.plugins.git.GitException: Command "git fetch --no-tags --force --progress -- https://bitbucket.org/*****/*******-frontend.git +refs/heads/development:refs/remotes/origin/development +refs/heads/*:refs/remotes/origin/*" returned status code 128:
      11:27:20  stdout: 
      11:27:20  stderr: fatal: unable to get password from user
      11:27:20  
      11:27:20      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2848)
      11:27:20      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2184)
      11:27:20      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)
      11:27:20      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:877)
      11:27:20      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:170)
      11:27:20      at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
      11:27:20      at hudson.remoting.UserRequest.perform(UserRequest.java:225)
      11:27:20      at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      11:27:20      at hudson.remoting.Request$2.run(Request.java:391)
      11:27:20      at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:81)
      11:27:20      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      11:27:20      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      11:27:20      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      11:27:20      at java.base/java.lang.Thread.run(Thread.java:840)
      11:27:20      Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to i-090b7c41e5d8c3f17
      11:27:20          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1923)
      11:27:20          at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:384)
      11:27:20          at hudson.remoting.Channel.call(Channel.java:1112)
      11:27:20          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:153)
      11:27:20          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:27:20          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      11:27:20          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      11:27:20          at java.base/java.lang.reflect.Method.invoke(Method.java:569)
      11:27:20          at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:138)
      11:27:20          at PluginClassLoader for git-client/jdk.proxy48/jdk.proxy48.$Proxy168.execute(Unknown Source)
      11:27:20          at PluginClassLoader for git//hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1221)
      11:27:20          at PluginClassLoader for git//hudson.plugins.git.GitSCM._checkout(GitSCM.java:1311)
      11:27:20          at PluginClassLoader for git//hudson.plugins.git.GitSCM.checkout(GitSCM.java:1278)
      11:27:20          at PluginClassLoader for workflow-scm-step//org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:136)
      11:27:20          at PluginClassLoader for workflow-scm-step//org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:101)
      11:27:20          at PluginClassLoader for workflow-scm-step//org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:88)
      11:27:20          at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      11:27:20          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
      11:27:20          ... 4 more
      11:27:20  ERROR: Error cloning remote repo 'origin'

      This seems random, because sometimes there builds goes throgh without problem:

      09:02:07  Branch event
      09:02:07  Obtained Jenkinsfile-build from 06ae15e14305b8fac44ff2e3245dfa5da735ea6c
      09:02:08  [Pipeline] Start of Pipeline
      09:02:09  [Pipeline] node
      09:02:09  Running on FleetCloud i-0b7d7bf34fabae92c in /var/jenkins/workspace/****_development
      09:02:09  [Pipeline] {
      09:02:10  [Pipeline] stage
      09:02:10  [Pipeline] { (Declarative: Checkout SCM)
      09:02:10  [Pipeline] checkout
      09:02:10  The recommended git tool is: NONE
      09:02:10  using credential 95d0461f-5b1e-44d1-980d-b22d6f44ab11
      09:02:10  Cloning the remote Git repository
      09:02:10  Cloning with configured refspecs honoured and without tags
      09:02:10  Cloning repository https://bitbucket.org/*****/****-frontend.git
      09:02:10   > git init /var/jenkins/workspace/******_development # timeout=10
      09:02:10  Fetching upstream changes from https://bitbucket.org/****/*****-frontend.git
      09:02:10   > git --version # timeout=10
      09:02:10   > git --version # 'git version 2.47.1'
      09:02:10  using GIT_ASKPASS to set credentials Bitbucket Insys
      09:02:10   > git fetch --no-tags --force --progress -- https://bitbucket.org/*****/*****-frontend.git +refs/heads/development:refs/remotes/origin/development +refs/heads/*:refs/remotes/origin/* # timeout=10
      09:02:41  Avoid second fetch
      09:02:41  Checking out Revision ******* (development)
      09:02:42  Commit message: "Merged in ******** (pull request #15684)"
      09:02:41   > git config remote.origin.url https://bitbucket.org/******/*****-frontend.git # timeout=10
      09:02:41   > git config --add remote.origin.fetch +refs/heads/development:refs/remotes/origin/development # timeout=10
      09:02:41   > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
      09:02:41   > git config core.sparsecheckout # timeout=10
      09:02:41   > git checkout -f ****** # timeout=10
      09:02:42   > git rev-list --no-walk ****** # timeout=10
      09:02:42  [Bitbucket] Notifying commit build result

      This is critical issue for us.

       

       

          [JENKINS-75216] Unable to get password from credentials during git fetch using App password

          Pay Bas added a comment - - edited

          Haven't seen this yet. But we almost always use the "Checkout over SSH" trait, so this might be a HTTPS-only thing, judging from the "using GIT_ASKPASS to set credentials" message.

          Pay Bas added a comment - - edited Haven't seen this yet. But we almost always use the "Checkout over SSH" trait, so this might be a HTTPS-only thing, judging from the "using GIT_ASKPASS to set credentials" message.

          Nikolas Falco added a comment -

          Please provide the kind of authentication are you using, if server or cloud

          Nikolas Falco added a comment - Please provide the kind of authentication are you using, if server or cloud

          Krzysztof added a comment -

          nfalco we are using Bitbucket Cloud

          Krzysztof added a comment - nfalco we are using Bitbucket Cloud

          Nikolas Falco added a comment -

          Which kind of authentication are you using? App password? OAuth2? Token? ....

          Nikolas Falco added a comment - Which kind of authentication are you using? App password? OAuth2? Token? ....

          Krzysztof added a comment - - edited

          nfalco we are using app passwords and https checkout/branch scanning

          Krzysztof added a comment - - edited nfalco we are using app passwords and https checkout/branch scanning

          Nikolas Falco added a comment -

          Where is defined the appPassword credentials? Globally in jenkins->Manage->Credentials or in the multibranch/organization folder level?
          I had try to replicate the issue without success:

          Obtained Jenkinsfile from 8e64830465435886f59d5512d9de7af969ccfd40
          Loading library devops@test
          Attempting to resolve test from remote references...
           > git.exe --version # timeout=10
           > git --version # 'git version 2.39.2.windows.1'
          using GIT_ASKPASS to set credentials appPassword
           > git.exe ls-remote -h -- https://bitbucket.org/acme/***-pipelines.git # timeout=10
          Found match: refs/heads/test revision 3f0bde1a9bca5ff05b59df8c6165d055070bce65
          The recommended git tool is: NONE
          using credential appPassword
           > git.exe rev-parse --resolve-git-dir D:\git\bitbucket-branch-source-plugin\work\workspace\backend_feature_test@libs\6784bf14cf7a1e204dc7232265826fbeb01362a49184e49529e913035840fddf\.git # timeout=10
          Fetching changes from the remote Git repository
           > git.exe config remote.origin.url https://bitbucket.org/acme/***-pipelines.git # timeout=10
          Fetching without tags
          Fetching upstream changes from https://bitbucket.org/acme/***-pipelines.git
           > git.exe --version # timeout=10
           > git --version # 'git version 2.39.2.windows.1'
          using GIT_ASKPASS to set credentials appPassword
           > git.exe fetch --no-tags --force --progress -- https://bitbucket.org/acme/***-pipelines.git +refs/heads/*:refs/remotes/origin/* # timeout=10
          Checking out Revision 3f0bde1a9bca5ff05b59df8c6165d055070bce65 (test)
           > git.exe config core.sparsecheckout # timeout=10
           > git.exe checkout -f 3f0bde1a9bca5ff05b59df8c6165d055070bce65 # timeout=10
          Commit message: "test"
           > git.exe rev-list --no-walk 3f0bde1a9bca5ff05b59df8c6165d055070bce65 # timeout=10
          [Bitbucket] Notifying commit build result
          Can not determine Jenkins root URL or Jenkins URL is not a valid URL regarding Bitbucket API. Commit status notifications are disabled until a root URL is configured in Jenkins global configuration. 
          IllegalStateException: Could not determine Jenkins URL.
          [Pipeline] Start of Pipeline
          [Pipeline] node
          Running on Jenkins in D:\git\bitbucket-branch-source-plugin\work\workspace\backend_feature_test
          [Pipeline] {
          [Pipeline] stage
          [Pipeline] { (Build)
          [Pipeline] stage
          [Pipeline] { (Checkout)
          [Pipeline] checkout
          The recommended git tool is: NONE
          using credential appPassword
           > git.exe rev-parse --resolve-git-dir D:\git\bitbucket-branch-source-plugin\work\workspace\backend_feature_test\.git # timeout=10
          Fetching changes from the remote Git repository
           > git.exe config remote.origin.url https://bitbucket.org/acme/***-backend.git # timeout=10
          Fetching without tags
          Fetching upstream changes from https://bitbucket.org/acme/***-backend.git
           > git.exe --version # timeout=10
           > git --version # 'git version 2.39.2.windows.1'
          using GIT_ASKPASS to set credentials appPassword
           > git.exe fetch --no-tags --force --progress -- https://bitbucket.org/acme/***-backend.git +refs/heads/feature/test:refs/remotes/origin/feature/test # timeout=10
          Checking out Revision 8e64830465435886f59d5512d9de7af969ccfd40 (feature/test)
           > git.exe config core.sparsecheckout # timeout=10
           > git.exe checkout -f 8e64830465435886f59d5512d9de7af969ccfd40 # timeout=10
          Commit message: "Third commit"
           > git.exe rev-list --no-walk 8e64830465435886f59d5512d9de7af969ccfd40 # timeout=10
          

          I use both app password to download pipeline library and to clone repository and use multiple run.

          Did you try also to perform a "Scan Organization Folder Now" to update repository configuration?

          Nikolas Falco added a comment - Where is defined the appPassword credentials? Globally in jenkins->Manage->Credentials or in the multibranch/organization folder level? I had try to replicate the issue without success: Obtained Jenkinsfile from 8e64830465435886f59d5512d9de7af969ccfd40 Loading library devops@test Attempting to resolve test from remote references... > git.exe --version # timeout=10 > git --version # 'git version 2.39.2.windows.1' using GIT_ASKPASS to set credentials appPassword > git.exe ls-remote -h -- https: //bitbucket.org/acme/***-pipelines.git # timeout=10 Found match: refs/heads/test revision 3f0bde1a9bca5ff05b59df8c6165d055070bce65 The recommended git tool is: NONE using credential appPassword > git.exe rev-parse --resolve-git-dir D:\git\bitbucket-branch-source-plugin\work\workspace\backend_feature_test@libs\6784bf14cf7a1e204dc7232265826fbeb01362a49184e49529e913035840fddf\.git # timeout=10 Fetching changes from the remote Git repository > git.exe config remote.origin.url https: //bitbucket.org/acme/***-pipelines.git # timeout=10 Fetching without tags Fetching upstream changes from https: //bitbucket.org/acme/***-pipelines.git > git.exe --version # timeout=10 > git --version # 'git version 2.39.2.windows.1' using GIT_ASKPASS to set credentials appPassword > git.exe fetch --no-tags --force --progress -- https: //bitbucket.org/acme/***-pipelines.git +refs/heads/*:refs/remotes/origin/* # timeout=10 Checking out Revision 3f0bde1a9bca5ff05b59df8c6165d055070bce65 (test) > git.exe config core.sparsecheckout # timeout=10 > git.exe checkout -f 3f0bde1a9bca5ff05b59df8c6165d055070bce65 # timeout=10 Commit message: "test" > git.exe rev-list --no-walk 3f0bde1a9bca5ff05b59df8c6165d055070bce65 # timeout=10 [Bitbucket] Notifying commit build result Can not determine Jenkins root URL or Jenkins URL is not a valid URL regarding Bitbucket API. Commit status notifications are disabled until a root URL is configured in Jenkins global configuration. IllegalStateException: Could not determine Jenkins URL. [Pipeline] Start of Pipeline [Pipeline] node Running on Jenkins in D:\git\bitbucket-branch-source-plugin\work\workspace\backend_feature_test [Pipeline] { [Pipeline] stage [Pipeline] { (Build) [Pipeline] stage [Pipeline] { (Checkout) [Pipeline] checkout The recommended git tool is: NONE using credential appPassword > git.exe rev-parse --resolve-git-dir D:\git\bitbucket-branch-source-plugin\work\workspace\backend_feature_test\.git # timeout=10 Fetching changes from the remote Git repository > git.exe config remote.origin.url https: //bitbucket.org/acme/***-backend.git # timeout=10 Fetching without tags Fetching upstream changes from https: //bitbucket.org/acme/***-backend.git > git.exe --version # timeout=10 > git --version # 'git version 2.39.2.windows.1' using GIT_ASKPASS to set credentials appPassword > git.exe fetch --no-tags --force --progress -- https: //bitbucket.org/acme/***-backend.git +refs/heads/feature/test:refs/remotes/origin/feature/test # timeout=10 Checking out Revision 8e64830465435886f59d5512d9de7af969ccfd40 (feature/test) > git.exe config core.sparsecheckout # timeout=10 > git.exe checkout -f 8e64830465435886f59d5512d9de7af969ccfd40 # timeout=10 Commit message: "Third commit" > git.exe rev-list --no-walk 8e64830465435886f59d5512d9de7af969ccfd40 # timeout=10 I use both app password to download pipeline library and to clone repository and use multiple run. Did you try also to perform a "Scan Organization Folder Now" to update repository configuration?

          Nikolas Falco added a comment - - edited

          markwaite is there a person dedicated to remove spam messages like https://issues.jenkins.io/browse/JENKINS-75216?focusedId=452238&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-452238 ?

          there is not button to signal these offending/spam comment

          Nikolas Falco added a comment - - edited markwaite is there a person dedicated to remove spam messages like https://issues.jenkins.io/browse/JENKINS-75216?focusedId=452238&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-452238 ? there is not button to signal these offending/spam comment

          Mark Waite added a comment -

          Thanks for reporting the spam comment and thanks for your great efforts on the Bitbucket branch source plugin. Much appreciated.

          I remove spam comments when I detect them. If I miss one, the spam comment can always be reported to the Jenkins help desk where a member of the Jenkins infra team will remove them.

          Mark Waite added a comment - Thanks for reporting the spam comment and thanks for your great efforts on the Bitbucket branch source plugin. Much appreciated. I remove spam comments when I detect them. If I miss one, the spam comment can always be reported to the Jenkins help desk where a member of the Jenkins infra team will remove them.

          Nikolas Falco added a comment -

          Thanks a lot Mark!

          Nikolas Falco added a comment - Thanks a lot Mark!

            Unassigned Unassigned
            kgosciniak Krzysztof
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: