ansible kerberos library is not installed

2,056 views
Skip to first unread message

Tony Wong

unread,
May 25, 2020, 9:43:57 AM5/25/20
to Ansible Project
not sure what happened but this was working last week.

now I am getting this error


tony@ubuntu:~/windows$ ansible windows -i hosts -m win_ping -vvvvvvvvv
ansible 2.9.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/tony/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/tony/.local/lib/python2.7/site-packages/ansible
  executable location = /home/tony/.local/bin/ansible
  python version = 2.7.17 (default, Apr 15 2020, 17:20:14) [GCC 7.5.0]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /home/tony/windows/hosts as it did not pass its verify_file() method
script declined parsing /home/tony/windows/hosts as it did not pass its verify_file() method
auto declined parsing /home/tony/windows/hosts as it did not pass its verify_file() method
Parsed /home/tony/windows/hosts inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /home/tony/.local/lib/python2.7/site-packages/ansible/plugins/callback/minimal.pyc
META: ran handlers
Using module file /home/tony/.local/lib/python2.7/site-packages/ansible/modules/windows/win_ping.ps1
Using module file /home/tony/.local/lib/python2.7/site-packages/ansible/modules/windows/win_ping.ps1
Pipelining is enabled.
Pipelining is enabled.
<pa-mgt01> ESTABLISH WINRM CONNECTION FOR USER: adm-tkw@xxxx on PORT 5986 TO pa-mgt01
<rw-ctxweb-02\> ESTABLISH WINRM CONNECTION FOR USER: adm-tkw@xxxxx on PORT 5986 TO rw-ctxweb-02
pa-mgt01.wsgr.com | UNREACHABLE! => {
    "changed": false,
    "msg": "kerberos: the python kerberos library is not installed",
    "unreachable": true
}
rw-ctxweb-02.wsgr.com | UNREACHABLE! => {
    "changed": false,
    "msg": "kerberos: the python kerberos library is not installed",
    "unreachable": true

Tony Wong

unread,
May 25, 2020, 10:00:47 AM5/25/20
to ansible...@googlegroups.com
any idea? I cant connect to my windows machines now and winrm is setup correctly

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cec11813-74cd-406b-acf3-1797f2415e25%40googlegroups.com.

Tony Wong

unread,
May 25, 2020, 11:39:53 AM5/25/20
to ansible...@googlegroups.com
maybe I am missing krb?


tony@ubuntu:~/windows$ sudo apt install -y krb5-user libpam-krb5 libpam-ccreds auth-client-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 krb5-user : Depends: libkrb5-3 (= 1.16-2ubuntu0.1) but 1.16-2ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.

Tony Wong

unread,
May 25, 2020, 12:18:28 PM5/25/20
to ansible...@googlegroups.com
any ieea? I am able to chem ntlm auth is working fine. its just kerberos is failed

David Foley

unread,
May 25, 2020, 2:56:37 PM5/25/20
to Ansible Project
I would advise speaking to your AD Team or your GPO Administrator, They may have updated their GPO Policies to stop communication over the ports used for Kerberos:  This Issue doesn't seem to be an Ansible issue but an issue with your Environment setup.

Jordan Borean

unread,
May 25, 2020, 6:21:03 PM5/25/20
to Ansible Project
The error message is saying

The python kerberos library is not installed

Make sure you have installed pykerberos by running 'pip install pykerberos' or if you are managing Python packages through your system package manager 'apt install python-kerberos'.

You can verify whether it is installed with 'python -c "import kerberos"'. Make sure the Python you use to execute this check is the same Python that Ansible runs with.

Thanks

Jordan

Tony Wong

unread,
May 25, 2020, 7:11:18 PM5/25/20
to ansible...@googlegroups.com
getting this error



tony@ubuntu:~$ sudo pip install pykerberos
[sudo] password for tony:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: The directory '/home/tony/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pykerberos
  Downloading pykerberos-1.2.1.tar.gz (24 kB)
Building wheels for collected packages: pykerberos
  Building wheel for pykerberos (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sZaCg1/pykerberos/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sZaCg1/pykerberos/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-sAbKUA
       cwd: /tmp/pip-install-sZaCg1/pykerberos/
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'kerberos' extension
  creating build
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/src
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/kerberos.c -o build/temp.linux-x86_64-2.7/src/kerberos.o
  In file included from src/kerberos.c:19:
  src/kerberosbasic.h:17:10: fatal error: gssapi/gssapi.h: No such file or directory
   #include <gssapi/gssapi.h>
            ^~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pykerberos
  Running setup.py clean for pykerberos
Failed to build pykerberos
Installing collected packages: pykerberos
    Running setup.py install for pykerberos ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sZaCg1/pykerberos/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sZaCg1/pykerberos/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-EyqB2F/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python2.7/pykerberos
         cwd: /tmp/pip-install-sZaCg1/pykerberos/
    Complete output (14 lines):
    running install
    running build
    running build_ext
    building 'kerberos' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/kerberos.c -o build/temp.linux-x86_64-2.7/src/kerberos.o
    In file included from src/kerberos.c:19:
    src/kerberosbasic.h:17:10: fatal error: gssapi/gssapi.h: No such file or directory
     #include <gssapi/gssapi.h>
              ^~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sZaCg1/pykerberos/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sZaCg1/pykerberos/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-EyqB2F/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python2.7/pykerberos Check the logs for full command output.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.

Antony Stone

unread,
May 25, 2020, 7:23:31 PM5/25/20
to ansible...@googlegroups.com
On Tuesday 26 May 2020 at 01:10:53, Tony Wong wrote:

> getting this error
>
> tony@ubuntu:~$ sudo pip install pykerberos

Why use sudo?

> WARNING: The directory '/home/tony/.cache/pip' or its parent directory is
> not owned or is not writable by the current user. The cache has been
> disabled. Check the permissions and owner of that directory. If executing
> pip with sudo, you may want sudo's -H flag.

Regards,


Antony.

--
<flopsie> yes, but this is #lbw, we don't do normal

Please reply to the list;
please *don't* CC me.

Jordan Borean

unread,
May 25, 2020, 9:40:05 PM5/25/20
to Ansible Project
Please read the docs, there are a few packages that need to be installed for pip to compile the pykerberos library https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html#installing-the-kerberos-library.

Tony Wong

unread,
May 26, 2020, 8:47:57 AM5/26/20
to ansible...@googlegroups.com
this is error i keep getting


tony@ubuntu:~$ pip install pykerberos

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable

Collecting pykerberos
  Downloading pykerberos-1.2.1.tar.gz (24 kB)
Building wheels for collected packages: pykerberos
  Building wheel for pykerberos (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e0nO8N/pykerberos/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e0nO8N/pykerberos/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-CFz0Gh
       cwd: /tmp/pip-install-e0nO8N/pykerberos/

  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'kerberos' extension
  creating build
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/src
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/kerberos.c -o build/temp.linux-x86_64-2.7/src/kerberos.o
  In file included from src/kerberos.c:19:
  src/kerberosbasic.h:17:10: fatal error: gssapi/gssapi.h: No such file or directory
   #include <gssapi/gssapi.h>
            ^~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pykerberos
  Running setup.py clean for pykerberos
Failed to build pykerberos
Installing collected packages: pykerberos
    Running setup.py install for pykerberos ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e0nO8N/pykerberos/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e0nO8N/pykerberos/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vbOicj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/tony/.local/include/python2.7/pykerberos
         cwd: /tmp/pip-install-e0nO8N/pykerberos/

    Complete output (14 lines):
    running install
    running build
    running build_ext
    building 'kerberos' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/kerberos.c -o build/temp.linux-x86_64-2.7/src/kerberos.o
    In file included from src/kerberos.c:19:
    src/kerberosbasic.h:17:10: fatal error: gssapi/gssapi.h: No such file or directory
     #include <gssapi/gssapi.h>
              ^~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e0nO8N/pykerberos/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e0nO8N/pykerberos/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vbOicj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/tony/.local/include/python2.7/pykerberos Check the logs for full command output.
tony@ubuntu:~$ ^C

On Mon, May 25, 2020 at 6:40 PM Jordan Borean <jbor...@gmail.com> wrote:
Please read the docs, there are a few packages that need to be installed for pip to compile the pykerberos library https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html#installing-the-kerberos-library.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.

Werner Flamme

unread,
May 26, 2020, 9:45:34 AM5/26/20
to ansible...@googlegroups.com
Tony Wong schrieb am 25.05.20 um 17:39:
> maybe I am missing krb?
>
>
> tony@ubuntu:~/windows$ sudo apt install -y krb5-user libpam-krb5
> libpam-ccreds auth-client-config
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Some packages could not be installed. This may mean that you have
> requested an impossible situation or if you are using the unstable
> distribution that some required packages have not yet been created
> or been moved out of Incoming.
> The following information may help to resolve the situation:
>
> The following packages have unmet dependencies:
> krb5-user : Depends: libkrb5-3 (= 1.16-2ubuntu0.1) but 1.16-2ubuntu1.1 is
> to be installed
> E: Unable to correct problems, you have held broken packages.

At his point, I'd try something like "apt-get -f install" to fix the
installed packages.

Obviously some executable is invoked here, and it depends on another
operating system package. The required package is named libkrb5-3 and
should have version 1.16-2ubuntu0.1, but there seems to be only version
1.16-2ubuntu1.1 available.

Try to fix this, since all the following output should depend on that.

HTH, Werner

--


Reply all
Reply to author
Forward
0 new messages