modoboa / modoboa-installer

An installer for Modoboa
MIT License
258 stars 135 forks source link

Installation fails on Ubuntu 24.04 #556

Closed benjaminbellamy closed 4 months ago

benjaminbellamy commented 4 months ago

Impacted versions

Steps to reproduce

Full trace

full-trace-with-debug-option.txt

Welcome to Modoboa installer!

Checking the installer...
Installer seems up to date!
Checks complete

Configuration file installer.cfg not found, creating new one.
Notice:
It is recommanded to run this installer on a FRESHLY installed server.
(ie. with nothing special already installed on it)

Warning:
Before you start the installation, please make sure the following DNS records exist for domain '▮▮▮▮.▮▮▮':
  mail IN A   <IP ADDRESS OF YOUR SERVER>
     @ IN MX  mail.▮▮▮▮.▮▮▮.

Your mail server will be installed with the following components:
fail2ban modoboa automx amavis clamav dovecot nginx razor postfix postwhite spamassassin uwsgi radicale opendkim
Do you confirm? (Y/n) Y
The process can be long, feel free to take a coffee and come back later ;)
Starting...
Generating new self-signed certificate
Installing amavis
/home/ubuntu/modoboa-installer/modoboa_installer/database.py:106: SyntaxWarning: invalid escape sequence '\|'
  "psql -lqt | cut -d \| -f 1 | grep -w {} | wc -l"
/home/ubuntu/modoboa-installer/modoboa_installer/python.py:124: SyntaxWarning: invalid escape sequence '\<'
  install_packages(["pip", "setuptools\<58.0.0"], venv=path, upgrade=True)
Installing spamassassin
Installing razor
Installing clamav
Installing fail2ban
Installing modoboa
/home/ubuntu/modoboa-installer/modoboa_installer/scripts/modoboa.py:105: SyntaxWarning: invalid escape sequence '\<'
  req_version = req_version.replace("<", "\<")
/home/ubuntu/modoboa-installer/modoboa_installer/scripts/modoboa.py:106: SyntaxWarning: invalid escape sequence '\>'
  req_version = req_version.replace(">", "\>")
b'Traceback (most recent call last):\n  File "/srv/modoboa/env/bin/modoboa-admin.py", line 3, in <module>\n    from modoboa.core.commands import handle_command_line\n  File "/srv/modoboa/env/lib/python3.12/site-packages/modoboa/__init__.py", line 3, in <module>\n    from pkg_resources import DistributionNotFound, get_distribution\n  File "/srv/modoboa/env/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2158, in <module>\n    register_finder(pkgutil.ImpImporter, find_on_path)\n                    ^^^^^^^^^^^^^^^^^^^\nAttributeError: module \'pkgutil\' has no attribute \'ImpImporter\'. Did you mean: \'zipimporter\'?\n'

Expected behavior

Install Modoboa.

Video/Screenshot link (optional)

Screenshot from 2024-05-31 12-46-30

mkommar commented 4 months ago

A couple things as I just installed myself.

1) Ensure you have a database username and password for the right database set. My was MySQL and not Postgres. Additionally, a password was not set in the .cfg 2)

This fixed it for me and was able to re-run the interactive setup:

root@mkommar-Alienware-15-R3:/home/mkommar/modoboa-installer# cd /srv/modoboa/
root@mkommar-Alienware-15-R3:/srv/modoboa# ls
env
root@mkommar-Alienware-15-R3:/srv/modoboa# cd env/bin/
root@mkommar-Alienware-15-R3:/srv/modoboa/env/bin# ls
activate       change_tz     icalendar         modoboa-cli  pip3.12       priforgepng  priplan9topng  priweavepng  python3.12  rqworker
activate.csh   chardetect    ics_diff          normalizer   prichunkpng   prigreypng   pripnglsch     __pycache__  qr          sqlformat
activate.fish  django-admin  jsonschema        pip          pricolpng     pripalpng    pripngtopam    python       rq          tldextract
Activate.ps1   html2text     modoboa-admin.py  pip3         priditherpng  pripamtopng  prirowpng      python3      rqinfo      x-wr-timezone
root@mkommar-Alienware-15-R3:/srv/modoboa/env/bin# cd  ..
root@mkommar-Alienware-15-R3:/srv/modoboa/env# cd ..
root@mkommar-Alienware-15-R3:/srv/modoboa# source env/bin/activate
(env) root@mkommar-Alienware-15-R3:/srv/modoboa# ls
env
(env) root@mkommar-Alienware-15-R3:/srv/modoboa# pip install --upgrade setuptools

Hope it helps.

tonioo commented 4 months ago

@benjaminbellamy This version of Ubuntu is not yet supported by Modoboa installer

tonioo commented 4 months ago

@benjaminbellamy I created a branch with a fix. Could you try it please?

benjaminbellamy commented 4 months ago

@benjaminbellamy I created a branch with a fix. Could you try it please?

I'll try next week. Thank you @tonioo ! 🙏

robertjf commented 2 months ago

@tonioo I just tried with the latest installer and still got an error on Ubuntu 24.04... I compared your patch to what I had when I cloned the repository, and everything was there but I had to revert the first patch (modoboa_installer/python.py line 102):

+ def setup_virtualenv(path, sudo_user=None, python_version=2):
- def setup_virtualenv(path, sudo_user=None):

after that the installer worked nicely.