# Issue on Ansible Playbook Run When Calling WinRM - ConnectionError ('Connection aborted.', OSError("(104, 'ECONNRESET')",))

**URL:** <https://forum.ansible.com/t/issue-on-ansible-playbook-run-when-calling-winrm-connectionerror-connection-aborted-oserror-104-econnreset/36091>\
**Category:** Ansible Project\
**Created:** [December 9, 2021, 12:08pm UTC](https://forum.ansible.com/t/issue-on-ansible-playbook-run-when-calling-winrm-connectionerror-connection-aborted-oserror-104-econnreset/36091 "2021-12-09T12:08:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panos\_Eracleous](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@Panos\_Eracleous](https://forum.ansible.com/u/Panos_Eracleous)\
**Post date:** [December 9, 2021, 12:08pm UTC](https://forum.ansible.com/t/issue-on-ansible-playbook-run-when-calling-winrm-connectionerror-connection-aborted-oserror-104-econnreset/36091/1 "2021-12-09T12:08:14Z")

</div>

We’re currently using Ansible 2.9.15 through Tower 3.8.0. We’re seeing an issue when targeting new builds on Window Server 2016 through WinRM.

The issue happens at the start of the Playbook and soon after a Join Domain + Reboot Step. It often happens in this order – although there are some discrepancies at exactly which point we see the problem:

win\_domain\_membership

win\_reboot

win\_firewall:

state: disabled

profiles:

- Domain

- Private

- Public

win\_regedit:

path: HKLM:\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters

name: DisabledComponents

data: 0xffffffff

type: dword

state: present

win\_command: netsh int tcp set global chimney=disabled

win\_command: netsh int tcp set global rss=disabled

win\_regedit:

path: HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

name: EnableTCPA

data: 0

type: DWord

state: present

Quite often Ansible will get stuck on the last task with:

[WARNING]: ERROR DURING WINRM SEND INPUT - attempting to recover:

ConnectionError (‘Connection aborted.’, OSError(“(104, ‘ECONNRESET’)”,))

There are quite a lot changes going on the server at this point but I can’t see any obvious issues that tie up to the time of the error on Ansible.

It never seems to recover from this and I have to Cancel the job. If I re-run the job everything works fine. I can see that there’s a lot going on with the Network stack at the time which may cause an issue but I’d like to see if I can narrow it down to see if we can handle the issue or ideally get Ansible to recover/retry on its own. Are there any suggestions on what the issue may be or on how to best proceed with debugging?

Many thanks.

Best regards,

Panos

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [December 9, 2021, 2:21pm UTC](https://forum.ansible.com/t/issue-on-ansible-playbook-run-when-calling-winrm-connectionerror-connection-aborted-oserror-104-econnreset/36091/2 "2021-12-09T14:21:21Z")

</div>

Without any knowledge of windows at all, connection abortion after/during a task that changes something with Tcpip\Parameters in its name… sounds like sawing off the branch that you’re sitting on.  
In that sense I’m surprised it doesn’t happen all the time.

Isn’t there a way to have such a change applied at next boot time ?

---

<div class="post-metadata">

**Author:** ![Panos\_Eracleous](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@Panos\_Eracleous](https://forum.ansible.com/u/Panos_Eracleous)\
**Post date:** [December 9, 2021, 2:51pm UTC](https://forum.ansible.com/t/issue-on-ansible-playbook-run-when-calling-winrm-connectionerror-connection-aborted-oserror-104-econnreset/36091/3 "2021-12-09T14:51:03Z")

</div>

If I could narrow down exactly which change is causing the problem I can wrap it up/run it separately. The problem is that it’s not easily reproducible and the task it actually fails on (win\_regedit) is pretty innocuous.

If I could get Ansible to error/carry on it would also be a start. But the issue is that Ansible sits there waiting for something.

Best regards,

Panos
