Walk-thru for Ubuntu Bionic Mailman 3 Full setup
I hope this is helpful to the Ubuntu folks out there. Once some critical small things were figured out, turns out it's pretty easy to get Mailman 3 running successfully under Ubuntu 18.04. The linked google doc includes my own walkthru, which includes using a cloud server image for Ubuntu 18.04 and a LAMP setup with Apache 2 and PHP, as well as Python and PostgreSQL, and the mailman3-full package that comes with that Ubuntu distribution. The walk-thru uses Postfix for mail and PostgreSQL for the back end database.
https://docs.google.com/document/d/1xIcSsoNFp2nHi7r4eQys00s9a0k2sHhu1V5Plant...
If you use this and see needed corrections or additions, please let me know! ~Kelly
On 4/9/19 11:16 AM, kelly.close@lrewater.com wrote:
I hope this is helpful to the Ubuntu folks out there. Once some critical small things were figured out, turns out it's pretty easy to get Mailman 3 running successfully under Ubuntu 18.04. The linked google doc includes my own walkthru, which includes using a cloud server image for Ubuntu 18.04 and a LAMP setup with Apache 2 and PHP, as well as Python and PostgreSQL, and the mailman3-full package that comes with that Ubuntu distribution. The walk-thru uses Postfix for mail and PostgreSQL for the back end database.
https://docs.google.com/document/d/1xIcSsoNFp2nHi7r4eQys00s9a0k2sHhu1V5Plant...
Thank you for this. I'm sure it will be helpful.
One caveat. The Mailman 3 package for Ubuntu 18.04 is core version 3.1.1. This version when used with the MySQL back end database can have a serious issue. It doesn't affect the PostgreSQL back end database, only MySQL and maybe MariaDB, and it is fixed in Mailan core 3.2.0. See <https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...> for more info.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks Kelly. I am working through this now. I made one failed attempt at setting up MM3 on Ubuntu. I chose exim as the MTA in that attempt which proved to be difficult for me. I have 2 successful installations using CentOS 7 however I would like to get a working installation on Ubuntu. Appreciate the hard work that went into this.
Brian
I followed Kelly's guide and ran into some issues but were able to resolve most of them. It seems I have one out standing issue: Hyperkitty. When I post to a list, I am getting the following in the /var/log/mailman3/mailman.log:
Apr 11 14:01:15 2019 (1334) HyperKitty failure on http://localhost/mailman3/hyperkitty/api/mailman/archive: <!DOCTYPE HTML PUBLIC "-//IETF/$ <html><head> <title>503 Service Unavailable</title> </head><body> <h1>Service Unavailable</h1> <p>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</p> <hr> <address>Apache/2.4.29 (Ubuntu) Server at localhost Port 80</address> </body></html> (503) Apr 11 14:01:15 2019 (1334) Exception in the HyperKitty archiver: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>503 Service Unavailable</title> </head><body> <h1>Service Unavailable</h1> <p>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</p> <hr> <address>Apache/2.4.29 (Ubuntu) Server at localhost Port 80</address> </body></html> Apr 11 14:01:15 2019 (1334) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/mailman_hyperkitty/__init__.py", line 154, in _archive_message url = self._send_message(mlist, msg) File "/usr/lib/python3/dist-packages/mailman_hyperkitty/__init__.py", line 210, in _send_message raise ValueError(result.text) ValueError: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>503 Service Unavailable</title> </head><body> <h1>Service Unavailable</h1> <p>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</p> <hr> <address>Apache/2.4.29 (Ubuntu) Server at localhost Port 80</address> </body></html>
Everything else works fine. Postfix is receiving and delivery mail to Mailman3. List members are receiving the posts. I can access the list on Hyperkitty just no archived messages.
Mailman 3 was installed using the mailman3-full package on Ubuntu 18:04 as per this walkthrough by Kelly.
On 4/11/19 10:02 AM, brian@emwd.com wrote:
I followed Kelly's guide and ran into some issues but were able to resolve most of them. It seems I have one out standing issue: Hyperkitty. When I post to a list, I am getting the following in the /var/log/mailman3/mailman.log:
Apr 11 14:01:15 2019 (1334) HyperKitty failure on http://localhost/mailman3/hyperkitty/api/mailman/archive: <!DOCTYPE HTML PUBLIC "-//IETF/$ <html><head> <title>503 Service Unavailable</title> </head><body> <h1>Service Unavailable</h1> <p>The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.</p> <hr> <address>Apache/2.4.29 (Ubuntu) Server at localhost Port 80</address> </body></html> (503) ...
Everything else works fine. Postfix is receiving and delivery mail to Mailman3. List members are receiving the posts. I can access the list on Hyperkitty just no archived messages.
What URL do you use to access HyperKitty.
The problem URL above, http://localhost/mailman3/hyperkitty/api/mailman/archive is based on the base_url setting in mailman-hyperkitty.cfg which in your case is http://localhost/mailman3/hyperkitty/, byt the web server listening on localhost:80 is returning the Service Unavailable. It probably doesn't like the IP or name 'localhost'.
Set base_url in mailman-hyperkitty.cfg to use an acceptable host name instead of localhost or adjust your apache config to accept localhost.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Everything else works fine. Postfix is receiving and delivery mail to Mailman3. List members are receiving the posts. I can access the list on Hyperkitty just no archived messages. What URL do you use to access HyperKitty.
I use http://mailman3-lists.com/mailman3/hyperkitty/. However I changed the base-url from localhost to mailman3-lists.com and saw the same error except the URL reflected mailman3-lists.com instead of localhost.
The problem URL above, http://localhost/mailman3/hyperkitty/api/mailman/archive is based on the base_url setting in mailman-hyperkitty.cfg which in your case is http://localhost/mailman3/hyperkitty/, byt the web server listening on localhost:80 is returning the Service Unavailable. It probably doesn't like the IP or name 'localhost'.
I have this in the apache2.conf file:
ServerName localhost
I can access the apache default page when using the following:
curl http://localhost.com
Set base_url in mailman-hyperkitty.cfg to use an acceptable host name instead of localhost or adjust your apache config to accept localhost.
Isn't ServerName enough?
This error also appears in the apache log file when new posts are sent to the list:
[Thu Apr 11 19:55:38.755750 2019] [:error] [pid 21370:tid 139988922513152] (32)Broken pipe: [client ::1:49574] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.769245 2019] [:error] [pid 21370:tid 139989049186048] (32)Broken pipe: [client ::1:49576] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.777583 2019] [:error] [pid 21370:tid 139988914120448] (32)Broken pipe: [client ::1:49578] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.787681 2019] [:error] [pid 21370:tid 139988905727744] (32)Broken pipe: [client ::1:49580] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.798273 2019] [:error] [pid 21369:tid 139989082756864] (32)Broken pipe: [client ::1:49582] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.807790 2019] [:error] [pid 21370:tid 139988897335040] (32)Broken pipe: [client ::1:49584] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.818123 2019] [:error] [pid 21369:tid 139989074364160] (32)Broken pipe: [client ::1:49586] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.827737 2019] [:error] [pid 21370:tid 139988888942336] (32)Broken pipe: [client ::1:49588] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.837612 2019] [:error] [pid 21370:tid 139988880549632] (32)Broken pipe: [client ::1:49590] sending data to httpd-UDS:0 failed [Thu Apr 11 19:55:38.848250 2019] [:error] [pid 21370:tid 139988872156928] (32)Broken pipe: [client ::1:49592] sending data to httpd-UDS:0 failed
Brian
On 4/11/19 12:58 PM, brian@emwd.com wrote:
I have this in the apache2.conf file:
ServerName localhost
I can access the apache default page when using the following:
curl http://localhost.com
OK, so you can get to Apache, but can you proxy to uwsgi? Try
curl http://localhost/mailman3/hyperkitty/api/mailman/archive
or
curl http://mailman3-lists.com/mailman3/hyperkitty/api/mailman/archive
Set base_url in mailman-hyperkitty.cfg to use an acceptable host name instead of localhost or adjust your apache config to accept localhost.
Isn't ServerName enough?
It should be. The error is apparently elsewhere.
This error also appears in the apache log file when new posts are sent to the list:
[Thu Apr 11 19:55:38.755750 2019] [:error] [pid 21370:tid 139988922513152] (32)Broken pipe: [client ::1:49574] sending data to httpd-UDS:0 failed
The broken pipe is apparently from the exception in mailman-hyperkitty and the 'sending data to httpd-UDS:0 failed' is I think a normal response from uwsgi under this circumstance.
I don't know what the issue is, but it is something in the Apache/uwsgi configuration. I note that the client in the above error is an IPv6 loopback address. That may be significant.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Ok. I went ahead and did a server wipe and tried again. This time I went with nginx as the webserver. Everything worked fine but I got the dreaded hyperkitty "auth required" error that Kelly mentioned in her walkthrough. However no matter how hard I tried to make sure the keys matched in mailman-hyperkitty.cfg and mailman-web.py, I kept getting the same error. However I noticed that a key was already there originally in mailman-web.py in the MAILMAN_ARCHIVER_KEY setting. So I decided to use that in mailman-hyperkitty.cfg and viola, it worked!
Also Kelly are you sure this is correct:
"There are two configuration files that have a key in them that must match for Hyperhitty to authorize and be able to store archives (the paths should be as follows): /etc/mailman3/mailman-hyperkitty.cfg (set the api_key without any quotes) /etc/mailman3/mailman-web.py (set the ‘SECRET_KEY’ - include single quotes around the key)"
It was the MAILMAN_ARCHIVER_KEY that I needed to make sure it was being matched by the API key in mailman-hyperkitty.cfg. I believe the SECRET_KEY setting has nothing to do with the auth errors that Hyperkitty was displaying.
Brian
On 4/11/19 6:40 PM, brian@emwd.com wrote:
Also Kelly are you sure this is correct:
"There are two configuration files that have a key in them that must match for Hyperhitty to authorize and be able to store archives (the paths should be as follows): /etc/mailman3/mailman-hyperkitty.cfg (set the api_key without any quotes) /etc/mailman3/mailman-web.py (set the ‘SECRET_KEY’ - include single quotes around the key)"
It was the MAILMAN_ARCHIVER_KEY that I needed to make sure it was being matched by the API key in mailman-hyperkitty.cfg. I believe the SECRET_KEY setting has nothing to do with the auth errors that Hyperkitty was displaying.
Yes. SECRET_KEY is used internally within Django. See <https://docs.djangoproject.com/en/2.1/ref/settings/#secret-key>. It is the MAILMAN_ARCHIVER_KEY setting that must match the api_key setting in mailman-hyperkitty.cfg (modulo quoting).
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks for this Brian - I missed this when you posted it but just ran into the same thing following my own guide. It's updated now.
~Kelly
I thought I would mention here that this guide works perfectly to install the mailman3-full package on Debian 11 (I just installed with Debian 11.3.0) and it installs version 3.3.3 of Mailman 3 Core.
Maybe it's just me, but I could not quite get Virtualenv instructions on the mailman3 website to work...
Tom
Fine when it works for you. The drawback is you have to wait until new versions are in the Debian package system. In my virtualenv installation I have version 3.3.5 of mailman3 core. I followed this guide and it works for me. https://docs.mailman3.org/en/latest/install/virtualenv.html[1]
Eggert
Am Freitag, 8. Juli 2022, 07:28:24 CEST schrieb kisner@live.com:
I thought I would mention here that this guide works perfectly to install the mailman3-full package on Debian 11 (I just installed with Debian 11.3.0) and it installs version 3.3.3 of Mailman 3 Core.
Maybe it's just me, but I could not quite get Virtualenv instructions on the mailman3 website to work...
Tom
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
[1] https://docs.mailman3.org/en/latest/install/virtualenv.html
Eggert Ehmke wrote:
Fine when it works for you. The drawback is you have to wait until new versions are in the Debian package system. In my virtualenv installation I have version 3.3.5 of mailman3 core. I followed this guide and it works for me. https://docs.mailman3.org/en/latest/install/virtualenv.html%5B1] Eggert Am Freitag, 8. Juli 2022, 07:28:24 CEST schrieb kisner@live.com:
I thought I would mention here that this guide works perfectly to install the mailman3-full package on Debian 11 (I just installed with Debian 11.3.0) and it installs version 3.3.3 of Mailman 3 Core. Maybe it's just me, but I could not quite get Virtualenv instructions on the mailman3 website to work... Tom
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
[1] https://docs.mailman3.org/en/latest/install/virtualenv.html
I tried to follow that guide ( https://docs.mailman3.org/en/latest/install/virtualenv.html ), but I couldn't get it to work. I'd have to try it again to see where it broke. One thing that I got past was I had to change:
(venv)$ pip install wheel mailman psycopg2-binary<2.9
to
(venv)$ pip install wheel mailman psycopg2-binary==2.8.6
and that got me past that part, but hyperkitty/mailman-web pip install has components that failed to install. I'm not sure why, someone smarter than me could probably have figured it out, but as written it wasn't working for me.
I get why a virtualenv install has desirable upsides, but I just wanted to mention that I could get the Debian 11 package to install with these Ubuntu 18.04 instructions and it's not an ancient version in the Debian package.
On 7/8/22 8:28 AM, kisner@live.com wrote:
I tried to follow that guide ( https://docs.mailman3.org/en/latest/install/virtualenv.html ), but I couldn't get it to work. I'd have to try it again to see where it broke. One thing that I got past was I had to change:
(venv)$ pip install wheel mailman psycopg2-binary<2.9
to
(venv)$ pip install wheel mailman psycopg2-binary==2.8.6
and that got me past that part,
I don't understand why that would make a difference since the latest psycopg2-binary<2.9 is 2.8.6
but hyperkitty/mailman-web pip install has components that failed to install. I'm not sure why, someone smarter than me could probably have figured it out, but as written it wasn't working for me.
If you do try again, post the specific issues/error messages and we will try to help.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
I tried to follow that guide ( https://docs.mailman3.org/en/latest/install/virtualenv.html ), but I couldn't get it to work. I'd have to try it again to see where it broke. One thing that I got past was I had to change: (venv)$ pip install wheel mailman psycopg2-binary<2.9 to (venv)$ pip install wheel mailman psycopg2-binary==2.8.6 and that got me past that part, I don't understand why that would make a difference since the latest
but hyperkitty/mailman-web pip install has components that failed to install. I'm not sure why, someone smarter than me could probably have figured it out, but as written it wasn't working for me. If you do try again, post the specific issues/error messages and we will
On 7/8/22 8:28 AM, kisner@live.com wrote: psycopg2-binary<2.9 is 2.8.6 try to help.
Just out of curiosity and to try to improve the doc I can do this a little later. But I can tell you for sure the pip install psycopg2-binary<2.9 command failed for me on Ubuntu 22.04 and Debian 11.3. I'm not saying it's *not* me, and I don't know when the last time that doc was updated but I couldn't get it to work on a few different distros.
On 7/8/22 9:16 AM, kisner@live.com wrote:
Just out of curiosity and to try to improve the doc I can do this a little later. But I can tell you for sure the pip install psycopg2-binary<2.9 command failed for me on Ubuntu 22.04 and Debian 11.3. I'm not saying it's *not* me, and I don't know when the last time that doc was updated but I couldn't get it to work on a few different distros.
The issue is when you do
pip install psycopg2-binary<2.9
your shell (sh, bash, zsh or whatever) interprets <2.9
as an input
redirection and probably says something like 2.9: No such file or directory
. You need to do something like
pip install psycopg2-binary\<2.9
or
pip install 'psycopg2-binary<2.9'
I'll update the doc.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Yup. I noticed that when I went through this two days ago. I hadn’t got around to mentioning it yet. :-)
On 8 Jul 2022, at 18:01, Mark Sapiro <mark@msapiro.net> wrote:
On 7/8/22 9:16 AM, kisner@live.com wrote:
Just out of curiosity and to try to improve the doc I can do this a little later. But I can tell you for sure the pip install psycopg2-binary<2.9 command failed for me on Ubuntu 22.04 and Debian 11.3. I'm not saying it's *not* me, and I don't know when the last time that doc was updated but I couldn't get it to work on a few different distros.
The issue is when you do
pip install psycopg2-binary<2.9
your shell (sh, bash, zsh or whatever) interprets
<2.9
as an input redirection and probably says something like2.9: No such file or directory
. You need to do something likepip install psycopg2-binary\<2.9
or
pip install 'psycopg2-binary<2.9'
I'll update the doc.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Thanks!
OK, ran through again on a vanilla Debian 11.3 install, got this error (I'll try to create the directory and see if I can get past it):
(venv) mailman@lists:~$ mailman-web migrate Traceback (most recent call last): File "/usr/lib/python3.9/logging/config.py", line 564, in configure handler = self.configure_handler(handlers[name]) File "/usr/lib/python3.9/logging/config.py", line 745, in configure_handler result = factory(**kwargs) File "/usr/lib/python3.9/logging/handlers.py", line 445, in __init__ logging.FileHandler.__init__(self, filename, mode=mode, File "/usr/lib/python3.9/logging/__init__.py", line 1142, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib/python3.9/logging/__init__.py", line 1171, in _open return open(self.baseFilename, self.mode, encoding=self.encoding, FileNotFoundError: [Errno 2] No such file or directory: '/opt/mailman/web/logs/mailmanweb.log'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/opt/mailman/venv/bin/mailman-web", line 8, in <module> sys.exit(main()) File "/opt/mailman/venv/lib/python3.9/site-packages/mailman_web/manage.py", line 30, in main execute_from_command_line(sys.argv) File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 377, in execute django.setup() File "/opt/mailman/venv/lib/python3.9/site-packages/django/__init__.py", line 19, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/opt/mailman/venv/lib/python3.9/site-packages/django/utils/log.py", line 75, in configure_logging logging_config_func(logging_settings) File "/usr/lib/python3.9/logging/config.py", line 809, in dictConfig dictConfigClass(config).configure() File "/usr/lib/python3.9/logging/config.py", line 571, in configure raise ValueError('Unable to configure handler ' ValueError: Unable to configure handler 'file'
So I went and created /opt/mailman/web/logs, did chown -R mailman.mailman /opt/mailman, ran it again and got this (and this is probably where I stopped last time):
(venv) mailman@lists:~/web$ mailman-web migrate Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/utils.py", line 66, in __getitem__ return self._engines[alias] KeyError: 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/backends/django.py", line 121, in get_package_libraries module = import_module(entry[1]) File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 790, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/opt/mailman/venv/lib/python3.9/site-packages/hyperkitty/templatetags/decorate.py", line 4, in <module> from hyperkitty.lib.renderer import markdown_renderer, text_renderer File "/opt/mailman/venv/lib/python3.9/site-packages/hyperkitty/lib/renderer.py", line 7, in <module> from mistune.scanner import escape_html, escape_url ImportError: cannot import name 'escape_html' from 'mistune.scanner' (/opt/mailman/venv/lib/python3.9/site-packages/mistune/scanner.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/venv/bin/mailman-web", line 8, in <module> sys.exit(main()) File "/opt/mailman/venv/lib/python3.9/site-packages/mailman_web/manage.py", line 30, in main execute_from_command_line(sys.argv) File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/base.py", line 328, in run_from_argv self.execute(*args, **cmd_options) File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/base.py", line 366, in execute self.check() File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/base.py", line 392, in check all_issues = self._run_checks( File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 64, in _run_checks issues.extend(super()._run_checks(**kwargs)) File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/management/base.py", line 382, in _run_checks return checks.run_checks(**kwargs) File "/opt/mailman/venv/lib/python3.9/site-packages/django/core/checks/registry.py", line 72, in run_checks new_errors = check(app_configs=app_configs) File "/opt/mailman/venv/lib/python3.9/site-packages/django/contrib/admin/checks.py", line 76, in check_dependencies for engine in engines.all(): File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/utils.py", line 90, in all return [self[alias] for alias in self] File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/utils.py", line 90, in <listcomp> return [self[alias] for alias in self] File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/utils.py", line 81, in __getitem__ engine = engine_cls(params) File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/backends/django.py", line 25, in __init__ options['libraries'] = self.get_templatetag_libraries(libraries) File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/backends/django.py", line 43, in get_templatetag_libraries libraries = get_installed_libraries() File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/backends/django.py", line 108, in get_installed_libraries for name in get_package_libraries(pkg): File "/opt/mailman/venv/lib/python3.9/site-packages/django/template/backends/django.py", line 123, in get_package_libraries raise InvalidTemplateLibrary( django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'hyperkitty.templatetags.decorate': cannot import name 'escape_html' from 'mistune.scanner' (/opt/mailman/venv/lib/python3.9/site-packages/mistune/scanner.py)
On 7/9/22 9:00 AM, kisner@live.com wrote:
So I went and created /opt/mailman/web/logs, did chown -R mailman.mailman /opt/mailman, ran it again and got this (and this is probably where I stopped last time):
(venv) mailman@lists:~/web$ mailman-web migrate ...> ImportError: cannot import name 'escape_html' from 'mistune.scanner' (/opt/mailman/venv/lib/python3.9/site-packages/mistune/scanner.py) ... django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'hyperkitty.templatetags.decorate': cannot import name 'escape_html' from 'mistune.scanner' (/opt/mailman/venv/lib/python3.9/site-packages/mistune/scanner.py)
This is https://gitlab.com/mailman/hyperkitty/-/issues/431, fixed by https://gitlab.com/mailman/hyperkitty/-/merge_requests/379 but not yet released. The easiest fix is to apply this patch ``` --- a/hyperkitty/lib/renderer.py +++ b/hyperkitty/lib/renderer.py @@ -4,7 +4,7 @@ from django.conf import settings import mistune from mistune.plugins.extra import plugin_url -from mistune.scanner import escape_html, escape_url +from mistune.util import escape_html, escape_url class MyRenderer(mistune.HTMLRenderer): ``` -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 7/9/22 8:48 AM, kisner@live.com wrote:
Thanks!
OK, ran through again on a vanilla Debian 11.3 install, got this error (I'll try to create the directory and see if I can get past it):
(venv) mailman@lists:~$ mailman-web migrate Traceback (most recent call last): File "/usr/lib/python3.9/logging/config.py", line 564, in configure handler = self.configure_handler(handlers[name]) File "/usr/lib/python3.9/logging/config.py", line 745, in configure_handler result = factory(**kwargs) File "/usr/lib/python3.9/logging/handlers.py", line 445, in __init__ logging.FileHandler.__init__(self, filename, mode=mode, File "/usr/lib/python3.9/logging/__init__.py", line 1142, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib/python3.9/logging/__init__.py", line 1171, in _open return open(self.baseFilename, self.mode, encoding=self.encoding, FileNotFoundError: [Errno 2] No such file or directory: '/opt/mailman/web/logs/mailmanweb.log'
Creation of the directory is documented. From https://docs.mailman3.org/en/latest/install/virtualenv.html#initial-configur...
# Make sure that this directory is created or Django will fail on start.
LOGGING['handlers']['file']['filename'] =
'/opt/mailman/web/logs/mailmanweb.log'
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
On 7/9/22 8:48 AM, kisner@live.com wrote:
Thanks! OK, ran through again on a vanilla Debian 11.3 install, got this error (I'll try to create the directory and see if I can get past it): (venv) mailman@lists:~$ mailman-web migrate Traceback (most recent call last): File "/usr/lib/python3.9/logging/config.py", line 564, in configure handler = self.configure_handler(handlers[name]) File "/usr/lib/python3.9/logging/config.py", line 745, in configure_handler result = factory(**kwargs) File "/usr/lib/python3.9/logging/handlers.py", line 445, in __init__ logging.FileHandler.__init__(self, filename, mode=mode, File "/usr/lib/python3.9/logging/__init__.py", line 1142, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib/python3.9/logging/__init__.py", line 1171, in _open return open(self.baseFilename, self.mode, encoding=self.encoding, FileNotFoundError: [Errno 2] No such file or directory: '/opt/mailman/web/logs/mailmanweb.log' Creation of the directory is documented. From https://docs.mailman3.org/en/latest/install/virtualenv.html#initial-configur... # Make sure that this directory is created or Django will fail on start. LOGGING['handlers']['file']['filename'] = '/opt/mailman/web/logs/mailmanweb.log'
My bad, I missed that. Maybe pull that line out of the config comments and put it in the instructions below? That wasn't the show stopper, though, that I could figure out, it was the other bug. I'm glad someone already reported it and fixed it.
participants (6)
-
brian@emwd.com
-
Eggert Ehmke
-
kelly.close@lrewater.com
-
kisner@live.com
-
Mark Sapiro
-
Tim Cutts