Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 28 07:04

    dependabot[bot] on maven

    (compare)

  • Nov 28 07:04
    dependabot[bot] closed #73
  • Nov 28 07:04
    dependabot[bot] commented #73
  • Nov 28 07:04
    dependabot[bot] labeled #75
  • Nov 28 07:04
    dependabot[bot] labeled #75
  • Nov 28 07:04
    dependabot[bot] opened #75
  • Nov 28 07:04

    dependabot[bot] on maven

    Bump bom-2.332.x from 1678.vc1f… (compare)

  • Nov 21 07:18
    dependabot[bot] labeled #74
  • Nov 21 07:18
    dependabot[bot] labeled #74
  • Nov 21 07:18
    dependabot[bot] opened #74
  • Nov 21 07:18

    dependabot[bot] on maven

    Bump plugin from 4.50 to 4.51 … (compare)

  • Nov 21 07:18
    dependabot[bot] labeled #73
  • Nov 21 07:18
    dependabot[bot] labeled #73
  • Nov 21 07:18
    dependabot[bot] opened #73
  • Nov 21 07:18

    dependabot[bot] on maven

    Bump bom-2.332.x from 1678.vc1f… (compare)

  • Nov 14 11:46

    nrayapati on master

    Bump bom-2.332.x from 1643.v1cf… (compare)

  • Nov 14 11:46

    nrayapati on maven

    (compare)

  • Nov 14 11:46
    nrayapati closed #72
  • Nov 14 11:45

    nrayapati on master

    Bump plugin from 4.48 to 4.50 (… (compare)

  • Nov 14 11:45

    nrayapati on maven

    (compare)

zdrescher
@zdrescher
Hi
I am using this plug in to orchestrate some processes on a remote server.
Using the sshScript step seems to time out for no apparent reason, reports an error to the jenkins server despite the process it kicks off continuing to run.
the only thing it returns is:

Failed command mlops-dev1#56 with status -1: /bin/bash

Command returned exit status -1: /bin/bash

zdrescher
@zdrescher
im noticing that its not displaying some telemetry to stout that i would expect to see
Naresh Rayapati
@nrayapati
It usually prints the return code from the actual command / script being executed, is this a new command did you try some test commands to see if that is working
zdrescher
@zdrescher
So the script has multiple commands and the issue seems to only appear on the last one.
zdrescher
@zdrescher
I am able to confirm that that the exit status isn't coming from the command, as i can confirm that the command continues running after the jenkins pipeline fails and shuts down.
Additionally, I am able to run the command outside the Jenkins context with no errors.
Naresh Rayapati
@nrayapati
sshScript is a bit special and it tries to stream the given script to the node, can you try the sshCommand and see if that is failing too
If this is a already in a file, probably you can try sshPut to place it on to the actual node and the sshCommand as it is local script.
zdrescher
@zdrescher
I see, let me try that
Thanks for the quick feedback!
zdrescher
@zdrescher
That worked! Thanks again!!
Naresh Rayapati
@nrayapati
Thank you for reporting!
zdrescher
@zdrescher
Hmmm actually, I may have spoke too soon...
i am getting a similar error:
Failed command mlops-dev1#69 with status -1: source helps/train.sh
when i run the same script as the same user on the remote
echo $?
returns 0
zdrescher
@zdrescher
So instead of running the command i've been trying i ran something along the lines of "for i in {1..10}; do echo -n \"Loop \$i \"; date ; sleep 1m; done"
the idea is to do something that takes as long as the command to see if it has a similar issue. it doesnt.
I think part of the problem is that the command i am running (a python process) isn't printing to stdout.
It should be but for whatever reason its not.
which maybe what's causing the ssh stream to timeout.
deepak
@deepakts2013

@here : I am tring to execute command remotely via Jenkins Pipeline using sshCommand Step :

sshCommand(remote : remote , command : "/usr/bin/sed -i '/currentURL/c "currentURL" : "https://packages.vmware.com/htb/8d167796-34d5-4899-be0a-6daade4005a3/latest/"'  /./etc/applmgmt/appliance/update.conf")

I end up getting error : 'Unknown command: `/usr/bin/sed''
out put as follows :

Executing command on 192.168.9.197[192.168.9.197]: /usr/bin/sed -i '/currentURL/c "currentURL" : "https://packages.vmware.com/htb/8d167796-34d5-4899-be0a-6daade4005a3/latest/"'  /./etc/applmgmt/appliance/update.conf;/usr/bin/sed -i '/defaultURL/c "defaultURL":  "https://packages.vmware.com/htb/8d167796-34d5-4899-be0a-6daade4005a3/latest/",' /./etc/applmgmt/appliance/update.conf;service-control --restart vlcm; sudo: false
Unknown command: `/usr/bin/sed'
Can anyone help
Benjamin Goldberg
@benjigoldberg
Hi all, I'm encountering an odd error (perhaps user error?) with this plugin. I have something like the following:
withCredentials([sshUserPrivateKey()]) {
    script {
        def remote = [:]
        remote.name = params.TARGET_HOST
        remote.host = params.TARGET_HOST
        remote.user = SSH_USERNAME
        remote.identity_file = SSH_PRIVATE_KEY
        remote.allowAnyHosts = true
        sh "ssh -i ${remote.identity_file} ${remote_user}@${remote.host} 'ls -alh'"
        sshCommand remote: remote, command: 'ls -alh'
    }
}
the first raw sh "ssh..." works fine. However, the sshCommand exits with an error eg com.jcraft.jsch.JSchException: Auth fail
any ideas re: what I might be doing wrong here?
Mohamad Farhan
@MamlukZephyr
Hi I am currently testing the plugin with jenkins master slave setup. When I tried to use the slave at ssh step the process hang even with plain text password. So, my question is, have anyone tried to use master slave setup using this plugin?
sharpedavid
@sharpedavid
@nrayapati Maybe this has been asked before, but would you consider enabling the "Issues" tab on GitHub? https://github.com/jenkinsci/ssh-steps-plugin I think it helps give the project a certain life.
1 reply
sharpedavid
@sharpedavid
Has anyone had any luck using this command with sudo? When I use the supported sudo option, the script just hangs indefinitely. It doesn't prompt interactively, and it doesn't use the existing password
sharpedavid
@sharpedavid

I think I figured it out, actually, I found my answer in the CHANGELOG

sshCommand with sudo:true param also requires pty:true on remote config with this upgrade. (This is only applicable for few platforms like Linux so apply this accordingly)

sharpedavid
@sharpedavid
I found this great video, Jenkins SSH Pipeline Steps Plugin - SpringBoot Deployment, and all the code is on GitHub
Izmar Verhage
@izzyreal
Hi all, I'm trying to use credentials inside one of my sshCommands, is this possible? For example
    withCredentials([
        string(credentialsId: 'credstest', variable: 'TOKEN')
        ]) {        
        stage("SSH") {
            sshCommand remote: remote, command: 'echo ${TOKEN}'
        }
    }
sjothili
@sjothili

How to submit the Jenkins job using curl api and get its buid number ? Note - i tried with the following api, but its not printing any build number.

curl -X POST http://<hostname>:8080/job/<jobname>/build

Hamid
@hamidgholami

Hello all!
I have problem with using SSH Pipeline Step plugin.
Jenkins core version: 2.361.1
SSH Pipeline Steps plugin version: 2.0.39.v831c5e6468b_c
the way that I have created a ssh key pair: "ssh-keygen -m PEM -t rsa -b 4096" (with passphrase)

def remote= [:]
remote.name = test
remote.host = test-mycompony.com
remote.allowAnyHosts = true
node {
 withCredentials([sshUserPrivateKey(credentialsId: 'mySSH', keyFileVariable: 'myIdentity', passphraseVariable: 'myPass', usernameVariable: 'userName')]) {
                      remote.user = userName
                      remote.identityFile = myIdentity
                      remote.passphrase = myPass
                      stage('Post-build: Archive artifacts') {
                          writeFile file: 'abc.sh', text: 'ls'
                          sshCommand remote: remote, command: 'for i in {1..5}; do echo -n \"Loop \$i \"; date ; sleep 1; done'
                          sshPut remote: remote, from: 'abc.sh', into: '.'
                          sshGet remote: remote, from: 'abc.sh', into: 'bac.sh', override: true
                          sshScript remote: remote, script: 'abc.sh'
                          sshRemove remote: remote, path: 'abc.sh'
                      }
                 }
}

I'm just getting Auth fail

com.jcraft.jsch.JSchException: Auth fail

Do you have any idea?