• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • ssh-agent-plugin
    • None

      While calling the git client from within the ssh agent's scope it is giving "script returned exit code 128" error 

      stage ('Prune git tags') 
      {            
       steps {              
         sshagent(['Credential_ID']) 
          {                
           sh ''' 
           git tag --list | xargs git tag --delete && git fetch --tags
           '''              
           }      
        }
      } 

      Upon adding 

      Host *.stie.com  StrictHostKeyChecking no  UserKnownHostsFile /dev/null 

      Jenkins builds started passing but for GitHub

      Host github.com  StrictHostKeyChecking no  UserKnownHostsFile /dev/null 

      it is still failing the build.

       

      For me adding a host key entry in every call is difficult. Can I add something like global host key and pass them in sshagent globally, I have already added them for internal SCM Urls for git calls. But somehow they are not being passed under the sshagent scope calls on slave node.

          [JENKINS-73018] Getting "script returned exit code 128"

          OJASH created issue -
          OJASH made changes -
          Description Original: While calling the git client from within the ssh agent's scope it is giving "{_}*script returned exit code 128*{_}" error 
          {code:java}
          stage ('Prune git tags')
          {
           steps {
             sshagent(['Credential_ID'])
              {
               sh '''
               git tag --list | xargs git tag --delete && git fetch --tags
               '''
               }
            }
          } {code}
          Upon adding 
          {code:java}
          Host *.stie.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          Jenkins builds started passing but for GitHub
          {code:java}
          Host github.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          it is still failing the build.

           

          For me adding a host key entry in every call is difficult. Can I add something like global host key, I have already added them for internal SCM Urls for git calls. But somehow they are not being passed under the sshagent scope calls on slavem node.
          New: While calling the git client from within the ssh agent's scope it is giving "{_}*script returned exit code 128*{_}" error 
          {code:java}
          stage ('Prune git tags')
          {
           steps {
             sshagent(['Credential_ID'])
              {
               sh '''
               git tag --list | xargs git tag --delete && git fetch --tags
               '''
               }
            }
          } {code}
          Upon adding 
          {code:java}
          Host *.stie.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          Jenkins builds started passing but for GitHub
          {code:java}
          Host github.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          it is still failing the build.

           

          For me adding a host key entry in every call is difficult. Can I add something like global host key, I have already added them for internal SCM Urls for git calls. But somehow they are not being passed under the sshagent scope calls on slave node.
          OJASH made changes -
          Description Original: While calling the git client from within the ssh agent's scope it is giving "{_}*script returned exit code 128*{_}" error 
          {code:java}
          stage ('Prune git tags')
          {
           steps {
             sshagent(['Credential_ID'])
              {
               sh '''
               git tag --list | xargs git tag --delete && git fetch --tags
               '''
               }
            }
          } {code}
          Upon adding 
          {code:java}
          Host *.stie.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          Jenkins builds started passing but for GitHub
          {code:java}
          Host github.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          it is still failing the build.

           

          For me adding a host key entry in every call is difficult. Can I add something like global host key, I have already added them for internal SCM Urls for git calls. But somehow they are not being passed under the sshagent scope calls on slave node.
          New: While calling the git client from within the ssh agent's scope it is giving "{_}*script returned exit code 128*{_}" error 
          {code:java}
          stage ('Prune git tags')
          {
           steps {
             sshagent(['Credential_ID'])
              {
               sh '''
               git tag --list | xargs git tag --delete && git fetch --tags
               '''
               }
            }
          } {code}
          Upon adding 
          {code:java}
          Host *.stie.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          Jenkins builds started passing but for GitHub
          {code:java}
          Host github.com StrictHostKeyChecking no UserKnownHostsFile /dev/null {code}
          it is still failing the build.

           

          For me adding a host key entry in every call is difficult. Can I add something like global host key and pass them in sshagent globally, I have already added them for internal SCM Urls for git calls. But somehow they are not being passed under the sshagent scope calls on slave node.

            Unassigned Unassigned
            ojash97 OJASH
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: