• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ssh-steps-plugin
    • None
    • Jenkins 2.204.1
      Ubuntu 16.04.5 LTS

      I have an issue using an sshCommand with sudo set to true from within a pipeline.

      withCredentials([sshUserPrivateKey(credentialsId: credentials_id, keyFileVariable: 'JenkinsIdentity')]) {
      	script {
      		def remote = [name: server_name, host: host_name, knownHosts: remote_knownHosts, user: remote_user, timeoutSec: 1200, identityFile: JenkinsIdentity]
      		
      		// install application
      		sshCommand remote: remote, command: '/home/user/install.sh', sudo: true
      	}
      }
      

      The command executes on the remote server, but it's waiting forever. Probably waiting for user input.

      On the remote server i see this in processes:
      root 62610 62609 0 16:35 ? 00:00:00 sudo -S -p 4b0b21d6-23ab-4e47-b21e-8362bdf2c4d0 sh /home/user/install.sh

      It will only stop when i abort the jenkins job.

      Any ideas on what i can try?

          [JENKINS-60698] sshCommand with sudo: true waits forever

          Nick Hardy created issue -
          Nick Hardy made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Naresh Rayapati made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          Naresh Rayapati made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]
          Naresh Rayapati made changes -
          Status Original: Reopened [ 4 ] New: Open [ 1 ]
          Naresh Rayapati made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          Naresh Rayapati made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          Unnikrishnan R made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]
          Unnikrishnan R made changes -
          Attachment New: Screen Shot 2020-06-22 at 12.16.21 PM.png [ 51707 ]

            nrayapati Naresh Rayapati
            nickhardy Nick Hardy
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: