[JIRA] (JENKINS-56989) Default pty to false for sshCommand

13 views
Skip to first unread message

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:49:02 PM4/14/19
to jenkinsc...@googlegroups.com
Naresh Rayapati updated an issue
 
Jenkins / Improvement JENKINS-56989
Default pty to false for sshCommand
Change By: Naresh Rayapati
Summary: Allow explicit enabling/disabling of PTY with Default pty to false for sshCommand
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:50:02 PM4/14/19
to jenkinsc...@googlegroups.com
Naresh Rayapati updated an issue
Calling sshCommand forces the allocation of PTY, however running commands on servers where there is no proper PTY support (win32-openssh) can generate failures such as garbage output, ...

Being able to disable/enable PTY allocation would help for these environments

EDIT:  

There is PTY setting at the remote level, but actually not sure why I had to make it true at the command level, so feel like it needs to be defaulted to `false`. Made a PR: 

 

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:53:03 PM4/14/19
to jenkinsc...@googlegroups.com
Naresh Rayapati updated an issue
Calling sshCommand forces the allocation of PTY, however running commands on servers where there is no proper PTY support (win32-openssh) can generate failures such as garbage output, ...

Being able to disable/enable PTY allocation would help for these environments

EDIT: 

There is PTY setting at the remote level, but actually not sure why I had to make it true at the command level, so I think it needs to be defaulted to ` false ` as there is no impact for LINUX boxes either way, I have tested it . Made a PR: 

 

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:53:03 PM4/14/19
to jenkinsc...@googlegroups.com
Naresh Rayapati updated an issue
Calling sshCommand forces the allocation of PTY, however running commands on servers where there is no proper PTY support (win32-openssh) can generate failures such as garbage output, ...

Being able to disable/enable PTY allocation would help for these environments

EDIT: 

There is PTY setting at the remote level, but actually not sure why I had to make it true at the command level, so feel like it needs to be defaulted to `false`. Made a PR: 

 

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:53:03 PM4/14/19
to jenkinsc...@googlegroups.com

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:53:35 PM4/14/19
to jenkinsc...@googlegroups.com

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:53:36 PM4/14/19
to jenkinsc...@googlegroups.com
Naresh Rayapati updated an issue
Change By: Naresh Rayapati
Calling sshCommand forces the allocation of PTY, however running commands on servers where there is no proper PTY support (win32-openssh) can generate failures such as garbage output, ...

Being able to disable/enable PTY allocation would help for these environments

EDIT: 

There is PTY setting at the remote level, but actually not sure why I had to make it true at the command level,
so I think it needs to be defaulted to ` false ` as there is no impact for LINUX boxes either way, I have tested it . Made a PR: 

 

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:53:37 PM4/14/19
to jenkinsc...@googlegroups.com
Naresh Rayapati updated an issue
Calling sshCommand forces the allocation of PTY, however running commands on servers where there is no proper PTY support (win32-openssh) can generate failures such as garbage output, ...

Being able to disable/enable PTY allocation would help for these environments

EDIT: 

There is PTY setting at the remote level, but actually not sure why I had to make it true at the command level, so feel like it needs to be defaulted to `false`. Made a PR: 

 

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 14, 2019, 4:54:02 PM4/14/19
to jenkinsc...@googlegroups.com
Naresh Rayapati updated an issue
Calling sshCommand forces the allocation of PTY, however running commands on servers where there is no proper PTY support (win32-openssh) can generate failures such as garbage output, ...

Being able to disable/enable PTY allocation would help for these environments

EDIT: 

There is PTY setting at the remote level, but actually not sure why I had to make it true at the command level, I think it needs to be defaulted false as there is no impact for LINUX boxes either way, I have tested it. Made a PR .

And this PTY is also applicable for other steps, so instead it is good to have it at the remote level.
 

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 28, 2019, 4:23:03 AM4/28/19
to jenkinsc...@googlegroups.com
Change By: Naresh Rayapati
Status: Resolved Fixed but Unreleased

naresh.rayapati@gmail.com (JIRA)

