# Windows Tag MisMatch

**URL:** <https://forum.ansible.com/t/windows-tag-mismatch/18362>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 31, 2015, 3:59pm UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362 "2015-05-31T15:59:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![deloreandave](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@deloreandave](https://forum.ansible.com/u/deloreandave)\
**Post date:** [May 31, 2015, 3:59pm UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/1 "2015-05-31T15:59:33Z")

</div>

I can’t seem to get anything to work over winrm. I keep getting this error no matter what I try. I have run the setup scripts.

[ansible-stuff]$ ansible -i inventory windows7-ansible4 -m setup -vvvv  
 ESTABLISH WINRM CONNECTION FOR USER: stew on PORT 5986 TO windows7-ansible4  
 WINRM CONNECT: transport=plaintext endpoint=[https://windows7-ansible4:5986/wsman](https://windows7-ansible4:5986/wsman)  
 REMOTE\_MODULE setup  
 EXEC (New-Item -Type Directory -Path $env:temp -Name “ansible-tmp-1433087659.28-74445365416872”).FullName | Write-Host -Separator ‘’;  
 WINRM EXEC ‘PowerShell’ [‘-NoProfile’, ‘-NonInteractive’, ‘-EncodedCommand’, ‘KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMwAzADAAOAA3ADYANQA5AC4AMgA4AC0ANwA0ADQANAA1ADMANgA1ADQAMQA2ADgANwAyACIAKQAuAEYAdQBsAGwATgBhAG0AZQAgAHwAIABXAHIAaQB0AGUALQBIAG8AcwB0ACAALQBTAGUAcABhAHIAYQB0AG8AcgAgACcAJwA7AA==’]  
Traceback (most recent call last):  
File “/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/winrm.py”, line 161, in exec\_command  
result = self.\_winrm\_exec(cmd\_parts[0], cmd\_parts[1:], from\_exec=True)  
File “/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/winrm.py”, line 122, in \_winrm\_exec  
self.shell\_id = self.protocol.open\_shell()  
File “/usr/lib/python2.6/site-packages/winrm/protocol.py”, line 121, in open\_shell  
root = ET.fromstring(rs)  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 963, in XML  
parser.feed(text)  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 1245, in feed  
self.\_parser.Parse(data, 0)  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 1188, in \_end  
return self.\_target.end(self.\_fixname(tag))  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 1096, in end  
self.\_last.tag, tag)  
AssertionError: end tag mismatch (expected ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒𐁽▒▒n򤃰򥷠▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒羸򩻀򫌀 򥸀󳱰, got ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒𐁽▒▒n▒▒2B▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⸾)  
windows7-ansible4 | FAILED =\> failed to exec cmd PowerShell -NoProfile -NonInteractive -EncodedCommand KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMwAzADAAOAA3ADYANQA5AC4AMgA4AC0ANwA0ADQANAA1ADMANgA1ADQAMQA2ADgANwAyACIAKQAuAEYAdQBsAGwATgBhAG0AZQAgAHwAIABXAHIAaQB0AGUALQBIAG8AcwB0ACAALQBTAGUAcABhAHIAYQB0AG8AcgAgACcAJwA7AA==

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [June 1, 2015, 2:23pm UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/2 "2015-06-01T14:23:24Z")

</div>

Hi, that is a very odd error, as it’s failing to parse XML returned and appears to be connecting to the https port but is using the http protocol (thus the binary output) at the end. Can you share your python winrm version and any other relevant details in regards to how you have your inventory configured?

---

<div class="post-metadata">

