Run a Ansible playbook and trigger publish-over-ssh-plugin exception
Closed this issue · 1 comments
Jenkins and plugins versions report
Environment
Paste the output here
What Operating System are you using (both controller, and any agents involved in the problem)?
Here is the console output:
Started by user admin
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/Deploy_On_Kubernetes
SSH: Connecting from host [jenkins-server]
SSH: Connecting with configuration [Ansible Server] ...
SSH: EXEC: completed after 1,002 ms
SSH: Disconnecting configuration [Ansible Server] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [1]]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
Finished: UNSTABLE
Here is the syslog:
May 29, 2023 2:14:50 PM WARNING jenkins.plugins.publish_over.BPCallablePublisher invoke
Exception when publishing, exception message [Exec exit status not zero. Status [1]]
jenkins.plugins.publish_over.BapPublisherException: Exec exit status not zero. Status [1]
at jenkins.plugins.publish_over_ssh.BapSshClient.exec(BapSshClient.java:443)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:201)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:54)
at jenkins.plugins.publish_over.BapPublisher$Performer.endTransfers(BapPublisher.java:283)
at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:233)
at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205)
at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:65)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:38)
at hudson.FilePath.act(FilePath.java:1198)
at hudson.FilePath.act(FilePath.java:1181)
at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:141)
at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:126)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
at hudson.model.Build$BuildExecution.post2(Build.java:179)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
at hudson.model.Run.execute(Run.java:1925)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
May 29, 2023 2:14:50 PM WARNING jenkins.plugins.publish_over.BPInstanceConfig perform
An exception was caught when invoking perform
jenkins.plugins.publish_over.BapPublisherException: Exec exit status not zero. Status [1]
at jenkins.plugins.publish_over_ssh.BapSshClient.exec(BapSshClient.java:443)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:201)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:54)
at jenkins.plugins.publish_over.BapPublisher$Performer.endTransfers(BapPublisher.java:283)
at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:233)
at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205)
at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:65)
Caused: jenkins.plugins.publish_over.BapPublisherException: Exception when publishing, exception message [Exec exit status not zero. Status [1]]
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:69)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:38)
at hudson.FilePath.act(FilePath.java:1198)
at hudson.FilePath.act(FilePath.java:1181)
at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:141)
at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:126)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
at hudson.model.Build$BuildExecution.post2(Build.java:179)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
at hudson.model.Run.execute(Run.java:1925)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Reproduction steps
- Create a New Item
- Run the following Ansible playbook:
ansible-playbook -i /opt/docker/hosts kube_deploy.yaml;
ansible-playbook -i /opt/docker/hosts kube_service.yaml - Exception triggered
[ansadmin@ansible-server docker]$ cat kube_deploy.yaml
-
hosts: kubernetes
become: true
user: root
tasks:
- name: deploy regapp on kubernetes
command: kubectl apply -f regapp-deployment.yaml
[ansadmin@ansible-server docker]$ cat kube_service.yaml
- name: deploy regapp on kubernetes
-
hosts: kubernetes
become: true
user: root
tasks:
- name: deploy regapp on kubernetes
command: kubectl apply -f regapp-service.yaml
- name: deploy regapp on kubernetes
If I run the playbook on Ansible server, no issue
Expected Results
[ansadmin@ansible-server docker]$ ansible-playbook -i /opt/docker/hosts kube_deploy.yaml
PLAY [kubernetes] ***************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************
[WARNING]: Platform linux on host 172.31.2.201 is using the discovered Python interpreter at /usr/bin/python3, but
future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
ok: [172.31.2.201]
TASK [deploy regapp on kubernetes] **********************************************************************************
changed: [172.31.2.201]
PLAY RECAP **********************************************************************************************************
172.31.2.201 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Actual Results
May 29, 2023 2:14:50 PM WARNING jenkins.plugins.publish_over.BPCallablePublisher invoke
Exception when publishing, exception message [Exec exit status not zero. Status [1]]
jenkins.plugins.publish_over.BapPublisherException: Exec exit status not zero. Status [1]
at jenkins.plugins.publish_over_ssh.BapSshClient.exec(BapSshClient.java:443)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:201)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:54)
at jenkins.plugins.publish_over.BapPublisher$Performer.endTransfers(BapPublisher.java:283)
at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:233)
at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205)
at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:65)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:38)
at hudson.FilePath.act(FilePath.java:1198)
at hudson.FilePath.act(FilePath.java:1181)
at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:141)
at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:126)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
at hudson.model.Build$BuildExecution.post2(Build.java:179)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
at hudson.model.Run.execute(Run.java:1925)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
May 29, 2023 2:14:50 PM WARNING jenkins.plugins.publish_over.BPInstanceConfig perform
An exception was caught when invoking perform
jenkins.plugins.publish_over.BapPublisherException: Exec exit status not zero. Status [1]
at jenkins.plugins.publish_over_ssh.BapSshClient.exec(BapSshClient.java:443)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:201)
at jenkins.plugins.publish_over_ssh.BapSshClient.endTransfers(BapSshClient.java:54)
at jenkins.plugins.publish_over.BapPublisher$Performer.endTransfers(BapPublisher.java:283)
at jenkins.plugins.publish_over.BapPublisher$Performer.perform(BapPublisher.java:233)
at jenkins.plugins.publish_over.BapPublisher$Performer.access$000(BapPublisher.java:205)
at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:158)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:65)
Caused: jenkins.plugins.publish_over.BapPublisherException: Exception when publishing, exception message [Exec exit status not zero. Status [1]]
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:69)
at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:38)
at hudson.FilePath.act(FilePath.java:1198)
at hudson.FilePath.act(FilePath.java:1181)
at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:141)
at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:126)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
at hudson.model.Build$BuildExecution.post2(Build.java:179)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
at hudson.model.Run.execute(Run.java:1925)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Anything else?
No response
Issue has resolved by new commands:
ansible-playbook -i /opt/docker/hosts /opt/docker/kube_deploy.yaml;
ansible-playbook -i /opt/docker/hosts /opt/docker/kube_service.yaml