Hi,
I'm trying to migrate several lists from an ubuntu 18.04, where it was installed via packages (mailman 3.1.1), to ubuntu 22.04.
Since ubuntu 22.04 is broken in terms of packages for mailman3, I'm trying to install manually following the site instructions.
I just dumped the mysql DB we have nowadays, mailman3 and mailman3-web, and loaded in the new server. I also copied the configurations and fixed the paths since now mailman3 lives on /local/mailman and it uses venv. I also copied /var/lib/mailman3 into /local/mailman/var/lib/mailman3.
mailman seems to accept pretty much of the work done.
(venv) mailman@new-server ~ (v3.3.9)> mailman info GNU Mailman 3.3.9 (Tom Sawyer) Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] config file: /etc/mailman3/mailman.cfg db url: mysql+pymysql://mailman3:********@localhost/mailman3?charset=utf8mb4&use_unicode=1 devmode: DISABLED REST root url: http://localhost:8001/3.1/ REST credentials: restadmin:***********
Even configuration is working fine.
(venv) mailman@new-server ~ (v3.3.9)> mailman conf [ARC] authserv_id: [ARC] dkim: yes [ARC] dmarc: yes [ARC] domain: [ARC] enabled: no [ARC] privkey: [ARC] selector: [ - a lot of stuff - ] [shell] banner: Welcome to the GNU Mailman shell [shell] history_file: [shell] prompt: >>> [shell] use_ipython: no [styles] default: legacy-default [webservice] admin_pass: ************************* [webservice] admin_user: restadmin [webservice] api_version: 3.1 [webservice] configuration: python:mailman.config.gunicorn [webservice] hostname: localhost [webservice] port: 8001 [webservice] show_tracebacks: yes [webservice] use_https: no [webservice] workers: 2
But it is failing to start displaying the domain name from the previous machine.
(venv) mailman@new-server ~ (v3.3.9)> mailman start Starting Mailman's master runner Generating MTA alias maps Traceback (most recent call last): File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context self.dialect.do_execute( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute cursor.execute(statement, parameters) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/cursors.py", line 153, in execute result = self._query(query) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/cursors.py", line 322, in _query conn.query(q) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 558, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 822, in _read_query_result result.read() File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 1200, in read first_packet = self.connection._read_packet() File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 772, in _read_packet packet.raise_for_error() File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.OperationalError: (1054, "Unknown column 'domain.alias_domain' in 'field list'")
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/local/mailman/venv/bin/mailman", line 33, in <module> sys.exit(load_entry_point('mailman==3.3.9', 'console_scripts', 'mailman')()) File "/local/mailman/venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) File "/local/mailman/venv/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/local/mailman/venv/lib/python3.10/site-packages/mailman/bin/mailman.py", line 69, in invoke return super().invoke(ctx) File "/local/mailman/venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/local/mailman/venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "/local/mailman/venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) File "/local/mailman/venv/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) File "/local/mailman/venv/lib/python3.10/site-packages/mailman/commands/cli_control.py", line 109, in start call_name(config.mta.incoming).regenerate() File "/local/mailman/venv/lib/python3.10/site-packages/mailman/mta/postfix.py", line 109, in regenerate self._generate_lmtp_file(fp) File "/local/mailman/venv/lib/python3.10/site-packages/mailman/mta/postfix.py", line 149, in _generate_lmtp_file mlist = _FakeList(list_name, mail_host) File "/local/mailman/venv/lib/python3.10/site-packages/mailman/mta/postfix.py", line 75, in __init__ self.mail_host = _get_alias_domain(mail_host) File "/local/mailman/venv/lib/python3.10/site-packages/mailman/mta/postfix.py", line 63, in _get_alias_domain d = domain_manager.get(domain) File "/local/mailman/venv/lib/python3.10/site-packages/mailman/database/transaction.py", line 106, in wrapper return function(args[0], config.db.store, *args[1:], **kws) File "/local/mailman/venv/lib/python3.10/site-packages/mailman/model/domain.py", line 162, in get if domains.count() < 1: File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 3132, in count self._legacy_from_self(col).enable_eagerloads(False).scalar() File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2825, in scalar ret = self.one() File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2798, in one return self._iter().one() # type: ignore File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2847, in _iter result: Union[ScalarResult[_T], Result[_T]] = self.session.execute( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2308, in execute return self._execute_internal( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2190, in _execute_internal result: Result[Any] = compile_state_cls.orm_execute_statement( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/orm/context.py", line 293, in orm_execute_statement result = conn.execute( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1416, in execute return meth( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection return connection._execute_clauseelement( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1639, in _execute_clauseelement ret = self._execute_context( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1848, in _execute_context return self._exec_single_context( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1988, in _exec_single_context self._handle_dbapi_exception( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2343, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1969, in _exec_single_context self.dialect.do_execute( File "/local/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute cursor.execute(statement, parameters) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/cursors.py", line 153, in execute result = self._query(query) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/cursors.py", line 322, in _query conn.query(q) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 558, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 822, in _read_query_result result.read() File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 1200, in read first_packet = self.connection._read_packet() File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 772, in _read_packet packet.raise_for_error() File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "/local/mailman/venv/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1054, "Unknown column 'domain.alias_domain' in 'field list'") [SQL: SELECT count(*) AS count_1 FROM (SELECT domain.id AS domain_id, domain.mail_host AS domain_mail_host, domain.description AS domain_description, domain.alias_domain AS domain_alias_domain FROM domain WHERE domain.mail_host = %(mail_host_1)s) AS anon_1] [parameters: {'mail_host_1': 'old-server.mydomain.com'}] (Background on this error at: https://sqlalche.me/e/20/e3q8)
But I can see some processes are starting.
(venv) mailman@new-server ~ (v3.3.9)> ps auxwww | grep "[p]ython" | grep mailman mailman 1411605 0.0 0.0 32180 22212 ? Ss 10:44 0:00 /local/mailman/venv/bin/python /local/mailman/venv/bin/gunicorn -c /etc/mailman3/gunicorn.conf mailman_web.wsgi:application mailman 1411607 0.0 0.0 44244 32412 ? S 10:44 0:00 /local/mailman/venv/bin/python /local/mailman/venv/bin/gunicorn -c /etc/mailman3/gunicorn.conf mailman_web.wsgi:application mailman 1411671 1.0 0.2 98584 83004 ? Ss 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/master -C /etc/mailman3/mailman.cfg mailman 1411681 1.0 0.2 98392 82504 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=archive:0:1 mailman 1411682 97.7 10.1 3396160 3346868 ? R 10:45 1:58 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=bounces:0:1 mailman 1411683 1.0 0.2 98588 82816 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=command:0:1 mailman 1411684 1.0 0.2 98580 82904 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=in:0:1 mailman 1411685 1.0 0.2 172312 82772 ? Sl 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=lmtp:0:1 mailman 1411686 1.1 0.2 98588 82652 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=nntp:0:1 mailman 1411687 1.1 0.2 98608 83016 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=out:0:1 mailman 1411688 1.0 0.2 98584 82936 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=pipeline:0:1 mailman 1411689 1.1 0.2 107040 90972 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=rest:0:1 mailman 1411690 1.0 0.2 98592 82784 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=retry:0:1 mailman 1411691 41.3 0.5 187380 171012 ? S 10:45 0:50 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=task:0:1 mailman 1411692 1.0 0.2 98472 83028 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=virgin:0:1 mailman 1411693 1.0 0.2 98448 82608 ? S 10:45 0:01 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=digest:0:1 mailman 1411705 0.0 0.2 107040 75968 ? S 10:45 0:00 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=rest:0:1 mailman 1411709 0.0 0.2 107040 75968 ? S 10:45 0:00 /local/mailman/venv/bin/python /local/mailman/venv/bin/runner -C /etc/mailman3/mailman.cfg --runner=rest:0:1 mailman 1413629 0.0 0.0 17644 8812 ? Rs 10:47 0:00 /local/mailman/venv/bin/python /local/mailman/venv/bin/mailman start
Best Regards, Helio Loureiro http://helio.loureiro.eng.br https://github.com/helioloureiro