Projet

Général

Profil

Bug #31273

(autre?) erreur synchro LDAP

Ajouté par Frédéric Péters il y a environ 5 ans. Mis à jour il y a environ 5 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
11 mars 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:

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

Dupliqué par Authentic 2 - Bug #31286: erreur synchro LDAP, groupesRejeté11 mars 2019

Actions

Révisions associées

Révision ebab1754 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

ldap: do not hardcode bytes_mode argument (#31273)

Révision 2bb6f8aa (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

ldap: do not return referrals in _convert_results_to_unicode (#31273)

Wrong indentation kept referrals.

Révision 0f0c0790 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

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.

Révision b475f6b7 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

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.

Révision fe345e57 (diff)
Ajouté par Benjamin Dauvergne il y a environ 5 ans

tests: improve ldap tests with non ASCII characters in uid (#31273)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

Une idée du tenant ? du serveur ?

#2

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

  • Assigné à mis à Benjamin Dauvergne
#3

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

Typo idiote.

#4

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.

#5

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.

#7

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.

#8

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)
#9

Mis à jour par Benjamin Dauvergne il y a environ 5 ans

  • Dupliqué par Bug #31286: erreur synchro LDAP, groupes ajouté
#11

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

Formats disponibles : Atom PDF