Problem with ldap_sync_users command (need ldap3 v2.2.3 module)
See original GitHub issueHello, Thanks for your clear documentation 😃 I try to make working your module for the first time but I have some issue.
My LDAP server is particular and need the last stable version (2.2.3) of ldap3 python module. You can see the issue corrected 2 days ago here : https://github.com/cannatag/ldap3/issues/334
When I try to import ldap users in django with your module, it’s not working.
You can see my try here :
gduale:~:$ . ./py361-test/bin/activate
(py361-test) gduale:~:$ pip install django-python3-ldap
Collecting django-python3-ldap
Using cached django-python3-ldap-0.9.14.tar.gz
Collecting django>=1.8 (from django-python3-ldap)
Using cached Django-1.11-py2.py3-none-any.whl
Collecting ldap3==2.2.0 (from django-python3-ldap)
Using cached ldap3-2.2.0-py2.py3-none-any.whl
Collecting pytz (from django>=1.8->django-python3-ldap)
Using cached pytz-2017.2-py2.py3-none-any.whl
Collecting pyasn1>=0.1.8 (from ldap3==2.2.0->django-python3-ldap)
Using cached pyasn1-0.2.3-py2.py3-none-any.whl
Installing collected packages: pytz, django, pyasn1, ldap3, django-python3-ldap
Running setup.py install for django-python3-ldap ... done
Successfully installed django-1.11 django-python3-ldap-0.9.14 ldap3-2.2.0 pyasn1-0.2.3 pytz-2017.2
Then I know that with ldap3 version 2.2.0 it will not work (I already try), so I install the latest version :
(py361-test) gduale:~:$ pip install --upgrade ldap3
Collecting ldap3
Using cached ldap3-2.2.3-py2.py3-none-any.whl
Requirement already up-to-date: pyasn1>=0.1.8 in ./py361-test/lib/python3.6/site-packages (from ldap3)
Installing collected packages: ldap3
Found existing installation: ldap3 2.2.0
Uninstalling ldap3-2.2.0:
Successfully uninstalled ldap3-2.2.0
Successfully installed ldap3-2.2.3
Then I try to sync the users, but it fails :
(py361-test) gduale:~/django-projects/test-c2i/c2i:$ python manage.py ldap_sync_users
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/gduale/py361-test/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/home/gduale/py361-test/lib/python3.6/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/gduale/py361-test/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/gduale/py361-test/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/gduale/make_python/python-3.6.1/lib/python3.6/contextlib.py", line 53, in inner
return func(*args, **kwds)
File "/home/gduale/py361-test/lib/python3.6/site-packages/django_python3_ldap/management/commands/ldap_sync_users.py", line 21, in handle
for user in connection.iter_users():
File "/home/gduale/py361-test/lib/python3.6/site-packages/django_python3_ldap/ldap.py", line 90, in <genexpr>
if entry["type"] == "searchResEntry"
File "/home/gduale/py361-test/lib/python3.6/site-packages/django_python3_ldap/ldap.py", line 66, in _get_or_create_user
**user_lookup
File "/home/gduale/py361-test/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/gduale/py361-test/lib/python3.6/site-packages/django/db/models/query.py", line 475, in update_or_create
lookup, params = self._extract_model_params(defaults, **kwargs)
File "/home/gduale/py361-test/lib/python3.6/site-packages/django/db/models/query.py", line 531, in _extract_model_params
"', '".join(sorted(invalid_params)),
django.core.exceptions.FieldError: Invalid field name(s) for model User: 'd', 'i', 'u'.
Do you know if is it possible to make working your module with the latest stable version of ldap3 please ? Thank you, Best regards.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Connection to LDAP server issue · Issue #334 · cannatag/ldap3
I have a connexion problem when I try to bind my LDAP server. ... Problem with ldap_sync_users command (need ldap3 v2.2.3 module) ...
Read more >Tutorial: Introduction to ldap3 - Read the Docs
ldap3 usage is straightforward: you define a Server object and a Connection object. Then you issue commands to the connection. A server can...
Read more >Welcome to ldap3's documentation — ldap3 2.9.1 ...
Welcome to ldap3's documentation¶. ldap3 is a pure Python LDAP 3 client library strictly conforming to RFC4510 and is released under the LGPL...
Read more >CHANGELOG — ldap3 2.9.1 documentation
CHANGELOG¶ · fixed empty digestMd5.py file in 2.5.2 package · explicitly declare digest module md5 in util.ntlm (thanks adawalli) · change object passed...
Read more >Installation and configuration — ldap3 2.9.1 documentation
You need the pip package (or another package manager that can download and install from pyPI) ... This library has only one dependence...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Excellent! LDAP is needlessly hard!
On Wed, 3 May 2017 at 10:53 tazou notifications@github.com wrote:
Hey, no worries, and thanks for the gift card! Always a pleasure to help out a fellow coder!
On Sat, 6 May 2017 at 10:24 tazou notifications@github.com wrote: