{"action":"created","issue":{"url":"https://api.github.com/repos/ensky/taiga-contrib-ldap-auth/issues/15","labels_url":"https://api.github.com/repos/ensky/taiga-contrib-ldap-auth/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/ensky/taiga-contrib-ldap-auth/issues/15/comments","events_url":"https://api.github.com/repos/ensky/taiga-contrib-ldap-auth/issues/15/events","html_url":"https://github.com/ensky/taiga-contrib-ldap-auth/issues/15","id":98941391,"number":15,"title":"Login failed at the second time","user":{"login":"rawbean","id":4373518,"avatar_url":"https://avatars.githubusercontent.com/u/4373518?v=3","gravatar_id":"","url":"https://api.github.com/users/rawbean","html_url":"https://github.com/rawbean","followers_url":"https://api.github.com/users/rawbean/followers","following_url":"https://api.github.com/users/rawbean/following{/other_user}","gists_url":"https://api.github.com/users/rawbean/gists{/gist_id}","starred_url":"https://api.github.com/users/rawbean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawbean/subscriptions","organizations_url":"https://api.github.com/users/rawbean/orgs","repos_url":"https://api.github.com/users/rawbean/repos","events_url":"https://api.github.com/users/rawbean/events{/privacy}","received_events_url":"https://api.github.com/users/rawbean/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-04T10:49:04Z","updated_at":"2015-08-13T00:45:21Z","closed_at":null,"body":"When i login to taiga successfully(with ldap user/password), then l logout. but when i try to login again, the server returned 500 error code, please find the details below:\r\n\r\napi response:\r\n{\"error\": \"Server application error\"}\r\n\r\nthe backend log:\r\n\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset=\"utf-8\"\r\nContent-Transfer-Encoding: 7bit\r\nSubject: [Django] ERROR (EXTERNAL IP): Internal Server Error: /api/v1/auth\r\nFrom: no-reply@xx.com\r\nTo: example@example.com\r\nDate: Tue, 04 Aug 2015 10:48:43 -0000\r\nMessage-ID: <20150804104843.2046.10922@Taiga.TPC>\r\n\r\nInternal Server Error: /api/v1/auth\r\nTraceback (most recent call last):\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/taiga_contrib_ldap_auth/services.py\", line 41, in ldap_register\r\n    user = user_model.objects.get(username=username)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/manager.py\", line 92, in manager_method\r\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/query.py\", line 357, in get\r\n    self.model._meta.object_name)\r\ntaiga.users.models.DoesNotExist: User matching query does not exist.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/backends/utils.py\", line 65, in execute\r\n    return self.cursor.execute(sql, params)\r\npsycopg2.IntegrityError: duplicate key value violates unique constraint \"users_user_email_6a1bbd04b7b1e907_uniq\"\r\nDETAIL:  Key (email)=(notify.pm@xx.com) already exists.\r\n\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/core/handlers/base.py\", line 111, in get_response\r\n    response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/viewsets.py\", line 81, in view\r\n    return self.dispatch(request, *args, **kwargs)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/views/decorators/csrf.py\", line 57, in wrapped_view\r\n    return view_func(*args, **kwargs)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/views.py\", line 420, in dispatch\r\n    response = self.handle_exception(exc)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/views.py\", line 417, in dispatch\r\n    response = handler(request, *args, **kwargs)\r\n  File \"/home/taiga/taiga-back/taiga/auth/api.py\", line 142, in create\r\n    data = auth_plugins[login_type]['login_func'](request)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/taiga_contrib_ldap_auth/services.py\", line 58, in ldap_login_func\r\n    user = ldap_register(username=username, email=email, full_name=full_name)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/transaction.py\", line 394, in inner\r\n    return func(*args, **kwargs)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/taiga_contrib_ldap_auth/services.py\", line 47, in ldap_register\r\n    full_name=full_name)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/manager.py\", line 92, in manager_method\r\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/query.py\", line 372, in create\r\n    obj.save(force_insert=True, using=self.db)\r\n  File \"/home/taiga/taiga-back/taiga/users/models.py\", line 162, in save\r\n    super().save(*args, **kwargs)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/base.py\", line 589, in save\r\n    force_update=force_update, update_fields=update_fields)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/base.py\", line 617, in save_base\r\n    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/base.py\", line 698, in _save_table\r\n    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/base.py\", line 731, in _do_insert\r\n    using=using, raw=raw)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/manager.py\", line 92, in manager_method\r\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/query.py\", line 921, in _insert\r\n    return query.get_compiler(using=using).execute_sql(return_id)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/sql/compiler.py\", line 921, in execute_sql\r\n    cursor.execute(sql, params)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/backends/utils.py\", line 65, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/utils.py\", line 94, in __exit__\r\n    six.reraise(dj_exc_type, dj_exc_value, traceback)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/utils/six.py\", line 658, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/backends/utils.py\", line 65, in execute\r\n    return self.cursor.execute(sql, params)\r\ndjango.db.utils.IntegrityError: duplicate key value violates unique constraint \"users_user_email_6a1bbd04b7b1e907_uniq\"\r\nDETAIL:  Key (email)=(notify.pm@xx.com) already exists.\r\n\r\n\r\nRequest repr(): \r\n<WSGIRequest\r\npath:/api/v1/auth,\r\nGET:<QueryDict: {}>,\r\nPOST:<could not parse>,\r\nCOOKIES:{'csrftoken': '3lPmB5k8FEParGCoAyb8YzbjPAjF8Wju',\r\n 'sessionid': 'jlr85w8fdry564kkuv8oh9dlcg2quf17'},\r\nMETA:{'CONTENT_LENGTH': '65',\r\n 'CONTENT_TYPE': 'application/json',\r\n 'HTTP_ACCEPT': 'application/json, text/plain, */*',\r\n 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',\r\n 'HTTP_ACCEPT_LANGUAGE': 'en',\r\n 'HTTP_CONNECTION': 'close',\r\n 'HTTP_COOKIE': 'sessionid=jlr85w8fdry564kkuv8oh9dlcg2quf17; '\r\n                'csrftoken=3lPmB5k8FEParGCoAyb8YzbjPAjF8Wju',\r\n 'HTTP_HOST': '172.17.26.30',\r\n 'HTTP_ORIGIN': 'http://172.17.26.30',\r\n 'HTTP_REFERER': 'http://172.17.26.30/login',\r\n 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) '\r\n                    'AppleWebKit/537.36 (KHTML, like Gecko) '\r\n                    'Chrome/44.0.2403.125 Safari/537.36',\r\n 'HTTP_X_FORWARDED_FOR': '172.17.11.141',\r\n 'HTTP_X_FORWARDED_PROTO': 'http',\r\n 'HTTP_X_REAL_IP': '172.17.11.141',\r\n 'HTTP_X_SCHEME': 'http',\r\n 'HTTP_X_SESSION_ID': 'b52ac488437f6fcf3038073e80e915414452e9ef',\r\n 'PATH_INFO': '/api/v1/auth',\r\n 'QUERY_STRING': '',\r\n 'RAW_URI': '/api/v1/auth',\r\n 'REMOTE_ADDR': '127.0.0.1',\r\n 'REMOTE_PORT': '37738',\r\n 'REQUEST_METHOD': 'POST',\r\n 'SCRIPT_NAME': '',\r\n 'SERVER_NAME': '127.0.0.1',\r\n 'SERVER_PORT': '8001',\r\n 'SERVER_PROTOCOL': 'HTTP/1.0',\r\n 'SERVER_SOFTWARE': 'gunicorn/19.3.0',\r\n 'gunicorn.socket': <socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 8001), raddr=('127.0.0.1', 37738)>,\r\n 'wsgi.errors': <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7fb1afad0e48>,\r\n 'wsgi.file_wrapper': <class 'gunicorn.http.wsgi.FileWrapper'>,\r\n 'wsgi.input': <gunicorn.http.body.Body object at 0x7fb1afad0278>,\r\n 'wsgi.multiprocess': True,\r\n 'wsgi.multithread': False,\r\n 'wsgi.run_once': False,\r\n 'wsgi.url_scheme': 'http',\r\n 'wsgi.version': (1, 0)}>\r\n-------------------------------------------------------------------------------"},"comment":{"url":"https://api.github.com/repos/ensky/taiga-contrib-ldap-auth/issues/comments/130492172","html_url":"https://github.com/ensky/taiga-contrib-ldap-auth/issues/15#issuecomment-130492172","issue_url":"https://api.github.com/repos/ensky/taiga-contrib-ldap-auth/issues/15","id":130492172,"user":{"login":"rawbean","id":4373518,"avatar_url":"https://avatars.githubusercontent.com/u/4373518?v=3","gravatar_id":"","url":"https://api.github.com/users/rawbean","html_url":"https://github.com/rawbean","followers_url":"https://api.github.com/users/rawbean/followers","following_url":"https://api.github.com/users/rawbean/following{/other_user}","gists_url":"https://api.github.com/users/rawbean/gists{/gist_id}","starred_url":"https://api.github.com/users/rawbean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawbean/subscriptions","organizations_url":"https://api.github.com/users/rawbean/orgs","repos_url":"https://api.github.com/users/rawbean/repos","events_url":"https://api.github.com/users/rawbean/events{/privacy}","received_events_url":"https://api.github.com/users/rawbean/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T00:45:21Z","updated_at":"2015-08-13T00:45:21Z","body":"may be this is a bug of taiga?"}}