[JIRA] (JENKINS-54557) hudson.AbortException: Ansible playbook execution failed

41 views
Skip to first unread message

jrvilda@gmail.com (JIRA)

unread,
Nov 9, 2018, 9:24:02 AM11/9/18
to jenkinsc...@googlegroups.com
Josu Rodriguez created an issue
 
Jenkins / Bug JENKINS-54557
hudson.AbortException: Ansible playbook execution failed
Issue Type: Bug Bug
Assignee: Jean-Christophe Sirot
Components: ansible-plugin
Created: 2018-11-09 14:23
Priority: Minor Minor
Reporter: Josu Rodriguez

Faild always

$ /usr/bin/ansible-playbook /etc/ansible/playbooks/tools/Check_hostname.yml -i host -f 5

PLAY [all] *********************************************************************

TASK [Gathering Facts] ********************************************************

.......

TASK [Comprobando nombre equipo] ***********************************************

.....

PLAY RECAP *********************************************************************

.......

w********p           : ok=0    changed=0    unreachable=1    failed=0   

FATAL: command execution failedhudson.AbortException: Ansible playbook execution failed at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:236) at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:207) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490) at hudson.model.Run.execute(Run.java:1735) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405)

ERROR: Ansible playbook execution failed
Archiving artifacts
Recording test results
Finished: FAILURE

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jrvilda@gmail.com (JIRA)

unread,
Nov 9, 2018, 9:27:02 AM11/9/18
to jenkinsc...@googlegroups.com
Josu Rodriguez updated an issue
Change By: Josu Rodriguez
Faild always
{code:java}
// code placeholder
$ /usr/bin/ansible-playbook /etc/ansible/playbooks/tools/Check_hostname.yml -i host -f 5

PLAY [all] *********************************************************************

TASK [Gathering Facts] ********************************************************

.......

TASK [Comprobando nombre equipo] ***********************************************

.....

PLAY RECAP *********************************************************************

.......

w********p           : ok=0    changed=0    unreachable=1    failed=0   


FATAL: command execution failedhudson.AbortException: Ansible playbook execution failed at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:236) at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:207) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490) at hudson.model.Run.execute(Run.java:1735) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405)

ERROR: Ansible playbook execution failed
Archiving artifacts
Recording test results
Finished: FAILURE
{code}
 

 

 

jrvilda@gmail.com (JIRA)

unread,
Nov 9, 2018, 9:31:02 AM11/9/18
to jenkinsc...@googlegroups.com
Josu Rodriguez updated an issue
Faild always

Jenkins ver. 2.60.1 under Windows
jenkins agent under linux:


{code:java}
ansible 2.7.0
  config file =
/ etc / ansible/ansible.cfg
  configured module search path = [u'/etc/ansible/my_modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
{
code }
 

run from jenkins:

 
{code:java}
// code
placeholder

$ /usr/bin/ansible-playbook /etc/ansible/playbooks/tools/Check_hostname.yml -i host -f 5
PLAY [all] *********************************************************************
TASK [Gathering Facts] ********************************************************
.......
TASK [Comprobando nombre equipo] ***********************************************
.....
PLAY RECAP *********************************************************************
.......
w********p           : ok=0    changed=0    unreachable=1    failed=0   
FATAL: command execution failedhudson.AbortException: Ansible playbook execution failed at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:236) at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:207) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:735) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490) at hudson.model.Run.execute(Run.java:1735) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405)
ERROR: Ansible playbook execution failed
Archiving artifacts
Recording test results
Finished: FAILURE
{code}
 

  Run in host:



 
{code:java}
// marcador de posición de código

{code}
 

 

jrvilda@gmail.com (JIRA)

unread,
Nov 9, 2018, 9:32:02 AM11/9/18
to jenkinsc...@googlegroups.com
// marcador de posición de código code placeholder
$ /usr/bin/ansible-playbook /etc/ansible/playbooks/tools/Check_hostname.yml -i host -f 5
PLAY [all] *********************************************************************
TASK [Gathering Facts] ********************************************************
.......
TASK [Comprobando nombre equipo] ***********************************************
.....
PLAY RECAP *********************************************************************
.......
w********p           : ok=0    changed=0    unreachable=1    failed=0   
#
{code}
 

 

paulius@devnull.lt (JIRA)

unread,
Dec 3, 2018, 10:57:02 AM12/3/18
to jenkinsc...@googlegroups.com
Paulius Bulotas commented on Bug JENKINS-54557
 
Re: hudson.AbortException: Ansible playbook execution failed

I can add that we are also experiencing such issue with Jenkins master/slave on latest Centos 7, running Jenkins 2.138.3.

Thread dump looks like:

FATAL: command execution failed


hudson.AbortException: Ansible playbook execution failed

at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262)
at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:400)
at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:321)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

This started happening in middle of November after some plugin update. All runs fail in less than 4 minutes (not sure if it's related to some timeout).

ansible 2.7.2
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/.../.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']


ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible

python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

nicolas.menetrier@gmail.com (JIRA)

unread,
Dec 3, 2018, 11:12:02 AM12/3/18
to jenkinsc...@googlegroups.com

We are experiencing the same issue as Paulius Bulotas when using the ansible plugin (since the beginning or middle of November too).
At the same time we noticed that the last lines of the ansible playbook were missing when the playbook was exiting in error state when played on a jenkins non master node.
And it is really complicated to understand the playbooks issues without the last log lines.
We found a dirty fix by adding a Thread.Sleep in AnsiblePlaybookBuilder.java, before throwing the exceptions in the perform function.

    public void perform(@Nonnull Run<?, ?> run, @Nonnull Node node, @Nonnull FilePath ws, @Nonnull Launcher launcher, @Nonnull TaskListener listener, EnvVars envVars)
            throws InterruptedException, IOException
    {
        try {
            CLIRunner runner = new CLIRunner(run, ws, launcher, listener);
            String exe = AnsibleInstallation.getExecutable(ansibleName, AnsibleCommand.ANSIBLE_PLAYBOOK, node, listener, envVars);
            AnsiblePlaybookInvocation invocation = new AnsiblePlaybookInvocation(exe, run, ws, listener, envVars);
            invocation.setPlaybook(playbook);
            invocation.setInventory(inventory);
            invocation.setLimit(limit);
            invocation.setTags(tags);
            invocation.setSkippedTags(skippedTags);
            invocation.setStartTask(startAtTask);
            invocation.setBecome(become, becomeUser);
            invocation.setSudo(sudo, sudoUser);
            invocation.setForks(forks);
            invocation.setCredentials(StringUtils.isNotBlank(credentialsId) ?
                CredentialsProvider.findCredentialById(credentialsId, StandardUsernameCredentials.class, run) : null,
                copyCredentialsInWorkspace);
            invocation.setVaultCredentials(StringUtils.isNotBlank(vaultCredentialsId) ?
                CredentialsProvider.findCredentialById(vaultCredentialsId, StandardCredentials.class, run) : null);
            invocation.setExtraVars(extraVars);
            invocation.setAdditionalParameters(additionalParameters);
            invocation.setDisableHostKeyCheck(disableHostKeyChecking);
            invocation.setUnbufferedOutput(unbufferedOutput);
            invocation.setColorizedOutput(colorizedOutput);
            if (!invocation.execute(runner)) {
                throw new AbortException("Ansible playbook execution failed");
            }
        } catch (IOException ioe) {
            Thread.sleep(10000);
            Util.displayIOException(ioe, listener);
            ioe.printStackTrace(listener.fatalError(hudson.tasks.Messages.CommandInterpreter_CommandFailed()));
            throw ioe;
        } catch (AnsibleInvocationException aie) {
            Thread.sleep(10000);
            listener.fatalError(aie.getMessage());
            throw new AbortException(aie.getMessage());
        }
    }

nicolas.menetrier@gmail.com (JIRA)

unread,
Dec 3, 2018, 11:14:02 AM12/3/18
to jenkinsc...@googlegroups.com
Nicolas MENETRIER edited a comment on Bug JENKINS-54557
We are experiencing the same issue as [~aulius] when using the ansible plugin (since the beginning or middle of November too).
At the same time we noticed that the last
log lines of the ansible playbook were missing when the playbook was exiting in error state when played on a jenkins non master  jenkins node.

And it is really complicated to understand the playbooks issues without the last log lines.
We found a dirty fix by adding a Thread.Sleep in AnsiblePlaybookBuilder.java, before throwing the exceptions in the perform function.
{code:java}
{code}

talliskane@gmail.com (JIRA)

unread,
Dec 4, 2018, 6:06:02 PM12/4/18
to jenkinsc...@googlegroups.com

Experiencing the same as Paulius Bulotas

Latest Centos 7, running Jenkins 2.138.3, but Ansible 2.4

neil.calverley@mdscem.com (JIRA)

unread,
Dec 14, 2018, 12:03:03 PM12/14/18
to jenkinsc...@googlegroups.com

Another one here, experiencing same issue as Paulius Bulotas and seems to be related to a recent Jenkins update.

I have 2 Jenkins instances, one running v2.138.1 with Ansible Plugin v1.0 which is working fine.

The other running Jenkins v2.1.50.1 and Ansible Plugin v1.0 which shows the same issue as above.

 

neil.calverley@mdscem.com (JIRA)

unread,
Dec 14, 2018, 12:06:02 PM12/14/18
to jenkinsc...@googlegroups.com
Neil Calverley edited a comment on Bug JENKINS-54557
Another one here, experiencing same issue as Paulius Bulotas and seems to be related to a recent Jenkins update.

I have 2 Jenkins instances, one running v2.138.1 with Ansible Plugin v1.0 which is working fine.

The other running Jenkins v2.1.50.1 and Ansible Plugin v1.0 which shows the same issue as above.

  Both tested running the same version of ansible v2.7.2 on same Linux host.

mdebruyn@tripadvisor.com (JIRA)

unread,
Dec 19, 2018, 2:02:02 AM12/19/18
to jenkinsc...@googlegroups.com

Another one here:

FATAL: command execution failed
hudson.AbortException: Ansible playbook execution failed
	at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262)
	at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:400)
	at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:321)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
	at hudson.security.ACL.impersonate(ACL.java:290)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748) 