unread,
Apr 28, 2019, 4:23:03 AM4/28/19
to jenkinsc...@googlegroups.com
Change By: Naresh Rayapati
Status: In Review Resolved
Resolution: Fixed

naresh.rayapati@gmail.com (JIRA)

unread,
Jul 20, 2019, 6:00:03 PM7/20/19
to jenkinsc...@googlegroups.com
Change By: Naresh Rayapati
Status: Fixed but Unreleased Resolved

naresh.rayapati@gmail.com (JIRA)

unread,
Jul 20, 2019, 6:00:03 PM7/20/19
to jenkinsc...@googlegroups.com
Naresh Rayapati closed an issue as Fixed
Change By: Naresh Rayapati
Status: Resolved Closed

naresh.rayapati@gmail.com (JIRA)

unread,
Jul 20, 2019, 6:00:03 PM7/20/19
to jenkinsc...@googlegroups.com

erik-jan@rieksen.net (JIRA)

unread,
Aug 7, 2019, 4:16:02 AM8/7/19
to jenkinsc...@googlegroups.com

As noted in release sudo: true param also requires pty: true. This unfortunately broke my pipeline. Why not automatically set pty: true when sudo: true for backwards compatability?

erik-jan@rieksen.net (JIRA)

unread,
Aug 7, 2019, 4:17:02 AM8/7/19
to jenkinsc...@googlegroups.com
Erik-Jan Rieksen edited a comment on Improvement JENKINS-56989
As noted in release notes " sudo: true " param also requires " pty: true " . This change unfortunately broke my pipeline. Why not automatically set pty: true when sudo: true for backwards compatability?

naresh.rayapati@gmail.com (JIRA)

unread,
Aug 7, 2019, 9:55:03 AM8/7/19
to jenkinsc...@googlegroups.com

Erik-Jan Rieksen Can you post a bit of your pipeline code?, pty: true is only required for few of the platforms/ssh-agents like SSH on Linux.

Note: pty: true is not an option for sshCommand but for the actual remote.

erik-jan@rieksen.net (JIRA)

unread,
Aug 7, 2019, 10:08:04 AM8/7/19
to jenkinsc...@googlegroups.com

Naresh Rayapati with "remote.pty: true" added the build works as expected. Without pty true (after the latest plugin update) the build times out after 10 minutes (as configured) at sshCommand. Both the jenkins server and the SSH server to which is connected run Ubuntu. 

def remote = [:]
remote.name = 'ommitted'
remote.host = 'ommitted'
remote.user = 'ommitted'
remote.password = 'ommitted'
remote.allowAnyHosts = truepipeline {
 agent any
 options {
   timeout(time: 10)
   disableConcurrentBuilds()
 }
 stages {   stage('Clone repository') {
     steps {
       checkout scm
     }
   }   stage('Build') {
     when {
       anyOf {
         branch 'development'
         branch 'master'
       }
     }
     steps {
       echo 'Testing & Building...'
       sh 'mvn -B clean package'
     }
   }   stage('Build docker image') {
     when {
       anyOf {
         branch 'development'
         branch 'master'
       }
     }     steps {
       echo 'Building docker image...'
       sh 'docker login -u ommitted'
       sh 'docker build -t="ommitted" .'
     }
   }   stage('Push docker image') {
     when {
       anyOf {
         branch 'development'
         branch 'master'
       }
     }     steps {
       echo 'Pushing docker image...'
       sh 'docker push ommitted'
     }
   }   stage('Deploy') {
     when {
       anyOf {
         branch 'development'
         branch 'master'
       }
     }
     steps {
       echo 'Deploying...'
       sshCommand remote: remote, sudo: true, command: "sudo sh update.sh"
     }
   }
 }
}

Jenkins log

Executing command on ommitted[ommitted]: sudo sh update.sh sudo: true
Cancelling nested steps due to timeout
d997b761-0e4a-4707-a205-d71cc489b9bc

naresh.rayapati@gmail.com (JIRA)

unread,
Aug 14, 2019, 9:53:02 PM8/14/19
to jenkinsc...@googlegroups.com

Erik-Jan Rieksen Awesome! thanks for the confirmation.

Reply all
Reply to author
Forward
0 new messages