[GH-ISSUE #3148] New Install 'AttributeError at /accounts/login/' #1779

Closed
opened 2026-02-27 11:19:04 +03:00 by kerem · 3 comments
Owner

Originally created by @smyers119 on GitHub (Dec 23, 2023).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3148

Impacted versions

  • OS Type: Debian 11
  • OS Version: 11
  • Database Type: PostgreSQL
  • Database version: whatever was installed with installer
  • Modoboa: Lastest
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

Fresh install of Debian 11 on a KVM with 4G RAM.
installed under a user account with sudo.

NOTE: Also tried on Debian 12 and I didn't even get this far.

How can the installer be this bad???

Current behavior

Install completes, then get error after trying to login using default user/pass for first time

Environment:


Request Method: POST
Request URL: https://mail.********.org/accounts/login/

Django Version: 4.2.8
Python Version: 3.9.2
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',
 'drf_spectacular',
 'phonenumber_field',
 'django_otp',
 'django_otp.plugins.otp_totp',
 'django_otp.plugins.otp_static',
 'django_rename_app',
 'django_rq',
 'modoboa',
 'modoboa.core',
 'modoboa.lib',
 'modoboa.admin',
 'modoboa.transport',
 'modoboa.relaydomains',
 'modoboa.limits',
 'modoboa.parameters',
 'modoboa.dnstools',
 'modoboa.policyd',
 'modoboa.maillog',
 'modoboa.pdfcredentials',
 'modoboa.dmarc',
 'modoboa.imap_migration',
 'modoboa_amavis',
 'modoboa_postfix_autoreply',
 'modoboa_sievefilters',
 'modoboa_webmail',
 'modoboa_contacts',
 'modoboa_radicale',
 'webpack_loader')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'x_forwarded_for.middleware.XForwardedForMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django_otp.middleware.OTPMiddleware',
 'modoboa.core.middleware.TwoFAMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'modoboa.core.middleware.LocalConfigMiddleware',
 'modoboa.lib.middleware.AjaxLoginRedirect',
 'modoboa.lib.middleware.CommonExceptionCatcher',
 'modoboa.lib.middleware.RequestCatcherMiddleware')