Centos 7.6

Jenkins 2.154

Ansible 2.74

Ansible plugin 1.0

mdebruyn@tripadvisor.com (JIRA)

unread,
Dec 19, 2018, 2:08:02 AM12/19/18
to jenkinsc...@googlegroups.com
Mike DeBruyn edited a comment on Bug JENKINS-54557
Another one here:
{noformat}

FATAL: command execution failed
hudson.AbortException: Ansible playbook execution failed
at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262)
at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:400)
at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:321)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) {noformat}
Centos 7.6

Jenkins 2.
154 156

Ansible 2.74

Ansible plugin 1.0

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:18:03 AM12/28/18
to jenkinsc...@googlegroups.com

Hello! I have problem too.

I ran playbook with ansible jenkins pluginю
If all tasks are SUCCES, jenkins build is SUCCES too.

BUT if any task is FAILED or UNREACHABLE, i see "hudson.AbortException Ansible playbook execution failed" in console.

Is this error is the same that in start topic?

 

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:21:02 AM12/28/18
to jenkinsc...@googlegroups.com
Nikita Nadezhin edited a comment on Bug JENKINS-54557
Hello! I have problem too.

I ran playbook with ansible jenkins pluginю
If all tasks are SUCCES, jenkins build is SUCCES too.

BUT if any task is FAILED or UNREACHABLE, i see "hudson.AbortException Ansible playbook execution failed" in console.

Is this error is the same that in start topic?

 

!Скриншот от 2018 - 12 - 28 16-03-56.png!

piipel

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:22:02 AM12/28/18
to jenkinsc...@googlegroups.com

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:22:03 AM12/28/18
to jenkinsc...@googlegroups.com
Nikita Nadezhin updated an issue
 
Change By: Nikita Nadezhin
Comment: UPD.

