Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pillar_ldap broken in 2019.2.0 #51816

Closed
jkrauz opened this issue Feb 26, 2019 · 5 comments

Comments

@jkrauz
Copy link

commented Feb 26, 2019

Description of Issue/Question

This is the same issue as in #46859. Returned in 2019.2.0.

Versions Report

Salt Version:
Salt: 2019.2.0

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: 2.0.2
gitpython: 2.1.3
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.5 (default, Oct 30 2018, 23:45:53)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: 2.0.2
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4

System Versions:
dist: centos 7.6.1810 Core
locale: UTF-8
machine: x86_64
release: 3.10.0-957.5.1.el7.x86_64
system: Linux
version: CentOS Linux 7.6.1810 Core

@Ch3LL

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2019

glancing at the code i'm not seeing a lot of change in those files. Can you paste the stack trace here so we can see exactly where its showing up in the code.

@Ch3LL Ch3LL added the Info Needed label Feb 26, 2019
@Ch3LL Ch3LL added this to the Blocked milestone Feb 26, 2019
@jkrauz

This comment has been minimized.

Copy link
Author

commented Feb 26, 2019

2019-02-27 10:03:27,204 [salt.loaded.int.pillar.pillar_ldap:301 ][CRITICAL][14613] Failed to retrieve pillar data from LDAP:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/pillar/pillar_ldap.py", line 295, in _do_search
**connargs)['results']
File "/usr/lib/python2.7/site-packages/salt/modules/ldapmod.py", line 151, in search
results = _ldap.search_s(dn, int(scope), filter, attrs)
File "/usr/lib64/python2.7/site-packages/ldap/ldapobject.py", line 552, in search_s
return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)
File "/usr/lib64/python2.7/site-packages/ldap/ldapobject.py", line 545, in search_ext_s
msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit)
File "/usr/lib64/python2.7/site-packages/ldap/ldapobject.py", line 541, in search_ext
timeout,sizelimit,
File "/usr/lib64/python2.7/site-packages/ldap/ldapobject.py", line 99, in _ldap_call
result = func(*args,**kwargs)
TypeError: ('expected string in list', u'dn')

I suspect the problem has been introduced by line 288 in /usr/lib/python2.7/site-packages/salt/pillar/pillar_ldap.py:
_dict_key_attr = _config('dict_key_attr', conf) or 'dn'

As suggested in the original issue, pasting this before line 293 fixed the problem for me:
attrs = [x.encode('utf-8') for x in attrs]

@Ch3LL

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2019

thanks we will need to get this fixed up

@KChandrashekhar

This comment has been minimized.

Copy link

commented May 3, 2019

@Ch3LL Can you follow up on if this is fixed now ?

@Ch3LL

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

looks like the fix was merged in and is in 2019.2.1 branch so we are all good to go :)

@Ch3LL Ch3LL closed this May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Salt Core Workspace
Pending Verification
Salt Open Workspace
  
Pending Verification
4 participants
You can’t perform that action at this time.