jenkinsci / publish-over-ssh-plugin

https://plugins.jenkins.io/publish-over-ssh/
115 stars 150 forks source link

Upgrade from 1.20.1 to 1.24 breaks response received back from remote server #300

Closed cmware43 closed 1 year ago

cmware43 commented 1 year ago

Jenkins and plugins versions report

Environment ``` Jenkins: 2.387.1 OS: Linux - 3.10.0-1160.88.1.el7.x86_64 Java: 11.0.18 - Red Hat, Inc. (OpenJDK 64-Bit Server VM) publish-over-ssh:1.24 ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Jenkins is running on Centos7 Build agents are on Windows Server 2012 R2 The remote computer that Publish-over-ssh is connecting to is AWS Linux machine.

Reproduction steps

  1. Jenkins build script is run and uses Publish-over-ssh to run a python script on remote AWS server.
  2. When the job runs, the Jenkins Console displays information from the python script.

Expected Results

Started by user Running as SYSTEM [EnvInject] - Loading node environment variables. Building remotely on build-agent (build-agent-label) in workspace C:\Jenkins\workspace\test-pub-over-ssh SSH: Connecting from host [build-agent] SSH: Connecting with configuration [ec2-user] ... SSH: EXEC: STDOUT/STDERR from command [python HelloWorld.py] ... Hello SSH: EXEC: completed after 402 ms SSH: Disconnecting configuration [ec2-user] ... SSH: Transferred 0 file(s) Build step 'Send files or execute commands over SSH' changed build result to SUCCESS Finished: SUCCESS

Actual Results

Started by user Running as SYSTEM [EnvInject] - Loading node environment variables. Building remotely on build-agent (build-agent-label) in workspace C:\Jenkins\workspace\test-pub-over-ssh SSH: Connecting from host [build-agnet] SSH: Connecting with configuration [ec2-user] ... SSH: EXEC: completed after 403 ms SSH: Disconnecting configuration [ec2-user] ... SSH: Transferred 0 file(s) Build step 'Send files or execute commands over SSH' changed build result to SUCCESS Finished: SUCCESS

Anything else?

We noticed this issue earlier but found a workaround when I upgraded Jenkins to 2.277 LTS. We found that we could modify the publish-over-ssh plugin jar (jenkins\plugins\publish_over_ssh\BapSshPublisher\config.jelly, jenkins\plugins\publish_over_ssh\BapSshPublisherPlugin\config.jelly, and jenkins\plugins\publish_over_ssh\BapSshPublisherPlugin\global.jelly) with information from the 1.22 version of publish-over-ssh, to fix issues in the Jenkins configuration page while still keeping the behavior of seeing the output from the python script in the Jenkins Console.
I don't know if the new plugin is now expecting some other information to be able to display the data received back from the remote server or not. I just know as soon as we go beyond my modified 1.20.1 version of publish-over-ssh, we lose the ability to see the information.

The results above are the simplest result of the actual script we are running. Here is the python script to produce the results above:

!/usr/bin/python

print "Hello"

As you can see in the actual results section above, the python command and its output are missing from any version over 1.20.1. SSH: EXEC: STDOUT/STDERR from command [python HelloWorld.py] ... Hello

cmware43 commented 1 year ago

Sorry for the ticket. I just now found a link to this issue after searching for weeks.
Needed to check the Verbose output in console under the Advanced button.