Bug #31273
(autre?) erreur synchro LDAP
0%
Description
root@authentic:~# authentic2-multitenant-manage tenant_command sync-ldap-users --all-tenants --traceback Traceback (most recent call last): File "/usr/lib/authentic2/manage.py", line 21, in <module> execute_from_command_line(sys.argv[:1] + argv) File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line utility.execute() File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python2.7/dist-packages/hobo/multitenant/management/commands/tenant_command.py", line 112, in run_from_argv error = run_command_from_argv(klass, args) File "/usr/lib/python2.7/dist-packages/hobo/multitenant/management/commands/tenant_command.py", line 37, in run_command_from_argv command.execute(*args, **cmd_options) File "/usr/lib/python2.7/dist-packages/hobo/agent/authentic2/apps.py", line 45, in new_execute return old_execute(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/usr/lib/python2.7/dist-packages/authentic2/management/commands/sync-ldap-users.py", line 14, in handle list(LDAPBackend.get_users()) File "/usr/lib/python2.7/dist-packages/authentic2/backends/ldap_backend.py", line 1150, in get_users yield backend._return_user(user_dn, None, conn, block, data) File "/usr/lib/python2.7/dist-packages/authentic2/backends/ldap_backend.py", line 1079, in _return_user return self._return_django_user(dn, username, password, conn, block, attributes) File "/usr/lib/python2.7/dist-packages/authentic2/backends/ldap_backend.py", line 1090, in _return_django_user self.populate_user(user, dn, username, conn, block, attributes) File "/usr/lib/python2.7/dist-packages/authentic2/backends/ldap_backend.py", line 884, in populate_user self.populate_user_groups(user, dn, conn, block, attributes) File "/usr/lib/python2.7/dist-packages/authentic2/backends/ldap_backend.py", line 781, in populate_user_groups group_dns = self.get_ldap_group_dns(user, dn, conn, block, attributes) File "/usr/lib/python2.7/dist-packages/authentic2/backends/ldap_backend.py", line 770, in get_ldap_group_dns query = FilterFormatter().format(group_filter, **params) File "/usr/lib/python2.7/string.py", line 559, in format return self.vformat(format_string, args, kwargs) File "/usr/lib/python2.7/string.py", line 563, in vformat result = self._vformat(format_string, args, kwargs, used_args, 2) File "/usr/lib/python2.7/string.py", line 598, in _vformat return ''.join(result) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 12: ordinal not in range(128)
Fichiers
Demandes liées
Révisions associées
ldap: do not return referrals in _convert_results_to_unicode (#31273)
Wrong indentation kept referrals.
ldap: only wrap LDAPObject.result4 (#31273)
result4() is the only function in python-ldap really handling results from LDAP requests,
all other methods calls it; if we encode attributes from other function we
duplicate work.
ldap: encode string before using urlparse.quote() on them (#31273)
quote() only handle byte strings or ASCII only unicode strings with Python3,
to be compatible with both python versions the best is to encode string before
quoting them.
tests: improve ldap tests with non ASCII characters in uid (#31273)
Historique
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Fichier 0001-ldap-fix-indentation-of-LDAPObject.result3-fixes-312.patch 0001-ldap-fix-indentation-of-LDAPObject.result3-fixes-312.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Typo idiote.
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
Une réoslution complète du ticket nécessitera des tests plus extensifs sur sync-ldap-users.
Mis à jour par Frédéric Péters il y a environ 5 ans
- Statut changé de Solution proposée à Solution validée
Celui-ci corrige bien la trace citée.
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Fichier 0004-ldap-encode-string-before-using-urlparse.quote-on-th.patch 0004-ldap-encode-string-before-using-urlparse.quote-on-th.patch ajouté
- Fichier 0001-ldap-do-not-hardcode-bytes_mode-argument-31273.patch 0001-ldap-do-not-hardcode-bytes_mode-argument-31273.patch ajouté
- Fichier 0003-ldap-only-wrap-LDAPObject.result4-31273.patch 0003-ldap-only-wrap-LDAPObject.result4-31273.patch ajouté
- Fichier 0002-ldap-do-not-return-referrals-in-_convert_results_to_.patch 0002-ldap-do-not-return-referrals-in-_convert_results_to_.patch ajouté
- Fichier 0005-tests-improve-ldap-tests-with-non-ASCII-characters-i.patch 0005-tests-improve-ldap-tests-with-non-ASCII-characters-i.patch ajouté
- Statut changé de Solution validée à Solution proposée
Avec ça je couvre tous les problèmes rapportés aujourd'hui.
Mis à jour par Frédéric Péters il y a environ 5 ans
- Statut changé de Solution proposée à Solution validée
Ok si les tests passent, que ça soit ensuite rapidement déployé pour assurer partout en vrai.
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit fe345e5746ff6f785ea7bb2aad8b07b4f92a889a tests: improve ldap tests with non ASCII characters in uid (#31273) commit b475f6b7dff30d0bd20c60eedc8542f05e51256f ldap: encode string before using urlparse.quote() on them (#31273) quote() only handle byte strings or ASCII only unicode strings with Python3, to be compatible with both python versions the best is to encode string before quoting them. commit 0f0c0790d0c7162dcca806cbf12b4856ec3835be ldap: only wrap LDAPObject.result4 (#31273) result4() is the only function in python-ldap really handling results from LDAP requests, all other methods calls it; if we encode attributes from other function we duplicate work. commit 2bb6f8aab3fbce600a0be595a1e444ff3fa4abad ldap: do not return referrals in _convert_results_to_unicode (#31273) Wrong indentation kept referrals. commit ebab175401aea6777ed03ef614ba5ed225b498db ldap: do not hardcode bytes_mode argument (#31273)
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Dupliqué par Bug #31286: erreur synchro LDAP, groupes ajouté
Mis à jour par Frédéric Péters il y a environ 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
ldap: do not hardcode bytes_mode argument (#31273)