Dario Vinella
unread,Jan 7, 2013, 8:29:37 AM1/7/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-a...@googlegroups.com
Hi,
I'm experiencing some integrity error exceptions on my site, powered by django 1.4.3 and updated
versions of django-auth-ldap. This happens rarely, a couple of times every month (with a couple hundreds
unique users per day).
My django-ldap-auth settings include AUTH_LDAP_MIRROR_GROUPS = True
Could these exceptions be related to django-auth-ldap or to django itself?
You could find the traceback below.
regards
Dario
---
Traceback (most recent call last):
[...]
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/__init__.py", line 45, in authenticate
user = backend.authenticate(**credentials)
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap/backend.py", line 113, in authenticate
user = ldap_user.authenticate(password)
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap/backend.py", line 262, in authenticate
self._get_or_create_user()
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap/backend.py", line 479, in _get_or_create_user
self._mirror_groups()
File "/usr/local/lib/python2.6/dist-packages/django_auth_ldap/backend.py", line 577, in _mirror_groups
self._user.groups = groups
File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/related.py", line 834, in __set__
manager.add(*value)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/related.py", line 578, in add
self._add_items(self.source_field_name, self.target_field_name, *objs)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/related.py", line 663, in _add_items
for obj_id in new_ids
File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 419, in bulk_create
self._batched_insert(objs_without_pk, fields, batch_size)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 868, in _batched_insert
using=self.db)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line 203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 1593, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", line 910, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
IntegrityError: duplicate key value violates unique constraint "auth_user_groups_user_id_group_id_key"
DETAIL: Key (user_id, group_id)=(596, 1) already exists.