Skip to content

Install fails (but states otherwise) server error 500 #628

Description

@manuelkamp

Installed it on Ubuntu 24.04 with this command (my.domain is only placeholder here to not provide my domain in public, I used real fqdn):

sudo python3 run.py my.domain

installer went through without any errors.

Congratulations! You can enjoy Modoboa at https://my.domain (admin:password)

opening browser at the given domain, It is stuck at "Attempting to log you in."

Additionally I have this errors in Browser:

api/o/.well-known/openid-configuration:1   Failed to load resource: the server responded with a status of 500 ()
index-DY5xtvr4.js:58  Error logging in: Error: Invalid response Content-Type: text/html; charset=utf-8, from URL: https://my.domain/api/o/.well-known/openid-configuration
    at Lc.getJson (index-DY5xtvr4.js:58:231108)
    at async Xk.getMetadata (index-DY5xtvr4.js:58:234207)
    at async Xk._getMetadataProperty (index-DY5xtvr4.js:58:235206)
    at async rC.createSigninRequest (index-DY5xtvr4.js:58:256111)
    at async xC._signinStart (index-DY5xtvr4.js:58:281750)
    at async xC.signinRedirect (index-DY5xtvr4.js:58:276602)
    at async Proxy.x (index-DY5xtvr4.js:58:289253)
x @ index-DY5xtvr4.js:58

I found this in error logs from modoboa itself:

at Mar 14 12:12:45 2026 - *** Starting uWSGI 2.0.24-debian (64bit) on [Sat Mar 14 12:12:45 2026] ***
Sat Mar 14 12:12:45 2026 - compiled with version: 13.2.0 on 17 April 2024 16:23:48
Sat Mar 14 12:12:45 2026 - os: Linux-6.17.13-2-pve #1 SMP PREEMPT_DYNAMIC PMX 6.17.13-2 (2026-03-13T08:06Z)
Sat Mar 14 12:12:45 2026 - nodename: srv-mx1
Sat Mar 14 12:12:45 2026 - machine: x86_64
Sat Mar 14 12:12:45 2026 - clock source: unix
Sat Mar 14 12:12:45 2026 - pcre jit disabled
Sat Mar 14 12:12:45 2026 - detected number of CPU cores: 24
Sat Mar 14 12:12:45 2026 - current working directory: /
Sat Mar 14 12:12:45 2026 - writing pidfile to /run/uwsgi/app/modoboa_instance/pid
Sat Mar 14 12:12:45 2026 - detected binary path: /usr/bin/uwsgi-core
Sat Mar 14 12:12:45 2026 - chdir() to /srv/modoboa/instance
Sat Mar 14 12:12:45 2026 - your processes number limit is 514206
Sat Mar 14 12:12:45 2026 - your memory page size is 4096 bytes
Sat Mar 14 12:12:45 2026 - detected max file descriptor number: 1024
Sat Mar 14 12:12:45 2026 - VirtualHosting mode enabled.
Sat Mar 14 12:12:45 2026 - lock engine: pthread robust mutexes
Sat Mar 14 12:12:45 2026 - thunder lock: disabled (you can enable it with --thunder-lock)
Sat Mar 14 12:12:45 2026 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/modoboa_instance/socket fd 3
Sat Mar 14 12:12:45 2026 - setgid() to 1000
Sat Mar 14 12:12:45 2026 - setuid() to 1000
Sat Mar 14 12:12:45 2026 - Python version: 3.12.3 (main, Mar  3 2026, 12:15:18) [GCC 13.3.0]
Sat Mar 14 12:12:45 2026 - PEP 405 virtualenv detected: /srv/modoboa/env
Sat Mar 14 12:12:45 2026 - Set PythonHome to /srv/modoboa/env
Sat Mar 14 12:12:45 2026 - *** Python threads support is disabled. You can enable it with --enable-threads ***
Sat Mar 14 12:12:45 2026 - Python main interpreter initialized at 0x70199822b668
Sat Mar 14 12:12:45 2026 - your server socket listen backlog is limited to 100 connections
Sat Mar 14 12:12:45 2026 - your mercy for graceful operations on workers is 60 seconds
Sat Mar 14 12:12:45 2026 - mapped 385080 bytes (376 KB) for 4 cores
Sat Mar 14 12:12:45 2026 - *** Operational MODE: preforking ***
Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/config.py", line 581, in configure
    handler = self.configure_handler(handlers[name])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/config.py", line 848, in configure_handler
    result = factory(**kwargs)
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/handlers.py", line 861, in __init__
    self.createSocket()
  File "/usr/lib/python3.12/logging/handlers.py", line 929, in createSocket
    raise err
  File "/usr/lib/python3.12/logging/handlers.py", line 920, in createSocket
    sock = socket.socket(af, socktype, proto)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/socket.py", line 233, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
