modoboa / modoboa-imap-migration

An extension to ease the migration between 2 IMAP servers using offlineimap
ISC License
16 stars 12 forks source link

Error on login with old system credentials #26

Closed Goosse closed 7 years ago

Goosse commented 7 years ago

I was able to get modo boa and modoboa-imap-migration installed, but when I tried logging in with the credentials for a user on the old system I got an error as follows:

Environment:

Request Method: POST Request URL: https://mail.email.wheatstatewooddesign.com/accounts/login/

Django Version: 1.10.8 Python Version: 2.7.12 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.sites', 'django.contrib.staticfiles', 'reversion', 'ckeditor', 'ckeditor_uploader', 'rest_framework', 'rest_framework.authtoken', 'modoboa', 'modoboa.core', 'modoboa.lib', 'modoboa.admin', 'modoboa.relaydomains', 'modoboa.limits', 'modoboa.parameters', 'modoboa_amavis', 'modoboa_pdfcredentials', 'modoboa_postfix_autoreply', 'modoboa_sievefilters', 'modoboa_stats', 'modoboa_webmail', 'modoboa_contacts', 'modoboa_imap_migration', 'webpack_loader') Installed Middleware: ('x_forwarded_for.middleware.XForwardedForMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'modoboa.core.middleware.LocalConfigMiddleware', 'modoboa.lib.middleware.AjaxLoginRedirect', 'modoboa.lib.middleware.CommonExceptionCatcher', 'modoboa.lib.middleware.RequestCatcherMiddleware')

Traceback:

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response

  1. response = self._get_response(request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner

  1. return func(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py" in inner

  1. return func(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func

  1. response = view_func(request, *args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/core/views/auth.py" in dologin

  1. password=form.cleaned_data["password"])

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/init.py" in authenticate

  1. user = backend.authenticate(**credentials)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/auth_backends.py" in authenticate

  1. return self.get_or_create_user(username, password)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_imap_migration/auth_backends.py" in get_or_create_user

  1. Migration.objects.create(mailbox=user.mailbox, password=password)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method

  1. return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py" in create

  1. obj.save(force_insert=True, using=self.db)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in save

  1. force_update=force_update, update_fields=update_fields)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in save_base

  1. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in _save_table

  1. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/base.py" in _do_insert

  1. using=using, raw=raw)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method

  1. return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/query.py" in _insert

  1. return query.get_compiler(using=using).execute_sql(return_id)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql

  1. cursor.execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute

  1. return super(CursorDebugWrapper, self).execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute

  1. return self.cursor.execute(sql, params)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/utils.py" in exit

  1. six.reraise(dj_exc_type, dj_exc_value, traceback)

File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute

  1. return self.cursor.execute(sql, params)

Exception Type: DataError at /accounts/login/ Exception Value: value too long for type character varying(100)

tonioo commented 7 years ago

Duplicate of #17 which is fixed and will be released with the next version.

Goosse commented 7 years ago

Oops, thanks