!Скриншот от 2018-12-28 16-03-56.png!

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:23:01 AM12/28/18
to jenkinsc...@googlegroups.com

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:28:02 AM12/28/18
to jenkinsc...@googlegroups.com
Nikita Nadezhin edited a comment on Bug JENKINS-54557
UPD . For some reason, I can't attach screenshot. I uploaded it [here https://photos.app.goo.gl/9gXvttYMPaAVxkex8|https://photos.app.goo.gl/9gXvttYMPaAVxkex8]

!Скриншот от 2018-12-28 16-03-56.jpg!

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:28:03 AM12/28/18
to jenkinsc...@googlegroups.com

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:28:04 AM12/28/18
to jenkinsc...@googlegroups.com
Nikita Nadezhin updated an issue
Change By: Nikita Nadezhin
Comment: !Скриншот от 2018-12-28 16-03-56.jpg!

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:29:02 AM12/28/18
to jenkinsc...@googlegroups.com
Nikita Nadezhin edited a comment on Bug JENKINS-54557
Hello! I have problem too.

I ran playbook with ansible jenkins
pluginю
plugin.
If all tasks are SUCCES, jenkins build is SUCCES too.

BUT if any task is FAILED or UNREACHABLE, i see "hudson.AbortException Ansible playbook execution failed" in console.

Is this error is the same that in start topic?

 

--

piipel

hcppfl@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:34:04 AM12/28/18
to jenkinsc...@googlegroups.com
Nikita Nadezhin edited a comment on Bug JENKINS-54557
Hello! I have problem too.

I ran playbook with ansible jenkins plugin.

If all tasks are SUCCES, jenkins build is SUCCES too.

BUT if any task is FAILED or UNREACHABLE, i see "hudson.AbortException Ansible playbook execution failed" in console.

Is this error
is the same that in start topic?

 



piipel

hcppfl@gmail.com (JIRA)

unread,
Dec 29, 2018, 1:17:03 AM12/29/18
to jenkinsc...@googlegroups.com

cvaziri1@gmail.com (JIRA)

unread,
Feb 3, 2019, 1:38:02 PM2/3/19
to jenkinsc...@googlegroups.com
Cyrus Vaziri commented on Bug JENKINS-54557
 
Re: hudson.AbortException: Ansible playbook execution failed

I have encountered the same issue, and I can confirm that the 'dirty fix' Nicolas MENETRIER mentioned does indeed work.  The two additions of thread.sleep in AnsiblePlaybookBuilder.java allow the ansible errors to appear in the output again when the error occurs from a jenkins slave node.

nicolas.menetrier@gmail.com (JIRA)

unread,
Feb 4, 2019, 8:42:02 AM2/4/19
to jenkinsc...@googlegroups.com
Nicolas MENETRIER edited a comment on Bug JENKINS-54557
We are experiencing the same issue as [~aulius] when using the ansible plugin (since the beginning or middle of November too).
At the same time we noticed that the last log lines of the ansible playbook were missing when the playbook was exiting in error state when played on a non master jenkins slave node.

karl.dean.parry@gmail.com (JIRA)

unread,
Feb 7, 2019, 12:00:02 PM2/7/19
to jenkinsc...@googlegroups.com

We have this issue (we have RedHat 7 master and slaves). As we use shared libraries we have add a post clean up step to "sh sleep 5". It gives enough time for the log to then be printed before the job terminates. You get the abort, then sleeps 5s (while sleeping error is printed), then exits. 

It works but far from ideal

 

karl.dean.parry@gmail.com (JIRA)

unread,
Feb 7, 2019, 12:02:02 PM2/7/19
to jenkinsc...@googlegroups.com
Karl Parry edited a comment on Bug JENKINS-54557
We have this issue (we have RedHat 7 master and slaves). As we use shared libraries we have add a post clean up step to "sh sleep 5". It gives enough time for the log to then be printed before the job terminates. You get the abort, then sleeps 5s (while sleeping error is printed), then exits. 

It _It works but far from ideal

 
ideal_

badie.saliba@hotmail.com (JIRA)

unread,
Mar 15, 2019, 6:51:02 AM3/15/19
to jenkinsc...@googlegroups.com
badie saliba updated an issue
 
Change By: badie saliba
Attachment: image-2019-03-15-12-50-23-763.png

badie.saliba@hotmail.com (JIRA)

unread,
Mar 15, 2019, 6:57:03 AM3/15/19
to jenkinsc...@googlegroups.com
badie saliba commented on Bug JENKINS-54557
 
Re: hudson.AbortException: Ansible playbook execution failed

Hi,

We have the same issue.

We are using Jenkins 2.150.3 running on CentOS 6.9 OS.
Ansible plugin version : 1.0
Ansible version: 2.3.2.0

 

stanton.burchett@janushenderson.com (JIRA)

unread,
Mar 18, 2019, 11:58:09 AM3/18/19
to jenkinsc...@googlegroups.com
Stanton B assigned an issue to Stanton B
 
Change By: Stanton B
Assignee: Jean-Christophe Sirot Stanton B

stanton.burchett@janushenderson.com (JIRA)

unread,
Mar 18, 2019, 11:58:15 AM3/18/19
to jenkinsc...@googlegroups.com
Stanton B assigned an issue to Jean-Christophe Sirot
Change By: Stanton B
Assignee: Stanton B Jean-Christophe Sirot

jui.chandwaskar@tobii.com (JIRA)

unread,
Mar 21, 2019, 11:48:07 AM3/21/19
to jenkinsc...@googlegroups.com
Jui Chandwaskar commented on Bug JENKINS-54557
 
Re: hudson.AbortException: Ansible playbook execution failed

Hello,

We are using Jenkins Version: 2.138.2 running on Ubuntu 16.04

Ansible plugin version: 1.0

Ansible version: 2.7.9

We have the same issue. It appears on different task sporadically.
like once trying to run a bash script with command module and the other time with ansible template module.

  • name: Run script
    become: yes
    shell: ./test_script.sh
    args:
    chdir: "{{ jenkins_home }}"
  • name: Create new configuration
    become: yes
    template: src={{ config_template }}.j2 dest={{ user_home }}/{{ config_template }} backup=yes

Error while running task for template module:
TASK [configure_test_jenkins : Create new configuration] ***********************16:28:10 FATAL: command execution failed*16:28:10* hudson.AbortException: Ansible playbook execution failed*16:28:10* at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262)16:28:10 at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:400)16:28:10 at org.jenkinsci.plugins.ansible.workflow.AnsiblePlaybookStep$AnsiblePlaybookExecution.run(AnsiblePlaybookStep.java:321)16:28:10 at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)16:28:10 at hudson.security.ACL.impersonate(ACL.java:290)16:28:10 at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)16:28:10 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)16:28:10 at java.util.concurrent.FutureTask.run(FutureTask.java:266)16:28:10 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)16:28:10 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)16:28:10 at java.lang.Thread.run(Thread.java:748)

matthew.k.smith@viasat.com (JIRA)

unread,
Apr 5, 2019, 12:00:02 PM4/5/19
to jenkinsc...@googlegroups.com

We also see this issue.

Ansible Plugin version 1.0

Jenkins Version: 2.164.1

Surprisingly, downgrading the Ansible Plugin to version 0.6.2 didn't even fix the issue. 

DCHSUEH@GMAIL.COM (JIRA)

unread,
Apr 16, 2019, 2:45:02 PM4/16/19
to jenkinsc...@googlegroups.com

I'm seeing this as well.  Strikes at different places during the playbook execution.

 

jenkins-2.164

ansible-1.0

 

t.vanderhaegen@pixid.fr (JIRA)

unread,
Apr 18, 2019, 8:22:02 AM4/18/19
to jenkinsc...@googlegroups.com

I also have this issue

Jenkins ver. 2.153

Ansible plugin 1.0

kingright@126.com (JIRA)

unread,
Apr 26, 2019, 3:51:02 AM4/26/19
to jenkinsc...@googlegroups.com
Roc King commented on Bug JENKINS-54557

I got the same issue. The same playbook command can run successfully in command line. But failed in Jenkins.

Jenkins version: 2.164.1

Ansible plugin 1.0

Anyone knows the root cause? 

 

kingright@126.com (JIRA)

unread,
Apr 26, 2019, 4:09:02 AM4/26/19
to jenkinsc...@googlegroups.com
Roc King edited a comment on Bug JENKINS-54557
I got the same issue. The same playbook command can run successfully in command line. But failed in Jenkins.

Jenkins version: 2.164.1

Ansible plugin 1.0

Anyone knows the root cause [~sirot], this is a sev 1 issue, could you please help to investigate this ?   Thanks.

 

ananda.bhavaraju@teradata.com (JIRA)

unread,
Jun 7, 2019, 3:57:08 AM6/7/19
to jenkinsc...@googlegroups.com

I got the same issue.

But I found a work around in my case.

I wrote a rescue block in the end of my playbook to ensure that the pipeline continues execution

Then I enabled ansible log in ansible configuration file.

I wrote a python snippet to parse my ansible configuration and create retry file.( based on fail >0)

This way we can ensure that the pipeline execution doesn't stop.

 

nagulmeera.linux@gmail.com (JIRA)

unread,
Jun 17, 2019, 12:33:03 PM6/17/19
to jenkinsc...@googlegroups.com

Hi Team,

I have created the job to deploy AKS on Azure using Ansible 

Here is my environment details:

Ansible Version: 2.5.1

Jenkins Version:  2.180

once I start the build getting below error:

 

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Do you have packaging installed? Try `pip install packaging`- No module named packaging.version"}fatal: [localhost]: FAILED! => {"changed": false, "msg": "Do you have packaging installed? Try `pip install packaging`- No module named packaging.version"} to retry, use: --limit @/var/lib/jenkins/workspace/K8s/aks-azure-cni.retry
PLAY RECAP *********************************************************************localhost                  : ok=1    changed=0    unreachable=0    failed=1   
FATAL: command execution failedhudson.AbortException: Ansible playbook execution failed at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262) at org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:232) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1818) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)ERROR: Ansible playbook execution failedFinished: FAILURE

 

Please let me know the changes I have to do.

Thanks & Regards

Shaik.Nagulameera

 

nowak@silpion.de (JIRA)

unread,
Jun 20, 2019, 5:44:05 AM6/20/19
to jenkinsc...@googlegroups.com

I also had this error when using the Ansible plugin, but I figured it was due to unreachable errors (since the return code of ansible-playbook is 4 instead of 0 when at least one host is unreachable). Since Ansible 2.7, the keyword ignore_unreachable = yes 

 

 

nowak@silpion.de (JIRA)

unread,
Jun 20, 2019, 5:46:11 AM6/20/19
to jenkinsc...@googlegroups.com
Max Nowak edited a comment on Bug JENKINS-54557
I also had this error when using the Ansible plugin, but I figured it was due to unreachable errors (since the return code of ansible-playbook is 4 instead of 0 when at least one host is unreachable). Since Ansible 2.7, the keyword {{ignore_unreachable = yes   }}


 

 
is usable in playbooks / tasks, which results in Ansible returning 0 even if hosts are unreachable. This fixed the issue for me and the Jenkins job continued to execute.

nowak@silpion.de (JIRA)

unread,
Jun 20, 2019, 5:46:11 AM6/20/19
to jenkinsc...@googlegroups.com

zolvaring@gmail.com (JIRA)

unread,
Aug 20, 2019, 12:08:03 PM8/20/19
to jenkinsc...@googlegroups.com

Has there been any update to this? We use other tools for simple Ansible jobs for complex pipelines we need access to basic error handling in Ansible.

zolvaring@gmail.com (JIRA)

unread,
Aug 20, 2019, 12:25:02 PM8/20/19
to jenkinsc...@googlegroups.com
Justin Heil edited a comment on Bug JENKINS-54557
Has there been any update to this? We use other tools for simple Ansible jobs for complex pipelines we need access to basic error handling in Ansible.


I'm experiencing the issue with Ansible plugin 1.0, and my specific issue is Jenkins seeming to error before triggering or completely bypass rescue blocks that otherwise work in CLI
Reply all
Reply to author
Forward
0 new messages