PermissionError: [Errno 13] Permission denied

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/modoboa/instance/instance/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/modoboa/env/lib/python3.12/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/srv/modoboa/env/lib/python3.12/site-packages/django/__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/srv/modoboa/env/lib/python3.12/site-packages/django/utils/log.py", line 76, in configure_logging
    logging_config_func(logging_settings)
  File "/usr/lib/python3.12/logging/config.py", line 914, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib/python3.12/logging/config.py", line 588, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'syslog'
Sat Mar 14 12:12:45 2026 - unable to load app 0 (mountpoint='') (callable not found or import error)
Sat Mar 14 12:12:45 2026 - *** no app loaded. going in full dynamic mode ***
Sat Mar 14 12:12:45 2026 - spawned uWSGI master process (pid: 7590)
Sat Mar 14 12:12:45 2026 - spawned uWSGI worker 1 (pid: 7679, cores: 1)
Sat Mar 14 12:12:45 2026 - spawned uWSGI worker 2 (pid: 7680, cores: 1)
Sat Mar 14 12:12:45 2026 - spawned uWSGI worker 3 (pid: 7681, cores: 1)
Sat Mar 14 12:12:45 2026 - spawned uWSGI worker 4 (pid: 7682, cores: 1)
Traceback (most recent call last):
  File "/usr/lib/python3.12/logging/config.py", line 581, in configure
    handler = self.configure_handler(handlers[name])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/config.py", line 848, in configure_handler
    result = factory(**kwargs)
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/logging/handlers.py", line 861, in __init__
    self.createSocket()
  File "/usr/lib/python3.12/logging/handlers.py", line 929, in createSocket
    raise err
  File "/usr/lib/python3.12/logging/handlers.py", line 920, in createSocket
    sock = socket.socket(af, socktype, proto)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/socket.py", line 233, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
PermissionError: [Errno 13] Permission denied

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/modoboa/instance/instance/wsgi.py", line 16, in <module>
    application = get_wsgi_application()
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/modoboa/env/lib/python3.12/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "/srv/modoboa/env/lib/python3.12/site-packages/django/__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/srv/modoboa/env/lib/python3.12/site-packages/django/utils/log.py", line 76, in configure_logging
    logging_config_func(logging_settings)
  File "/usr/lib/python3.12/logging/config.py", line 914, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib/python3.12/logging/config.py", line 588, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'syslog'
Sat Mar 14 12:16:59 2026 - unable to load app 0 (mountpoint='my.domain|') (callable not found or import error)
Sat Mar 14 12:16:59 2026 - --- no python application found, check your startup logs for errors ---
my.domain [pid: 7682|app: -1|req: -1/1] 10.0.3.5 () {60 vars in 1451 bytes} [Sat Mar 14 12:16:59 2026] GET /api/o/.well-known/openid-configuration => generated 21 bytes in 5 msecs (HTTP/2.0 500) 2 headers in 83 bytes (1 switches on core 0)

So I replaced the whole LOGGING-block in settings.py with:

LOGGING = {
    'version': 1,
    'formatters': {
        'simple': {
            'format': '%(name)s: %(levelname)s %(message)s'
        },
    },
    'handlers': {
        'mail-admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler',
            'include_html': True
        },
        'console': {
            'class': 'logging.StreamHandler',
            'formatter': 'simple',
        },
        'modoboa': {
            'class': 'modoboa.core.loggers.SQLHandler',
        }
    },
    'loggers': {
        'django': {
            'handlers': ['mail-admins'],
            'level': 'ERROR',
            'propagate': False
        },
        'modoboa.auth': {
            'handlers': ['console', 'modoboa'],
            'level': 'INFO',
            'propagate': False
        },
        'modoboa.admin': {
            'handlers': ['modoboa'],
            'level': 'INFO',
            'propagate': False
        },
        'modoboa.dns': {
            'handlers': ['console'],
            'level': 'INFO',
            'propagate': False
        },
        'modoboa.policyd': {
            'handlers': ['console'],
            'level': 'INFO',
            'propagate': False
        }
    }
}

But still cannot get it to work unfortunately...
Used now 3 hours of troubleshooting, so I guess that would be the time needed to install everything manually :(

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions