# WINRM Connection always ends up with "STDERR An error occurred while creating the pipeline"

**URL:** <https://forum.ansible.com/t/winrm-connection-always-ends-up-with-stderr-an-error-occurred-while-creating-the-pipeline/26581>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 29, 2018, 7:05am UTC](https://forum.ansible.com/t/winrm-connection-always-ends-up-with-stderr-an-error-occurred-while-creating-the-pipeline/26581 "2018-01-29T07:05:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremie\_Levy](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jeremie\_Levy](https://forum.ansible.com/u/Jeremie_Levy)\
**Post date:** [January 29, 2018, 7:05am UTC](https://forum.ansible.com/t/winrm-connection-always-ends-up-with-stderr-an-error-occurred-while-creating-the-pipeline/26581/1 "2018-01-29T07:05:34Z")

</div>

Hi  
Any task i run is followed by this WINRM error  
I am not sure it’s an error since the task is done successfully, does someone knows about this?

`

TASK [Create KIT folder if missing] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /ansible/scripts/vs2012.yaml:5  
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/win\_file.ps1  
 ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5986 TO hasjrwts02  
creating Kerberos CC at /tmp/tmpnaEGzD  
calling kinit for principal ansible  
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/win\_file.ps1  
 ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5986 TO hasjrwts01  
creating Kerberos CC at /tmp/tmpDGNECq  
calling kinit for principal ansible  
kinit succeeded for principal ansible  
 WINRM CONNECT: transport=kerberos endpoint=[https://hasjrwts02:5986/wsman](https://hasjrwts02:5986/wsman)  
kinit succeeded for principal ansible  
 WINRM CONNECT: transport=kerberos endpoint=[https://hasjrwts01:5986/wsman](https://hasjrwts01:5986/wsman)  
 WINRM OPEN SHELL: F95EFA87-3A14-4F69-AC9B-2BD43120BC93  
EXEC (via pipeline wrapper)  
 WINRM EXEC ‘PowerShell’ [‘-NoProfile’, ‘-NonInteractive’, ‘-ExecutionPolicy’, ‘Unrestricted’, ‘-’]  
 WINRM OPEN SHELL: 421A5D1E-4BC3-42C9-8E02-4B8F28EBDDD7  
EXEC (via pipeline wrapper)  
 WINRM EXEC ‘PowerShell’ [‘-NoProfile’, ‘-NonInteractive’, ‘-ExecutionPolicy’, ‘Unrestricted’, ‘-’]  
 WINRM RESULT u’\<Response code 0, out “{“changed”:true}\r\n”, err “An error occurred wh”\>’  
 WINRM STDOUT {“changed”:true}

WINRM STDERR An error occurred while creating the pipeline.

- CategoryInfo : NotSpecified: (🙂 , ParentContainsErrorRecordException
- FullyQualifiedErrorId : RuntimeException

WINRM CLOSE SHELL: F95EFA87-3A14-4F69-AC9B-2BD43120BC93  
 WINRM RESULT u’\<Response code 0, out “{“changed”:true}\r\n”, err “An error occurred wh”\>’  
 WINRM STDOUT {“changed”:true}

WINRM STDERR An error occurred while creating the pipeline.

- CategoryInfo : NotSpecified: (🙂 , ParentContainsErrorRecordException
- FullyQualifiedErrorId : RuntimeException

WINRM CLOSE SHELL: 421A5D1E-4BC3-42C9-8E02-4B8F28EBDDD7  
changed: [hasjrwts02] =\> {  
“changed”: true  
}  
changed: [hasjrwts01] =\> {  
“changed”: true  
}

`

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [January 29, 2018, 7:33am UTC](https://forum.ansible.com/t/winrm-connection-always-ends-up-with-stderr-an-error-occurred-while-creating-the-pipeline/26581/2 "2018-01-29T07:33:23Z")

</div>

This is a known issue, technically an error did occur but it does not affect the actual module execution. It was fixed a while ago in the devel branch for the 2.5 release but was only recently back ported to 2.4 and will be available in the 2.4.4 release.

2.5 commit

[https://github.com/ansible/ansible/commit/7fce636c2b250aa6ffd7322f03a0c982ecd802e3#diff-9b6915232549a7bcd00b8b8f142b7232](https://github.com/ansible/ansible/commit/7fce636c2b250aa6ffd7322f03a0c982ecd802e3#diff-9b6915232549a7bcd00b8b8f142b7232)

2.4.4 commit

[https://github.com/ansible/ansible/commit/e27847eda8d1ea05da8a1b96e085f41134faff94](https://github.com/ansible/ansible/commit/e27847eda8d1ea05da8a1b96e085f41134faff94)

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Jeremie\_Levy](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jeremie\_Levy](https://forum.ansible.com/u/Jeremie_Levy)\
**Post date:** [January 29, 2018, 7:56am UTC](https://forum.ansible.com/t/winrm-connection-always-ends-up-with-stderr-an-error-occurred-while-creating-the-pipeline/26581/3 "2018-01-29T07:56:11Z")

</div>

Thank you Jordan, really appreciate.  
I am still not sure it doesn’t affect module execution, i have some issues executing win\_package. Maybe not related.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [January 29, 2018, 8:11am UTC](https://forum.ansible.com/t/winrm-connection-always-ends-up-with-stderr-an-error-occurred-while-creating-the-pipeline/26581/4 "2018-01-29T08:11:15Z")

</div>

It wouldn’t be, those issue seem to be unrelated. In most cases a fatal exception will return a return code that is not 0, in this case rc is still 0.

Thanks

---

<div class="post-metadata">

**Author:** ![Jeremie\_Levy](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jeremie\_Levy](https://forum.ansible.com/u/Jeremie_Levy)\
**Post date:** [January 29, 2018, 2:50pm UTC](https://forum.ansible.com/t/winrm-connection-always-ends-up-with-stderr-an-error-occurred-while-creating-the-pipeline/26581/5 "2018-01-29T14:50:03Z")

</div>

You were right, my issue was in my code.  
I’ve “patched” my ansible with the github version and i don’t have the error anymore.  
Thanks a lot!