**Author:** ![deloreandave](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@deloreandave](https://forum.ansible.com/u/deloreandave)\
**Post date:** [June 2, 2015, 2:07am UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/3 "2015-06-02T02:07:41Z")

</div>

You are right. I did not see that.

pywinrm (0.0.3)  
CentOS release 6.6  
ansible-1.9.1-1.el6.noarch  
Python 2.7.2

group\_vars

ansible\_ssh\_user: stew  
ansible\_ssh\_pass: \*\*\*\*\*\*\*\*  
ansible\_ssh\_port: 5986  
ansible\_connection: winrm

---

<div class="post-metadata">

**Author:** ![deloreandave](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@deloreandave](https://forum.ansible.com/u/deloreandave)\
**Post date:** [June 2, 2015, 2:23am UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/4 "2015-06-02T02:23:19Z")

</div>

I tried changing the port to 5985. I do notice that it uses http now, but with the same results.

[zenoss@zenoss-dev2 ansible-stuff]$ ansible -i inventory windows7-ansible4 -m setup -vvvv  
 ESTABLISH WINRM CONNECTION FOR USER: stew on PORT 5985 TO windows7-ansible4  
 WINRM CONNECT: transport=plaintext endpoint=[http://windows7-ansible4:5985/wsman](http://windows7-ansible4:5985/wsman)  
 REMOTE\_MODULE setup  
 EXEC (New-Item -Type Directory -Path $env:temp -Name “ansible-tmp-1433211528.68-218620442194755”).FullName | Write-Host -Separator ‘’;  
 WINRM EXEC ‘PowerShell’ [‘-NoProfile’, ‘-NonInteractive’, ‘-EncodedCommand’, ‘KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMwAzADIAMQAxADUAMgA4AC4ANgA4AC0AMgAxADgANgAyADAANAA0ADIAMQA5ADQANwA1ADUAIgApAC4ARgB1AGwAbABOAGEAbQBlACAAfAAgAFcAcgBpAHQAZQAtAEgAbwBzAHQAIAAtAFMAZQBwAGEAcgBhAHQAbwByACAAJwAnADsA’]  
Traceback (most recent call last):  
File “/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/winrm.py”, line 161, in exec\_command  
result = self.\_winrm\_exec(cmd\_parts[0], cmd\_parts[1:], from\_exec=True)  
File “/usr/lib/python2.6/site-packages/ansible/runner/connection\_plugins/winrm.py”, line 122, in \_winrm\_exec  
self.shell\_id = self.protocol.open\_shell()  
File “/usr/lib/python2.6/site-packages/winrm/protocol.py”, line 121, in open\_shell  
root = ET.fromstring(rs)  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 963, in XML  
parser.feed(text)  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 1245, in feed  
self.\_parser.Parse(data, 0)  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 1188, in \_end  
return self.\_target.end(self.\_fixname(tag))  
File “/usr/lib64/python2.6/xml/etree/ElementTree.py”, line 1096, in end  
self.\_last.tag, tag)  
AssertionError: end tag mismatch (expected ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒𐁽▒▒n▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒羵▒▒ ▒񺻰, got ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒𐁽▒▒n▒▒2B▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⸾)  
windows7-ansible4 | FAILED =\> failed to exec cmd PowerShell -NoProfile -NonInteractive -EncodedCommand KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMwAzADIAMQAxADUAMgA4AC4ANgA4AC0AMgAxADgANgAyADAANAA0ADIAMQA5ADQANwA1ADUAIgApAC4ARgB1AGwAbABOAGEAbQBlACAAfAAgAFcAcgBpAHQAZQAtAEgAbwBzAHQAIAAtAFMAZQBwAGEAcgBhAHQAbwByACAAJwAnADsA

---

<div class="post-metadata">

**Author:** ![deloreandave](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@deloreandave](https://forum.ansible.com/u/deloreandave)\
**Post date:** [June 4, 2015, 2:56am UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/5 "2015-06-04T02:56:29Z")

</div>

Anything else I can offer that would help here? I just set up Windows Server 2008 R2 and get the same error on that as well.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [June 4, 2015, 5:56am UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/6 "2015-06-04T05:56:52Z")

</div>

Is your server 2008 r2 machine fully up to date with Windows updates. There is a known bug in wmf 3 - see the blue note box in the windows system prep section of this page in the documentation [http://docs.ansible.com/intro\_windows.html#windows-system-prep](http://docs.ansible.com/intro_windows.html#windows-system-prep)

Hope that helps.

Jon

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [June 4, 2015, 5:59am UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/7 "2015-06-04T05:59:18Z")

</div>

See [http://docs.ansible.com/intro\_windows.html#windows-system-prep](http://docs.ansible.com/intro_windows.html#windows-system-prep)

Your server 2008 r2 machine may need to be patched due to a bug in wmf 3

Jon

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [June 4, 2015, 8:49pm UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/8 "2015-06-04T20:49:22Z")

</div>

Maybe that’s something we should check on in the setup script of the node is a 2008r2 box?

---

<div class="post-metadata">

**Author:** ![deloreandave](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@deloreandave](https://forum.ansible.com/u/deloreandave)\
**Post date:** [June 5, 2015, 3:08am UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/9 "2015-06-05T03:08:22Z")

</div>

The first system I tried was Windows 7 and close to up-to-date. W2K8 R2 was no where near. I’ll bring them both up-to-date and let you know if anything changes (hope Ansible is still around by the time I’m finished).

---

<div class="post-metadata">

**Author:** ![deloreandave](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@deloreandave](https://forum.ansible.com/u/deloreandave)\
**Post date:** [June 6, 2015, 6:40pm UTC](https://forum.ansible.com/t/windows-tag-mismatch/18362/10 "2015-06-06T18:40:26Z")

</div>

Updates didn’t fix it, but I figured it out. I’m attempting to incorporate some ansible calls into zenoss monitoring ultimately and had been making my attempts as the application id, which is configured to use the application’s bundled python. Must have gotten lucky when testing Linux guests, but something must be causing issues with Windows. I might not have even installed some of the dependency’s in the right python instance.

Thanks for all your help.