Traceback (most recent call last):
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/backends.py", line 46, in authenticate
    user = UserModel._default_manager.get_by_natural_key(username)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/base_user.py", line 54, in get_by_natural_key
    return self.get(**{self.model.USERNAME_FIELD: username})
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/models/manager.py", line 87, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/models/query.py", line 637, in get
    raise self.model.DoesNotExist(

During handling of the above exception (User matching query does not exist.), another exception occurred:
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/views/decorators/cache.py", line 62, in _wrapper_view_func
    response = view_func(request, *args, **kwargs)
  File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/core/views/auth.py", line 50, in dologin
    user = authenticate(username=form.cleaned_data["username"],
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/views/decorators/debug.py", line 42, in sensitive_variables_wrapper
    return func(*func_args, **func_kwargs)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/__init__.py", line 77, in authenticate
    user = backend.authenticate(request, **credentials)
  File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/backends.py", line 50, in authenticate
    UserModel().set_password(password)
  File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/core/models.py", line 118, in set_password
    ldap_sync_enable = param_tools.get_global_parameter("ldap_enable_sync")
  File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/parameters/tools.py", line 258, in get_global_parameter
    return get_localconfig().parameters.get_value(name, app=app, **kwargs)

Exception Type: AttributeError at /accounts/login/
Exception Value: 'NoneType' object has no attribute 'parameters'

Expected behavior

I expected a working installation, but maybe that was expecting to much? Does anyone actually use modoboa? should I switch back to iredmail?

Video/Screenshot link (optional)

modoboaerror

Originally created by @smyers119 on GitHub (Dec 23, 2023). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3148 # Impacted versions * OS Type: Debian 11 * OS Version: 11 * Database Type: PostgreSQL * Database version: whatever was installed with installer * Modoboa: Lastest * installer used: Yes * Webserver: Nginx # Steps to reproduce Fresh install of Debian 11 on a KVM with 4G RAM. installed under a user account with sudo. NOTE: Also tried on Debian 12 and I didn't even get this far. How can the installer be this bad??? # Current behavior Install completes, then get error after trying to login using default user/pass for first time ``` Environment: Request Method: POST Request URL: https://mail.********.org/accounts/login/ Django Version: 4.2.8 Python Version: 3.9.2 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', 'drf_spectacular', 'phonenumber_field', 'django_otp', 'django_otp.plugins.otp_totp', 'django_otp.plugins.otp_static', 'django_rename_app', 'django_rq', 'modoboa', 'modoboa.core', 'modoboa.lib', 'modoboa.admin', 'modoboa.transport', 'modoboa.relaydomains', 'modoboa.limits', 'modoboa.parameters', 'modoboa.dnstools', 'modoboa.policyd', 'modoboa.maillog', 'modoboa.pdfcredentials', 'modoboa.dmarc', 'modoboa.imap_migration', 'modoboa_amavis', 'modoboa_postfix_autoreply', 'modoboa_sievefilters', 'modoboa_webmail', 'modoboa_contacts', 'modoboa_radicale', 'webpack_loader') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'x_forwarded_for.middleware.XForwardedForMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django_otp.middleware.OTPMiddleware', 'modoboa.core.middleware.TwoFAMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'modoboa.core.middleware.LocalConfigMiddleware', 'modoboa.lib.middleware.AjaxLoginRedirect', 'modoboa.lib.middleware.CommonExceptionCatcher', 'modoboa.lib.middleware.RequestCatcherMiddleware') Traceback (most recent call last): File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/backends.py", line 46, in authenticate user = UserModel._default_manager.get_by_natural_key(username) File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/base_user.py", line 54, in get_by_natural_key return self.get(**{self.model.USERNAME_FIELD: username}) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/srv/modoboa/env/lib/python3.9/site-packages/django/db/models/query.py", line 637, in get raise self.model.DoesNotExist( During handling of the above exception (User matching query does not exist.), another exception occurred: File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/srv/modoboa/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python3.9/contextlib.py", line 79, in inner return func(*args, **kwds) File "/usr/lib/python3.9/contextlib.py", line 79, in inner return func(*args, **kwds) File "/srv/modoboa/env/lib/python3.9/site-packages/django/views/decorators/cache.py", line 62, in _wrapper_view_func response = view_func(request, *args, **kwargs) File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/core/views/auth.py", line 50, in dologin user = authenticate(username=form.cleaned_data["username"], File "/srv/modoboa/env/lib/python3.9/site-packages/django/views/decorators/debug.py", line 42, in sensitive_variables_wrapper return func(*func_args, **func_kwargs) File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/__init__.py", line 77, in authenticate user = backend.authenticate(request, **credentials) File "/srv/modoboa/env/lib/python3.9/site-packages/django/contrib/auth/backends.py", line 50, in authenticate UserModel().set_password(password) File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/core/models.py", line 118, in set_password ldap_sync_enable = param_tools.get_global_parameter("ldap_enable_sync") File "/srv/modoboa/env/lib/python3.9/site-packages/modoboa/parameters/tools.py", line 258, in get_global_parameter return get_localconfig().parameters.get_value(name, app=app, **kwargs) Exception Type: AttributeError at /accounts/login/ Exception Value: 'NoneType' object has no attribute 'parameters' ``` # Expected behavior I expected a working installation, but maybe that was expecting to much? Does anyone actually use modoboa? should I switch back to iredmail? # Video/Screenshot link (optional) ![modoboaerror](https://github.com/modoboa/modoboa/assets/35839355/d1846b51-225f-4b94-abe4-0c78648bce8e)
kerem closed this issue 2026-02-27 11:19:04 +03:00
Author
Owner

@smyers119 commented on GitHub (Dec 23, 2023):

I found a solution, which was to switch back to iredmail. Best of luck to you guys!

<!-- gh-comment-id:1868366063 --> @smyers119 commented on GitHub (Dec 23, 2023): I found a solution, which was to switch back to iredmail. Best of luck to you guys!
Author
Owner

@guillaumearnx commented on GitHub (Dec 30, 2023):

Same issue with Ubuntu 22.04
Fresh install, DNS OK

<!-- gh-comment-id:1872581442 --> @guillaumearnx commented on GitHub (Dec 30, 2023): Same issue with Ubuntu 22.04 Fresh install, DNS OK
Author
Owner

@Seb7159 commented on GitHub (Jan 10, 2024):

has anyone found a solution to this? having the exact same problem.
please reopen this issue!

<!-- gh-comment-id:1885826297 --> @Seb7159 commented on GitHub (Jan 10, 2024): has anyone found a solution to this? having the exact same problem. please reopen this issue!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1779
No description provided.