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

Git Username And Password does not resolve, Github app

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • git-plugin
    • None
    • 5.2.2

      I do not know if git-plugin is the problem but here we go. In a Scripted Pipeline i use withCredentials and gitUsernamePassword. 

      I use exactly the same credentials to clone repositories with in the checkout step as when using withCredentials in the pipeline.

      Regular repository clone

      stage('Clone Repositories') {
          steps {
              checkout([$class: 'GitSCM', 
                  branches: [[name: '*/master']], 
                  doGenerateSubmoduleConfigurations: false, 
                  submoduleCfg: [], 
                  userRemoteConfigs: [
                                          [
                                              credentialsId: '{GithubAppCredentials}', 
                                              url: 'https://github.com/org/repo.git', 
                                          ]
                                      ]
              ])
          }
      }
      

       

      Using withCredentials and gitUsernamePassword

      stage('withCredentials clone') {
           steps {
               withCredentials([
                   gitUsernamePassword(credentialsId: '{GithubAppCredentials}')
               ]) {
                   powershell '''
                   $env:GIT_TRACE=1
                   git clone https://github.com/HIABCS/SpaceX7Tests.git
                   '''
               } 
          }
       }
      

       

      8:18:58  06:18:57.325363 git.c:463               trace: built-in: git clone https://github.com/org/repo.git
      08:18:58  06:18:57.349442 run-command.c:659       trace: run_command: git remote-https origin https://github.com/org/repo.git
      08:18:58  Cloning into 'Tests'...
      08:18:58  06:18:57.391351 exec-cmd.c:244          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
      08:18:58  06:18:57.392351 git.c:749               trace: exec: git-remote-https origin https://github.com/org/repo.git
      08:18:58  06:18:57.393354 run-command.c:659       trace: run_command: git-remote-https origin https://github.com/org/repo.git
      08:18:58  06:18:57.449356 exec-cmd.c:244          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
      08:18:58  06:18:58.068357 run-command.c:659       trace: run_command: 'git credential-manager get'
      08:18:58  06:18:58.144354 exec-cmd.c:244          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
      08:18:58  06:18:58.145356 git.c:749               trace: exec: git-credential-manager get
      08:18:58  06:18:58.145356 run-command.c:659       trace: run_command: git-credential-manager get
      08:18:58  06:18:58.281350 exec-cmd.c:244          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
      08:18:58  06:18:58.285351 git.c:463               trace: built-in: git config --null --list
      08:18:58  fatal: Unable to persist credentials with the 'wincredman' credential store.
      08:18:58  See https://aka.ms/gcm/credstores for more information.
      08:18:58  06:18:58.497204 run-command.c:659       trace: run_command: 
      08:18:58  **** 'Username for '\''https://github.com'\'': '
      08:18:58  The syntax of the command is incorrect.
      08:18:58  06:18:58.559212 run-command.c:659       trace: run_command: 
      08:18:58  **** 'Password for '\''https://github.com'\'': '
      08:18:58  The syntax of the command is incorrect.
      08:18:58  error: unable to read askpass response from ****
      08:18:58  06:18:58.604191 run-command.c:659       trace: run_command: bash -c 'cat >/dev/tty && read -r -s line </dev/tty && echo "$line" && echo >/dev/tty'
      08:18:58  bash: line 1: /dev/tty: No such device or address
      08:18:58  error: failed to execute prompt script (exit code 1)
      08:18:58  fatal: could not read Password for 'https://github.com': No such file or directory
      

      As i run SSH to a windows machine i cannot use credential store.
      And even when removing credential store it still failes just like this.

      I also tried to run it in bat instead of powershell but the same git error appears.

          [JENKINS-72044] Git Username And Password does not resolve, Github app

          Mark Waite added a comment -

          Are you sure that the credential identified as GitHubAppCredential is a username / password credential type and not some other credential type?

          Mark Waite added a comment - Are you sure that the credential identified as GitHubAppCredential is a username / password credential type and not some other credential type?

          Elias added a comment -

          I'm not 1000% sure.

          I use the precisely the same credentials when i go and download the original git repository.

          Im using the Github App credentials, see the following blog.
          https://www.jenkins.io/blog/2020/04/16/github-app-authentication/

               withCredentials([usernamePassword(credentialsId: 'githubapp-jenkins',
                                                    usernameVariable: 'GITHUB_APP',
                                                    passwordVariable: 'GITHUB_ACCESS_TOKEN')]) {
                   **Call github api**
               }
          
          

          So it seems that the GITHUB_APP and GITHUB_ACCESS_TOKEN should be possible to send in.
          I had a previous successful build for a couple of months ago.

          The log has this information:

          [Pipeline] { (Build)
          [Pipeline] withCredentials
          15:05:22  Masking supported pattern matches of %GIT_USERNAME% or %GIT_PASSWORD% or %GIT_ASKPASS% or %SW_PASSWORD%
          [Pipeline] {
          [Pipeline] bat
          

          But i both updated Jenkins version and Plugins since then. And i'm sorry to say i do not have a backup from that point in time.

          Elias added a comment - I'm not 1000% sure. I use the precisely the same credentials when i go and download the original git repository. Im using the Github App credentials, see the following blog. https://www.jenkins.io/blog/2020/04/16/github-app-authentication/ withCredentials([usernamePassword(credentialsId: 'githubapp-jenkins' , usernameVariable: 'GITHUB_APP' , passwordVariable: 'GITHUB_ACCESS_TOKEN' )]) { **Call github api** } So it seems that the GITHUB_APP and GITHUB_ACCESS_TOKEN should be possible to send in. I had a previous successful build for a couple of months ago. The log has this information: [Pipeline] { (Build) [Pipeline] withCredentials 15:05:22 Masking supported pattern matches of %GIT_USERNAME% or %GIT_PASSWORD% or %GIT_ASKPASS% or %SW_PASSWORD% [Pipeline] { [Pipeline] bat But i both updated Jenkins version and Plugins since then. And i'm sorry to say i do not have a backup from that point in time.

          Elias added a comment - - edited

          markewaite 
          So, i went back and found a backup from 20 august.
          Tried my pipeline and there it works great.

          Reponse

          [Pipeline] withCredentials
          13:38:15  Masking supported pattern matches of %GIT_USERNAME% or %GIT_PASSWORD% or %GIT_ASKPASS% or %SW_PASSWORD%
          [Pipeline] {
          [Pipeline] powershell
          13:38:20  test
          13:38:20  ****
          13:38:21  powershell.exe : 11:38:20.690924 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
          13:38:21  At C:\tmp\jenkins-7a4d4d44\workspace\project@tmp\durable-149d9f6c\powershellWrapper.ps1:3 char:1
          13:38:21  + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
          13:38:21  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          13:38:21      + CategoryInfo          : NotSpecified: (11:38:20.690924...Git/mingw64/bin:String) [], RemoteException
          13:38:21      + FullyQualifiedErrorId : NativeCommandError
          13:38:21   
          13:38:21  11:38:20.705908 git.c:462               trace: built-in: git clone https://github.com/org/repo.git
          13:38:21  11:38:20.731913 run-command.c:661       trace: run_command: git remote-https origin https://github.com/org/repo.git
          13:38:21  Cloning into 'Tests'...
          13:38:21  11:38:20.779906 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
          13:38:21  11:38:20.782906 git.c:748               trace: exec: git-remote-https origin https://github.com/org/repo.git
          13:38:21  11:38:20.782906 run-command.c:661       trace: run_command: git-remote-https origin https://github.com/org/repo.git
          13:38:21  11:38:20.811906 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
          13:38:21  11:38:21.358897 run-command.c:661       trace: run_command: 
          13:38:21  **** 'Username for '\''https://github.com'\'': '
          13:38:21  11:38:21.417904 run-command.c:661       trace: run_command: 
          13:38:21  **** 'Password for '\''https://****@github.com'\'': '
          13:38:22  11:38:22.455648 run-command.c:661       trace: run_command: git index-pack --stdin --fix-thin '--keep=fetch-pack 1356 on EC2AMAZ-B1QKLUV' --check-self-contained-and-connected
          13:38:22  11:38:22.473644 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
          13:38:22  11:38:22.476648 git.c:462               trace: built-in: git index-pack --stdin --fix-thin '--keep=fetch-pack 1356 on EC2AMAZ-B1QKLUV' --check-self-contained-and-connected
          13:38:27  11:38:27.376885 run-command.c:661       trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs
          13:38:27  11:38:27.405853 exec-cmd.c:243          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
          13:38:27  11:38:27.409882 git.c:462               trace: built-in: git rev-list --objects --stdin --not --all --quiet --alternate-refs

          Jenkins 2.395

          Plugins:
          Popper.js 2 API Plugin (popper2-api): 2.11.6-2
          Multiple SCMs plugin (multiple-scms): 0.8
          Folders Plugin (cloudbees-folder): 6.815.v0dd5a_cb_40e0e
          Workspace Cleanup Plugin (ws-cleanup): 0.45
          Durable Task Plugin (durable-task): 507.v050055d0cb_dd
          Plain Credentials Plugin (plain-credentials): 143.v1b_df8b_d3b_e48
          Common API for Blue Ocean (blueocean-commons): 1.27.4
          EC2 Fleet Jenkins Plugin (ec2-fleet): 2.6.0
          Pipeline implementation for Blue Ocean (blueocean-pipeline-api-impl): 1.27.4
          DTKit 2 API. (dtkit-api): 3.0.2
          Cobertura Plugin (cobertura): 1.17
          HTML Publisher plugin (htmlpublisher): 1.31
          Handy Uri Templates 2.x API Plugin (handy-uri-templates-2-api): 2.1.8-22.v77d5b_75e6953
          Forensics API Plugin (forensics-api): 2.3.0
          GitHub plugin (github): 1.37.1
          bouncycastle API Plugin (bouncycastle-api): 2.28
          Dashboard for Blue Ocean (blueocean-dashboard): 1.27.4
          Pipeline: Job (workflow-job): 1308.v58d48a_763b_31
          Amazon Web Services SDK :: Logs (aws-java-sdk-logs): 1.12.481-392.v8b_291cfcda_09
          i18n for Blue Ocean (blueocean-i18n): 1.27.4
          Pipeline: Model API (pipeline-model-api): 2.2141.v5402e818a_779
          Pipeline: Step API (workflow-step-api): 639.v6eca_cd8c04a_a_
          Timestamper (timestamper): 1.25
          Bitbucket Pipeline for Blue Ocean (blueocean-bitbucket-pipeline): 1.27.4
          Code Coverage API Plugin (code-coverage-api): 4.7.0
          Amazon Web Services SDK :: CodeBuild (aws-java-sdk-codebuild): 1.12.481-392.v8b_291cfcda_09
          Authentication Tokens API Plugin (authentication-tokens): 1.53.v1c90fd9191a_b_
          GitHub Pipeline for Blue Ocean (blueocean-github-pipeline): 1.27.4
          Pipeline: Declarative Extension Points API (pipeline-model-extensions): 2.2141.v5402e818a_779
          Display URL for Blue Ocean (blueocean-display-url): 2.4.2
          OkHttp Plugin (okhttp-api): 4.11.0-145.vcb_8de402ef81
          Mina SSHD API :: Core (mina-sshd-api-core): 2.10.0-69.v28e3e36d18eb_
          Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 2.2141.v5402e818a_779
          Mina SSHD API :: Common (mina-sshd-api-common): 2.10.0-69.v28e3e36d18eb_
          Plugin Utilities API Plugin (plugin-util-api): 3.3.0
          Amazon Web Services SDK :: ECS (aws-java-sdk-ecs): 1.12.481-392.v8b_291cfcda_09
          Config API for Blue Ocean (blueocean-config): 1.27.4
          ECharts API Plugin (echarts-api): 5.4.0-5
          Pipeline: Multibranch (workflow-multibranch): 756.v891d88f2cd46
          JavaMail API (javax-mail-api): 1.6.2-9
          Amazon Web Services SDK :: SSM (aws-java-sdk-ssm): 1.12.481-392.v8b_291cfcda_09
          Bitbucket Branch Source Plugin (cloudbees-bitbucket-branch-source): 809.vc1d904b_30426
          Amazon Web Services SDK :: All (aws-java-sdk): 1.12.481-392.v8b_291cfcda_09
          REST API for Blue Ocean (blueocean-rest): 1.27.4
          Apache HttpComponents Client 4.x API Plugin (apache-httpcomponents-client-4-api): 4.5.14-150.v7a_b_9d17134a_5
          SSH Credentials Plugin (ssh-credentials): 305.v8f4381501156
          Matrix Project Plugin (matrix-project): 789.v57a_725b_63c79
          Ionicons API (ionicons-api): 56.v1b_1c8c49374e
          DataTables.net API Plugin (data-tables-api): 1.13.4-2
          SSH Build Agents plugin (ssh-slaves): 2.877.v365f5eb_a_b_eec
          Web for Blue Ocean (blueocean-web): 1.27.4
          PowerShell plugin (powershell): 2.0
          Variant Plugin (variant): 59.vf075fe829ccb
          Blue Ocean Pipeline Editor (blueocean-pipeline-editor): 1.27.4
          commons-text API Plugin (commons-text-api): 1.10.0-36.vc008c8fcda_7b_
          Pipeline: Supporting APIs (workflow-support): 839.v35e2736cfd5c
          commons-lang3 v3.x Jenkins API Plugin (commons-lang3-api): 3.12.0-36.vd97de6465d5b_
          Branch API Plugin (branch-api): 2.1109.vdf225489a_16d
          JAXB plugin (jaxb): 2.3.8-1
          Jakarta Mail API (jakarta-mail-api): 2.0.1-3
          Amazon Web Services SDK :: IAM (aws-java-sdk-iam): 1.12.481-392.v8b_291cfcda_09
          Display URL API (display-url-api): 2.3.7
          EnvInject API Plugin (envinject-api): 1.199.v3ce31253ed13
          Amazon Web Services SDK :: SQS (aws-java-sdk-sqs): 1.12.481-392.v8b_291cfcda_09
          Amazon Web Services SDK :: Minimal (aws-java-sdk-minimal): 1.12.481-392.v8b_291cfcda_09
          Personalization for Blue Ocean (blueocean-personalization): 1.27.4
          JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
          Pipeline: Groovy Libraries (pipeline-groovy-lib): 656.va_a_ceeb_6ffb_f7
          Amazon Web Services SDK :: Elastic Beanstalk (aws-java-sdk-elasticbeanstalk): 1.12.481-392.v8b_291cfcda_09
          Pipeline: Nodes and Processes (workflow-durable-task-step): 1247.v7f9dfea_b_4fd0
          JavaBeans Activation Framework (JAF) API (javax-activation-api): 1.2.0-6
          Pipeline: Stage Step (pipeline-stage-step): 305.ve96d0205c1c6
          Favorite (favorite): 2.4.2
          Token Macro Plugin (token-macro): 359.vb_cde11682e0c
          JWT for Blue Ocean (blueocean-jwt): 1.27.4
          Amazon Web Services SDK :: EC2 (aws-java-sdk-ec2): 1.12.481-392.v8b_291cfcda_09
          Git client plugin (git-client): 4.4.0
          Events API for Blue Ocean (blueocean-events): 1.27.4
          Amazon Web Services SDK :: ECR (aws-java-sdk-ecr): 1.12.481-392.v8b_291cfcda_09
          xUnit plugin (xunit): 3.1.2
          REST Implementation for Blue Ocean (blueocean-rest-impl): 1.27.4
          JSch dependency plugin (jsch): 0.2.8-65.v052c39de79b_2
          Checks API plugin (checks-api): 2.0.0
          Pipeline SCM API for Blue Ocean (blueocean-pipeline-scm-api): 1.27.4
          Structs Plugin (structs): 324.va_f5d6774f3a_d
          Caffeine API Plugin (caffeine-api): 3.1.6-115.vb_8b_b_328e59d8
          Git plugin (git): 5.1.0
          Node Iterator API Plugin (node-iterator-api): 49.v58a_8b_35f8363
          Build Timeout (build-timeout): 1.31
          Amazon Web Services SDK :: EFS (aws-java-sdk-efs): 1.12.481-392.v8b_291cfcda_09
          Jakarta Activation API (jakarta-activation-api): 2.0.1-3
          OWASP Markup Formatter Plugin (antisamy-markup-formatter): 159.v25b_c67cd35fb_
          Oracle Java SE Development Kit Installer Plugin (jdk-tool): 66.vd8fa_64ee91b_d
          Pipeline: SCM Step (workflow-scm-step): 415.v434365564324
          Pipeline: Milestone Step (pipeline-milestone-step): 111.v449306f708b_7
          GitHub Branch Source Plugin (github-branch-source): 1728.v859147241f49
          Amazon Web Services SDK :: kinesis (aws-java-sdk-kinesis): 1.12.481-392.v8b_291cfcda_09
          Instance Identity (instance-identity): 173.va_37c494ec4e5
          SnakeYAML API Plugin (snakeyaml-api): 1.33-95.va_b_a_e3e47b_fa_4
          Pipeline: Build Step (pipeline-build-step): 496.v2449a_9a_221f2
          Pipeline: Input Step (pipeline-input-step): 468.va_5db_051498a_4
          Trilead API Plugin (trilead-api): 2.84.v72119de229b_7
          Amazon Web Services SDK :: CloudFormation (aws-java-sdk-cloudformation): 1.12.481-392.v8b_291cfcda_09
          Font Awesome API Plugin (font-awesome-api): 6.4.0-1
          Pipeline: API (workflow-api): 1213.v646def1087f9
          Jackson 2 API Plugin (jackson2-api): 2.15.2-350.v0c2f3f8fc595
          Prism API Plugin (prism-api): 1.29.0-7
          Git Pipeline for Blue Ocean (blueocean-git-pipeline): 1.27.4
          SSH server (sshd): 3.303.vefc7119b_ec23
          GitHub API Plugin (github-api): 1.314-431.v78d72a_3fe4c3
          Server Sent Events (SSE) Gateway Plugin (sse-gateway): 1.26
          Script Security Plugin (script-security): 1251.vfe552ed55f8d
          JQuery3 API Plugin (jquery3-api): 3.7.0-1
          Design Language (jenkins-design-language): 1.27.4
          Mailer Plugin (mailer): 457.v3f72cb_e015e5
          Amazon EC2 plugin (ec2): 2.0.7
          SCM API Plugin (scm-api): 672.v64378a_b_20c60
          Pipeline: Declarative (pipeline-model-definition): 2.2141.v5402e818a_779
          JUnit Plugin (junit): 1207.va_09d5100410f
          Bootstrap 5 API Plugin (bootstrap5-api): 5.3.0-1
          piketec-tpt (piketec-tpt): 9.3
          Amazon Web Services SDK :: SNS (aws-java-sdk-sns): 1.12.481-392.v8b_291cfcda_09
          CloudBees AWS Credentials Plugin (aws-credentials): 191.vcb_f183ce58b_9
          Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 202.va_d268e64deb_3
          Java JSON Web Token (JJWT) Plugin (jjwt-api): 0.11.5-77.v646c772fddb_0
          Pipeline: Basic Steps (workflow-basic-steps): 1017.vb_45b_302f0cea_
          Pub-Sub "light" Bus (pubsub-light): 1.17
          Credentials Binding Plugin (credentials-binding): 604.vb_64480b_c56ca_
          Resource Disposer Plugin (resource-disposer): 0.22
          Blue Ocean (blueocean): 1.27.4
          Command Agent Launcher Plugin (command-launcher): 100.v2f6722292ee8
          Credentials Plugin (credentials): 1254.vb_96f366e7b_a_d
          Amazon Elastic Container Service (ECS) / Fargate plugin (amazon-ecs): 1.48
          Pipeline: Groovy (workflow-cps): 3691.v28b_14c465a_b_b_
          Blue Ocean Core JS (blueocean-core-js): 1.27.4
          Result: [Plugin:popper2-api, Plugin:multiple-scms, Plugin:cloudbees-folder, Plugin:ws-cleanup, Plugin:durable-task, Plugin:plain-credentials, Plugin:blueocean-commons, Plugin:ec2-fleet, Plugin:blueocean-pipeline-api-impl, Plugin:dtkit-api, Plugin:cobertura, Plugin:htmlpublisher, Plugin:handy-uri-templates-2-api, Plugin:forensics-api, Plugin:github, Plugin:bouncycastle-api, Plugin:blueocean-dashboard, Plugin:workflow-job, Plugin:aws-java-sdk-logs, Plugin:blueocean-i18n, Plugin:pipeline-model-api, Plugin:workflow-step-api, Plugin:timestamper, Plugin:blueocean-bitbucket-pipeline, Plugin:code-coverage-api, Plugin:aws-java-sdk-codebuild, Plugin:authentication-tokens, Plugin:blueocean-github-pipeline, Plugin:pipeline-model-extensions, Plugin:blueocean-display-url, Plugin:okhttp-api, Plugin:mina-sshd-api-core, Plugin:pipeline-stage-tags-metadata, Plugin:mina-sshd-api-common, Plugin:plugin-util-api, Plugin:aws-java-sdk-ecs, Plugin:blueocean-config, Plugin:echarts-api, Plugin:workflow-multibranch, Plugin:javax-mail-api, Plugin:aws-java-sdk-ssm, Plugin:cloudbees-bitbucket-branch-source, Plugin:aws-java-sdk, Plugin:blueocean-rest, Plugin:apache-httpcomponents-client-4-api, Plugin:ssh-credentials, Plugin:matrix-project, Plugin:ionicons-api, Plugin:data-tables-api, Plugin:ssh-slaves, Plugin:blueocean-web, Plugin:powershell, Plugin:variant, Plugin:blueocean-pipeline-editor, Plugin:commons-text-api, Plugin:workflow-support, Plugin:commons-lang3-api, Plugin:branch-api, Plugin:jaxb, Plugin:jakarta-mail-api, Plugin:aws-java-sdk-iam, Plugin:display-url-api, Plugin:envinject-api, Plugin:aws-java-sdk-sqs, Plugin:aws-java-sdk-minimal, Plugin:blueocean-personalization, Plugin:ace-editor, Plugin:pipeline-groovy-lib, Plugin:aws-java-sdk-elasticbeanstalk, Plugin:workflow-durable-task-step, Plugin:javax-activation-api, Plugin:pipeline-stage-step, Plugin:favorite, Plugin:token-macro, Plugin:blueocean-jwt, Plugin:aws-java-sdk-ec2, Plugin:git-client, Plugin:blueocean-events, Plugin:aws-java-sdk-ecr, Plugin:xunit, Plugin:blueocean-rest-impl, Plugin:jsch, Plugin:checks-api, Plugin:blueocean-pipeline-scm-api, Plugin:structs, Plugin:caffeine-api, Plugin:git, Plugin:node-iterator-api, Plugin:build-timeout, Plugin:aws-java-sdk-efs, Plugin:jakarta-activation-api, Plugin:antisamy-markup-formatter, Plugin:jdk-tool, Plugin:workflow-scm-step, Plugin:pipeline-milestone-step, Plugin:github-branch-source, Plugin:aws-java-sdk-kinesis, Plugin:instance-identity, Plugin:snakeyaml-api, Plugin:pipeline-build-step, Plugin:pipeline-input-step, Plugin:trilead-api, Plugin:aws-java-sdk-cloudformation, Plugin:font-awesome-api, Plugin:workflow-api, Plugin:jackson2-api, Plugin:prism-api, Plugin:blueocean-git-pipeline, Plugin:sshd, Plugin:github-api, Plugin:sse-gateway, Plugin:script-security, Plugin:jquery3-api, Plugin:jenkins-design-language, Plugin:mailer, Plugin:ec2, Plugin:scm-api, Plugin:pipeline-model-definition, Plugin:junit, Plugin:bootstrap5-api, Plugin:piketec-tpt, Plugin:aws-java-sdk-sns, Plugin:aws-credentials, Plugin:pipeline-graph-analysis, Plugin:jjwt-api, Plugin:workflow-basic-steps, Plugin:pubsub-light, Plugin:credentials-binding, Plugin:resource-disposer, Plugin:blueocean, Plugin:command-launcher, Plugin:credentials, Plugin:amazon-ecs, Plugin:workflow-cps, Plugin:blueocean-core-js]

          Elias added a comment - - edited markewaite   So, i went back and found a backup from 20 august. Tried my pipeline and there it works great. Reponse [Pipeline] withCredentials 13:38:15 Masking supported pattern matches of %GIT_USERNAME% or %GIT_PASSWORD% or %GIT_ASKPASS% or %SW_PASSWORD% [Pipeline] { [Pipeline] powershell 13:38:20 test 13:38:20 **** 13:38:21 powershell.exe : 11:38:20.690924 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin 13:38:21 At C:\tmp\jenkins-7a4d4d44\workspace\project@tmp\durable-149d9f6c\powershellWrapper.ps1:3 char :1 13:38:21 + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ... 13:38:21 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13:38:21 + CategoryInfo : NotSpecified: (11:38:20.690924...Git/mingw64/bin: String ) [], RemoteException 13:38:21 + FullyQualifiedErrorId : NativeCommandError 13:38:21 13:38:21 11:38:20.705908 git.c:462 trace: built-in: git clone https: //github.com/org/repo.git 13:38:21 11:38:20.731913 run-command.c:661 trace: run_command: git remote-https origin https: //github.com/org/repo.git 13:38:21 Cloning into 'Tests' ... 13:38:21 11:38:20.779906 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 13:38:21 11:38:20.782906 git.c:748 trace: exec: git-remote-https origin https: //github.com/org/repo.git 13:38:21 11:38:20.782906 run-command.c:661 trace: run_command: git-remote-https origin https: //github.com/org/repo.git 13:38:21 11:38:20.811906 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 13:38:21 11:38:21.358897 run-command.c:661 trace: run_command: 13:38:21 **** 'Username for ' \ ''https: //github.com' \ '': ' 13:38:21 11:38:21.417904 run-command.c:661 trace: run_command: 13:38:21 **** 'Password for ' \ ''https: //****@github.com' \ '': ' 13:38:22 11:38:22.455648 run-command.c:661 trace: run_command: git index-pack --stdin --fix-thin '--keep=fetch-pack 1356 on EC2AMAZ-B1QKLUV' --check-self-contained-and-connected 13:38:22 11:38:22.473644 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 13:38:22 11:38:22.476648 git.c:462 trace: built-in: git index-pack --stdin --fix-thin '--keep=fetch-pack 1356 on EC2AMAZ-B1QKLUV' --check-self-contained-and-connected 13:38:27 11:38:27.376885 run-command.c:661 trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs 13:38:27 11:38:27.405853 exec-cmd.c:243 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core 13:38:27 11:38:27.409882 git.c:462 trace: built-in: git rev-list --objects --stdin --not --all --quiet --alternate-refs Jenkins 2.395 Plugins: Popper.js 2 API Plugin (popper2-api): 2.11.6-2 Multiple SCMs plugin (multiple-scms): 0.8 Folders Plugin (cloudbees-folder): 6.815.v0dd5a_cb_40e0e Workspace Cleanup Plugin (ws-cleanup): 0.45 Durable Task Plugin (durable-task): 507.v050055d0cb_dd Plain Credentials Plugin (plain-credentials): 143.v1b_df8b_d3b_e48 Common API for Blue Ocean (blueocean-commons): 1.27.4 EC2 Fleet Jenkins Plugin (ec2-fleet): 2.6.0 Pipeline implementation for Blue Ocean (blueocean-pipeline-api-impl): 1.27.4 DTKit 2 API. (dtkit-api): 3.0.2 Cobertura Plugin (cobertura): 1.17 HTML Publisher plugin (htmlpublisher): 1.31 Handy Uri Templates 2.x API Plugin (handy-uri-templates-2-api): 2.1.8-22.v77d5b_75e6953 Forensics API Plugin (forensics-api): 2.3.0 GitHub plugin (github): 1.37.1 bouncycastle API Plugin (bouncycastle-api): 2.28 Dashboard for Blue Ocean (blueocean-dashboard): 1.27.4 Pipeline: Job (workflow-job): 1308.v58d48a_763b_31 Amazon Web Services SDK :: Logs (aws-java-sdk-logs): 1.12.481-392.v8b_291cfcda_09 i18n for Blue Ocean (blueocean-i18n): 1.27.4 Pipeline: Model API (pipeline-model-api): 2.2141.v5402e818a_779 Pipeline: Step API (workflow-step-api): 639.v6eca_cd8c04a_a_ Timestamper (timestamper): 1.25 Bitbucket Pipeline for Blue Ocean (blueocean-bitbucket-pipeline): 1.27.4 Code Coverage API Plugin (code-coverage-api): 4.7.0 Amazon Web Services SDK :: CodeBuild (aws-java-sdk-codebuild): 1.12.481-392.v8b_291cfcda_09 Authentication Tokens API Plugin (authentication-tokens): 1.53.v1c90fd9191a_b_ GitHub Pipeline for Blue Ocean (blueocean-github-pipeline): 1.27.4 Pipeline: Declarative Extension Points API (pipeline-model-extensions): 2.2141.v5402e818a_779 Display URL for Blue Ocean (blueocean-display-url): 2.4.2 OkHttp Plugin (okhttp-api): 4.11.0-145.vcb_8de402ef81 Mina SSHD API :: Core (mina-sshd-api-core): 2.10.0-69.v28e3e36d18eb_ Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 2.2141.v5402e818a_779 Mina SSHD API :: Common (mina-sshd-api-common): 2.10.0-69.v28e3e36d18eb_ Plugin Utilities API Plugin (plugin-util-api): 3.3.0 Amazon Web Services SDK :: ECS (aws-java-sdk-ecs): 1.12.481-392.v8b_291cfcda_09 Config API for Blue Ocean (blueocean-config): 1.27.4 ECharts API Plugin (echarts-api): 5.4.0-5 Pipeline: Multibranch (workflow-multibranch): 756.v891d88f2cd46 JavaMail API (javax-mail-api): 1.6.2-9 Amazon Web Services SDK :: SSM (aws-java-sdk-ssm): 1.12.481-392.v8b_291cfcda_09 Bitbucket Branch Source Plugin (cloudbees-bitbucket-branch-source): 809.vc1d904b_30426 Amazon Web Services SDK :: All (aws-java-sdk): 1.12.481-392.v8b_291cfcda_09 REST API for Blue Ocean (blueocean- rest ): 1.27.4 Apache HttpComponents Client 4.x API Plugin (apache-httpcomponents-client-4-api): 4.5.14-150.v7a_b_9d17134a_5 SSH Credentials Plugin (ssh-credentials): 305.v8f4381501156 Matrix Project Plugin (matrix-project): 789.v57a_725b_63c79 Ionicons API (ionicons-api): 56.v1b_1c8c49374e DataTables.net API Plugin (data-tables-api): 1.13.4-2 SSH Build Agents plugin (ssh-slaves): 2.877.v365f5eb_a_b_eec Web for Blue Ocean (blueocean-web): 1.27.4 PowerShell plugin (powershell): 2.0 Variant Plugin (variant): 59.vf075fe829ccb Blue Ocean Pipeline Editor (blueocean-pipeline-editor): 1.27.4 commons-text API Plugin (commons-text-api): 1.10.0-36.vc008c8fcda_7b_ Pipeline: Supporting APIs (workflow-support): 839.v35e2736cfd5c commons-lang3 v3.x Jenkins API Plugin (commons-lang3-api): 3.12.0-36.vd97de6465d5b_ Branch API Plugin (branch-api): 2.1109.vdf225489a_16d JAXB plugin (jaxb): 2.3.8-1 Jakarta Mail API (jakarta-mail-api): 2.0.1-3 Amazon Web Services SDK :: IAM (aws-java-sdk-iam): 1.12.481-392.v8b_291cfcda_09 Display URL API (display-url-api): 2.3.7 EnvInject API Plugin (envinject-api): 1.199.v3ce31253ed13 Amazon Web Services SDK :: SQS (aws-java-sdk-sqs): 1.12.481-392.v8b_291cfcda_09 Amazon Web Services SDK :: Minimal (aws-java-sdk-minimal): 1.12.481-392.v8b_291cfcda_09 Personalization for Blue Ocean (blueocean-personalization): 1.27.4 JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1 Pipeline: Groovy Libraries (pipeline-groovy-lib): 656.va_a_ceeb_6ffb_f7 Amazon Web Services SDK :: Elastic Beanstalk (aws-java-sdk-elasticbeanstalk): 1.12.481-392.v8b_291cfcda_09 Pipeline: Nodes and Processes (workflow-durable-task-step): 1247.v7f9dfea_b_4fd0 JavaBeans Activation Framework (JAF) API (javax-activation-api): 1.2.0-6 Pipeline: Stage Step (pipeline-stage-step): 305.ve96d0205c1c6 Favorite (favorite): 2.4.2 Token Macro Plugin (token-macro): 359.vb_cde11682e0c JWT for Blue Ocean (blueocean-jwt): 1.27.4 Amazon Web Services SDK :: EC2 (aws-java-sdk-ec2): 1.12.481-392.v8b_291cfcda_09 Git client plugin (git-client): 4.4.0 Events API for Blue Ocean (blueocean-events): 1.27.4 Amazon Web Services SDK :: ECR (aws-java-sdk-ecr): 1.12.481-392.v8b_291cfcda_09 xUnit plugin (xunit): 3.1.2 REST Implementation for Blue Ocean (blueocean- rest -impl): 1.27.4 JSch dependency plugin (jsch): 0.2.8-65.v052c39de79b_2 Checks API plugin (checks-api): 2.0.0 Pipeline SCM API for Blue Ocean (blueocean-pipeline-scm-api): 1.27.4 Structs Plugin (structs): 324.va_f5d6774f3a_d Caffeine API Plugin (caffeine-api): 3.1.6-115.vb_8b_b_328e59d8 Git plugin (git): 5.1.0 Node Iterator API Plugin (node-iterator-api): 49.v58a_8b_35f8363 Build Timeout (build-timeout): 1.31 Amazon Web Services SDK :: EFS (aws-java-sdk-efs): 1.12.481-392.v8b_291cfcda_09 Jakarta Activation API (jakarta-activation-api): 2.0.1-3 OWASP Markup Formatter Plugin (antisamy-markup-formatter): 159.v25b_c67cd35fb_ Oracle Java SE Development Kit Installer Plugin (jdk-tool): 66.vd8fa_64ee91b_d Pipeline: SCM Step (workflow-scm-step): 415.v434365564324 Pipeline: Milestone Step (pipeline-milestone-step): 111.v449306f708b_7 GitHub Branch Source Plugin (github-branch-source): 1728.v859147241f49 Amazon Web Services SDK :: kinesis (aws-java-sdk-kinesis): 1.12.481-392.v8b_291cfcda_09 Instance Identity (instance-identity): 173.va_37c494ec4e5 SnakeYAML API Plugin (snakeyaml-api): 1.33-95.va_b_a_e3e47b_fa_4 Pipeline: Build Step (pipeline-build-step): 496.v2449a_9a_221f2 Pipeline: Input Step (pipeline-input-step): 468.va_5db_051498a_4 Trilead API Plugin (trilead-api): 2.84.v72119de229b_7 Amazon Web Services SDK :: CloudFormation (aws-java-sdk-cloudformation): 1.12.481-392.v8b_291cfcda_09 Font Awesome API Plugin (font-awesome-api): 6.4.0-1 Pipeline: API (workflow-api): 1213.v646def1087f9 Jackson 2 API Plugin (jackson2-api): 2.15.2-350.v0c2f3f8fc595 Prism API Plugin (prism-api): 1.29.0-7 Git Pipeline for Blue Ocean (blueocean-git-pipeline): 1.27.4 SSH server (sshd): 3.303.vefc7119b_ec23 GitHub API Plugin (github-api): 1.314-431.v78d72a_3fe4c3 Server Sent Events (SSE) Gateway Plugin (sse-gateway): 1.26 Script Security Plugin (script-security): 1251.vfe552ed55f8d JQuery3 API Plugin (jquery3-api): 3.7.0-1 Design Language (jenkins-design-language): 1.27.4 Mailer Plugin (mailer): 457.v3f72cb_e015e5 Amazon EC2 plugin (ec2): 2.0.7 SCM API Plugin (scm-api): 672.v64378a_b_20c60 Pipeline: Declarative (pipeline-model-definition): 2.2141.v5402e818a_779 JUnit Plugin (junit): 1207.va_09d5100410f Bootstrap 5 API Plugin (bootstrap5-api): 5.3.0-1 piketec-tpt (piketec-tpt): 9.3 Amazon Web Services SDK :: SNS (aws-java-sdk-sns): 1.12.481-392.v8b_291cfcda_09 CloudBees AWS Credentials Plugin (aws-credentials): 191.vcb_f183ce58b_9 Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 202.va_d268e64deb_3 Java JSON Web Token (JJWT) Plugin (jjwt-api): 0.11.5-77.v646c772fddb_0 Pipeline: Basic Steps (workflow-basic-steps): 1017.vb_45b_302f0cea_ Pub-Sub "light" Bus (pubsub-light): 1.17 Credentials Binding Plugin (credentials-binding): 604.vb_64480b_c56ca_ Resource Disposer Plugin (resource-disposer): 0.22 Blue Ocean (blueocean): 1.27.4 Command Agent Launcher Plugin (command-launcher): 100.v2f6722292ee8 Credentials Plugin (credentials): 1254.vb_96f366e7b_a_d Amazon Elastic Container Service (ECS) / Fargate plugin (amazon-ecs): 1.48 Pipeline: Groovy (workflow-cps): 3691.v28b_14c465a_b_b_ Blue Ocean Core JS (blueocean-core-js): 1.27.4 Result: [Plugin:popper2-api, Plugin:multiple-scms, Plugin:cloudbees-folder, Plugin:ws-cleanup, Plugin:durable-task, Plugin:plain-credentials, Plugin:blueocean-commons, Plugin:ec2-fleet, Plugin:blueocean-pipeline-api-impl, Plugin:dtkit-api, Plugin:cobertura, Plugin:htmlpublisher, Plugin:handy-uri-templates-2-api, Plugin:forensics-api, Plugin:github, Plugin:bouncycastle-api, Plugin:blueocean-dashboard, Plugin:workflow-job, Plugin:aws-java-sdk-logs, Plugin:blueocean-i18n, Plugin:pipeline-model-api, Plugin:workflow-step-api, Plugin:timestamper, Plugin:blueocean-bitbucket-pipeline, Plugin:code-coverage-api, Plugin:aws-java-sdk-codebuild, Plugin:authentication-tokens, Plugin:blueocean-github-pipeline, Plugin:pipeline-model-extensions, Plugin:blueocean-display-url, Plugin:okhttp-api, Plugin:mina-sshd-api-core, Plugin:pipeline-stage-tags-metadata, Plugin:mina-sshd-api-common, Plugin:plugin-util-api, Plugin:aws-java-sdk-ecs, Plugin:blueocean-config, Plugin:echarts-api, Plugin:workflow-multibranch, Plugin:javax-mail-api, Plugin:aws-java-sdk-ssm, Plugin:cloudbees-bitbucket-branch-source, Plugin:aws-java-sdk, Plugin:blueocean- rest , Plugin:apache-httpcomponents-client-4-api, Plugin:ssh-credentials, Plugin:matrix-project, Plugin:ionicons-api, Plugin:data-tables-api, Plugin:ssh-slaves, Plugin:blueocean-web, Plugin:powershell, Plugin:variant, Plugin:blueocean-pipeline-editor, Plugin:commons-text-api, Plugin:workflow-support, Plugin:commons-lang3-api, Plugin:branch-api, Plugin:jaxb, Plugin:jakarta-mail-api, Plugin:aws-java-sdk-iam, Plugin:display-url-api, Plugin:envinject-api, Plugin:aws-java-sdk-sqs, Plugin:aws-java-sdk-minimal, Plugin:blueocean-personalization, Plugin:ace-editor, Plugin:pipeline-groovy-lib, Plugin:aws-java-sdk-elasticbeanstalk, Plugin:workflow-durable-task-step, Plugin:javax-activation-api, Plugin:pipeline-stage-step, Plugin:favorite, Plugin:token-macro, Plugin:blueocean-jwt, Plugin:aws-java-sdk-ec2, Plugin:git-client, Plugin:blueocean-events, Plugin:aws-java-sdk-ecr, Plugin:xunit, Plugin:blueocean- rest -impl, Plugin:jsch, Plugin:checks-api, Plugin:blueocean-pipeline-scm-api, Plugin:structs, Plugin:caffeine-api, Plugin:git, Plugin:node-iterator-api, Plugin:build-timeout, Plugin:aws-java-sdk-efs, Plugin:jakarta-activation-api, Plugin:antisamy-markup-formatter, Plugin:jdk-tool, Plugin:workflow-scm-step, Plugin:pipeline-milestone-step, Plugin:github-branch-source, Plugin:aws-java-sdk-kinesis, Plugin:instance-identity, Plugin:snakeyaml-api, Plugin:pipeline-build-step, Plugin:pipeline-input-step, Plugin:trilead-api, Plugin:aws-java-sdk-cloudformation, Plugin:font-awesome-api, Plugin:workflow-api, Plugin:jackson2-api, Plugin:prism-api, Plugin:blueocean-git-pipeline, Plugin:sshd, Plugin:github-api, Plugin:sse-gateway, Plugin:script-security, Plugin:jquery3-api, Plugin:jenkins-design-language, Plugin:mailer, Plugin:ec2, Plugin:scm-api, Plugin:pipeline-model-definition, Plugin:junit, Plugin:bootstrap5-api, Plugin:piketec-tpt, Plugin:aws-java-sdk-sns, Plugin:aws-credentials, Plugin:pipeline-graph-analysis, Plugin:jjwt-api, Plugin:workflow-basic-steps, Plugin:pubsub-light, Plugin:credentials-binding, Plugin:resource-disposer, Plugin:blueocean, Plugin:command-launcher, Plugin:credentials, Plugin:amazon-ecs, Plugin:workflow-cps, Plugin:blueocean-core-js]

          Elias added a comment -

          Update Jenkins to Jenkins 2.423 but kept the plugins as the same version and everything still works

          Elias added a comment - Update Jenkins to Jenkins 2.423 but kept the plugins as the same version and everything still works

          wonchul added a comment - - edited

          I too have a similar problem.

          I tried to import another repository within the same organization as GIT_USERNAME/GIT_PASSWORD in a shellscript, but it doesn't work.

          wonchul added a comment - - edited I too have a similar problem. I tried to import another repository within the same organization as GIT_USERNAME/GIT_PASSWORD in a shellscript, but it doesn't work.

          Stefan added a comment -

          I made a PR that should fix this issue: https://github.com/jenkinsci/git-plugin/pull/1555

          How can I get someone to review, merge and release it?

          Stefan added a comment - I made a PR that should fix this issue: https://github.com/jenkinsci/git-plugin/pull/1555 How can I get someone to review, merge and release it?

          Yacine added a comment - - edited

          un ugly workround until the fix by stefansli  is merged 

          withCredentials([gitUsernamePassword(credentialsId: 'myUsernameTokenCredentialsID', gitToolName: 'git-tool')]) {        
              // (ugly) workaround for https://issues.jenkins.io/browse/JENKINS-72044    
              // until this PR is merged https://github.com/jenkinsci/git-plugin/pull/1555
              powershell("(Get-Content \$Env:GIT_ASKPASS).Replace('/', '\\') | Set-Content \$Env:GIT_ASKPASS")
              
              powershell("git clone https://my/orga/repo.git")
          }
          

          Yacine added a comment - - edited un ugly workround until the fix by stefansli   is merged  withCredentials([gitUsernamePassword(credentialsId: 'myUsernameTokenCredentialsID' , gitToolName: 'git-tool' )]) {        // (ugly) workaround for https://issues.jenkins.io/browse/JENKINS-72044    // until this PR is merged https://github.com/jenkinsci/git-plugin/pull/1555 powershell( "(Get-Content \$Env:GIT_ASKPASS).Replace( '/' , '\\' ) | Set-Content \$Env:GIT_ASKPASS" )     powershell( "git clone https: //my/orga/repo.git" ) }

            Unassigned Unassigned
            hiabvesteel Elias
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: