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

13 views
Skip to first unread message

n.hardy@exxellence.nl (JIRA)

unread,
Jan 8, 2020, 10:52:02 AM1/8/20
to jenkinsc...@googlegroups.com
Nick Hardy updated an issue
 
Jenkins / Bug JENKINS-60698
sshCommand with sudo: true waits forever
Change By: Nick Hardy
Priority: Minor Major
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

n.hardy@exxellence.nl (JIRA)

unread,
Jan 8, 2020, 10:52:02 AM1/8/20
to jenkinsc...@googlegroups.com
Nick Hardy created an issue
Issue Type: Bug Bug
Assignee: Naresh Rayapati
Components: ssh-steps-plugin
Created: 2020-01-08 15:51
Environment: Jenkins 2.204.1
Ubuntu 16.04.5 LTS
Priority: Minor Minor
Reporter: Nick Hardy

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?

naresh.rayapati@gmail.com (JIRA)

unread,
Jan 28, 2020, 10:16:03 PM1/28/20
to jenkinsc...@googlegroups.com
Naresh Rayapati commented on Bug JENKINS-60698
 
Re: sshCommand with sudo: true waits forever

To run sudo command the we need to provide username and password as the command would be waiting for an password as an input during the actual execution, it would waiting. Looks like you are using identifyFile so either switch it to use username password or add support for password less sudo access on these commands.

naresh.rayapati@gmail.com (JIRA)

unread,
Jan 28, 2020, 11:15:03 PM1/28/20
to jenkinsc...@googlegroups.com
Naresh Rayapati reopened an issue
 
Change By: Naresh Rayapati
Resolution: Fixed
Status: Closed Reopened

naresh.rayapati@gmail.com (JIRA)

unread,
Jan 28, 2020, 11:15:04 PM1/28/20
to jenkinsc...@googlegroups.com
Naresh Rayapati closed an issue as Fixed
Change By: Naresh Rayapati
Status: Open Closed
Resolution: Fixed

naresh.rayapati@gmail.com (JIRA)

unread,
Jan 28, 2020, 11:15:04 PM1/28/20
to jenkinsc...@googlegroups.com

naresh.rayapati@gmail.com (JIRA)

unread,
Jan 28, 2020, 11:15:04 PM1/28/20
to jenkinsc...@googlegroups.com

naresh.rayapati@gmail.com (JIRA)

unread,
Jan 28, 2020, 11:15:04 PM1/28/20
to jenkinsc...@googlegroups.com
Naresh Rayapati closed an issue as Not A Defect
Change By: Naresh Rayapati
Status: Open Closed
Resolution: Not A Defect
Reply all
Reply to author
Forward
0 new messages