seibert-media / teamvault

Keep your company's passwords behind the firewall
Other
40 stars 12 forks source link

TypeError at /login an integer is required (got type str) #78

Closed tsfoer closed 8 years ago

tsfoer commented 8 years ago

Hello,

i've just upgraded from 0.4.3 to 0.5.1 via pip and now i'm unable to login: TypeError at /login an integer is required (got type str)

Here is the full error message:

Environment:

Request Method: POST Request URL: http:///login?next=/

Django Version: 1.8.5 Python Version: 3.4.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_gravatar', 'djorm_pgfulltext', 'rest_framework', 'teamvault.apps.accounts.AccountsConfig', 'teamvault.apps.audit.AuditConfig', 'teamvault.apps.secrets.SecretsConfig', 'teamvault.apps.settings.SettingsConfig'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware')

Traceback: File "/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py" in get_response

  1. response = wrapped_callback(request, _callback_args, *_callback_kwargs) File "/usr/local/lib/python3.4/dist-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper
  2. return view(request, _args, *_kwargs) File "/usr/local/lib/python3.4/dist-packages/django/utils/decorators.py" in _wrapped_view
  3. response = view_func(request, _args, *_kwargs) File "/usr/local/lib/python3.4/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4. response = view_func(request, _args, *_kwargs) File "/usr/local/lib/python3.4/dist-packages/django/contrib/auth/views.py" in login
  5. if form.is_valid(): File "/usr/local/lib/python3.4/dist-packages/django/forms/forms.py" in is_valid
  6. return self.is_bound and not self.errors File "/usr/local/lib/python3.4/dist-packages/django/forms/forms.py" in errors
  7. self.full_clean() File "/usr/local/lib/python3.4/dist-packages/django/forms/forms.py" in full_clean
  8. self._clean_form() File "/usr/local/lib/python3.4/dist-packages/django/forms/forms.py" in _clean_form
  9. cleaned_data = self.clean() File "/usr/local/lib/python3.4/dist-packages/django/contrib/auth/forms.py" in clean
  10. password=password) File "/usr/local/lib/python3.4/dist-packages/django/contrib/auth/init.py" in authenticate
  11. user = backend.authenticate(**credentials) File "/usr/local/lib/python3.4/dist-packages/django_auth_ldap/backend.py" in authenticate
  12. user = ldap_user.authenticate(password) File "/usr/local/lib/python3.4/dist-packages/django_auth_ldap/backend.py" in authenticate
  13. self._authenticate_user_dn(password) File "/usr/local/lib/python3.4/dist-packages/django_auth_ldap/backend.py" in _authenticate_user_dn
  14. if self.dn is None: File "/usr/local/lib/python3.4/dist-packages/django_auth_ldap/backend.py" in _get_user_dn
  15. self._load_user_dn() File "/usr/local/lib/python3.4/dist-packages/django_auth_ldap/backend.py" in _load_user_dn
  16. self._search_for_user_dn() File "/usr/local/lib/python3.4/dist-packages/django_auth_ldap/backend.py" in _search_for_user_dn
  17. results = search.execute(self.connection, {'user': self._username}) File "/usr/local/lib/python3.4/dist-packages/django_auth_ldap/config.py" in execute
  18. force_str(filterstr)) File "/usr/local/lib/python3.4/dist-packages/ldap/ldapobject.py" in search_s
  19. return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout) File "/usr/local/lib/python3.4/dist-packages/ldap/ldapobject.py" in search_ext_s
  20. msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit) File "/usr/local/lib/python3.4/dist-packages/ldap/ldapobject.py" in search_ext
  21. timeout,sizelimit, File "/usr/local/lib/python3.4/dist-packages/ldap/ldapobject.py" in _ldap_call
  22. result = func(args,*kwargs)

Exception Type: TypeError at /login Exception Value: an integer is required (got type str)

Is this happening to somebody else? Any ideas how to fix this as 0.4.3 was working fine.

Thanks a lot!

trehn commented 8 years ago

Damn, this issue got old.

The error message is caused by https://code.djangoproject.com/ticket/26886 and is harmless. It has nothing to do with the login failure.

Try checking session_cookie_secure in your /etc/teamvault.cfg. It you're not using HTTPS, this can cause logins to not work without an error message.