# WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

**URL:** <https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 22, 2020, 12:14am UTC](https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002 "2020-05-22T00:14:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [May 22, 2020, 12:14am UTC](https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002/1 "2020-05-22T00:14:32Z")

</div>

Hi,

Goal : Use Linux centos 7.8 server with ansible version 2.9.7 to manage windows 2019 server

Error : WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

---

<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:** [May 22, 2020, 12:37am UTC](https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002/2 "2020-05-22T00:37:40Z")

</div>

The issue here is the kerberos library you have installed is either too old or incompatible with what requests-kerberos requires. Uninstall both kerberos and pykerberos and install just pykerberos. You may want to update requests-kerberos as well as 0.7.0 is quite old.

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [May 22, 2020, 12:42am UTC](https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002/3 "2020-05-22T00:42:42Z")

</div>

Thanks for the reply

You mean :

yum remove -y krb5-devel krb5-libs krb5-workstation

And

re-run

**pip install pykerberos**

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [May 22, 2020, 12:48am UTC](https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002/4 "2020-05-22T00:48:50Z")

</div>

Shall i do below

yum remove python-kerberos-1.1-15.el7.x86\_64

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [May 22, 2020, 12:51am UTC](https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002/5 "2020-05-22T00:51:29Z")

</div>

Anyways i did below

1017 21/05/20 17:47:19 yum remove python-kerberos-1.1-15.el7.x86\_64  
1018 21/05/20 17:49:29 rpm -qa|grep -i kerb  
1019 21/05/20 17:49:43 pip install pykerberos  
1020 21/05/20 17:49:55 pip install requests-kerberos  
1021 21/05/20 17:50:05 ansible windows -m win\_ping -vvvvvv  
1022 21/05/20 17:50:30 yum install -y python-kerberos  
1023 21/05/20 17:50:38 ansible windows -m win\_ping -vvvvvv

Still no luck

---

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [May 22, 2020, 2:16am UTC](https://forum.ansible.com/t/winrm-connection-error-function-takes-at-most-2-arguments-3-given/33002/6 "2020-05-22T02:16:38Z")

</div>

I used a fresh box & finally did below & wored

yum install -y python3-devel  
pip install pykerberos

Thanks @Jordan
