ModuleNotFoundError: No module named 'settings'
Hello!
I've just set up Mailman 3 with Hyperkitty and Postorius in venv via pip by using the guide at https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-insta... on Oracle Linux 8.3 with Python 3.6.8. The process seemed to go smoothly and without errors.
The log file, /opt/mailman/web/logs/uwsgi-error.log, contains the following stack trace, however. Note the bit toward the bottom: "ModuleNotFoundError: No module named 'settings'"
Traceback (most recent call last): File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 224, in fetch_command app_name = commands[subcommand] KeyError: 'qcluster'
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/lib64/python3.6/site-packages/mailman_web/manage.py", line 30, in main execute_from_command_line(sys.argv) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 231, in fetch_command settings.INSTALLED_APPS File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__ self._setup(name) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup self._wrapped = Settings(settings_module) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked ModuleNotFoundError: No module named 'settings' [uwsgi-daemons] throttling "/opt/mailman/venv/bin/mailman-web qcluster" for 245 seconds [uwsgi-daemons] respawning "/opt/mailman/venv/bin/mailman-web qcluster" (uid: 1002 gid: 1002)
Mailman and mailman-web do start without errors when I run them via their systemd unit files and Postorius serves up pages (without styles and such, which I'll fix later). SELinux is disabled, at least while I work through this issue. I've gone over the configuration files, and everything appears to be in order as written in the installation instructions, but that's likely not the case. :)
My configuration files outside of the Mailman virtual environment are in /etc/mailman/:
(venv) [mailman@host ~]$ ls /etc/mailman3/ mailman.cfg __pycache__ settings.py uwsgi.ini
When searching the web about this, I only found one result, on this very list, but it didn't have quite enough information for me to solve my issue. It might also not quite be the same problem: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/W...
Might you be able to point me in the right direction on solving this issue? Please tell me if there is any more information I can provide to that end.
Best, Michela
I just joined this list a few minutes ago to ask about he exact same issue. Hopefully someone will be able to help both of us.
Michela via Mailman-users writes:
The log file, /opt/mailman/web/logs/uwsgi-error.log, contains the following stack trace, however. Note the bit toward the bottom: "ModuleNotFoundError: No module named 'settings'"
Given that you can run the applications from the command line as systemd services, this almost certainly localizes the problem to uwsgi itself. Note that uwsgi has been problematic lately. I don't recall the details. I think there's a preference for gunicorn as the SGI provider among the Mailman 3 developers (and it's what core uses internally to provide the REST interface) so uwsgi may not get "beta" testing in production from us.
Specifically, is this line
pythonpath = /etc/mailman3/
present, correct, and not commented out in uswgi.ini?
My configuration files outside of the Mailman virtual environment are in /etc/mailman/:
Is it possible you have /etc/mailman/ instead of /etc/mailman3/ in uwsgi.ini as in the above quote? (I am pretty sure that's a typo in the post, but gotta check everything.) On the other hand, maybe we did a typo, and there should be no trailing slash on /etc/mailman3 in this statement. (Usually trailing slashes aren't a problem, applications mostly ignore them, but there is no trailing slash on any directory in my sys.path, so it's worth a try.)
If it's none of the above, I'm out of ideas. Maybe Mark or Abhilash has more experience.
Steve
On May 10, 2021, at 8:11 PM, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
Michela via Mailman-users writes:
The log file, /opt/mailman/web/logs/uwsgi-error.log, contains the following stack trace, however. Note the bit toward the bottom: "ModuleNotFoundError: No module named 'settings'"
Given that you can run the applications from the command line as systemd services, this almost certainly localizes the problem to uwsgi itself. Note that uwsgi has been problematic lately. I don't recall the details. I think there's a preference for gunicorn as the SGI provider among the Mailman 3 developers (and it's what core uses internally to provide the REST interface) so uwsgi may not get "beta" testing in production from us.
Specifically, is this line
pythonpath = /etc/mailman3/
present, correct, and not commented out in uswgi.ini?
My configuration files outside of the Mailman virtual environment are in /etc/mailman/:
Is it possible you have /etc/mailman/ instead of /etc/mailman3/ in uwsgi.ini as in the above quote? (I am pretty sure that's a typo in the post, but gotta check everything.) On the other hand, maybe we did a typo, and there should be no trailing slash on /etc/mailman3 in this statement. (Usually trailing slashes aren't a problem, applications mostly ignore them, but there is no trailing slash on any directory in my sys.path, so it's worth a try.)
Yeah, it would be good to share the full contents of /etc/mailman3/uwsgi.ini, for some reason what is listed in the docs1 is working on one of my test servers. Although, given that there are more than one reports of the same error, it is possible something is wrong or missing in the docs.
The trailing slashes in this case isn’t really a problem I think.
If you can share some initial parts of your uwsgi-error.log part where uwsgi initializes that would be useful too. I am looking something that looks like this:
*** Starting uWSGI 2.0.19.1 (64bit) on [Thu Jan 21 08:49:16 2021] ***
compiled with version: 9.3.0 on 21 January 2021 08:40:15
os: Linux-5.4.0-1036-azure #38-Ubuntu SMP Wed Jan 6 18:26:25 UTC 2021
nodename: mailman
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /opt/mailman3
detected binary path: /opt/mailman3/venv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 15571
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 8
Python version: 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
PEP 405 virtualenv detected: /opt/mailman3/venv/
Set PythonHome to /opt/mailman3/venv/
Python main interpreter initialized at 0x56002ba3aed0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 166688 bytes (162 KB) for 2 cores
*** Operational MODE: threaded ***
added /etc/mailman3/ to pythonpath.
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x56002ba3aed0 pid: 715893 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 715893)
spawned uWSGI worker 1 (pid: 715897, cores: 2)
[uwsgi-daemons] spawning "mailman-web qcluster" (uid: 1001 gid: 1001)
08:49:18 [Q] INFO Q Cluster december-nebraska-helium-montana starting.
08:49:18 [Q] INFO Process-1:1 ready for work at 715904
08:49:18 [Q] INFO Process-1:2 ready for work at 715905
Please ignore that the paths in my logs are /opt/mailman3/*
, I have
multiple installations on my test server, the docs say it should be /opt/mailman/*
. It
doesn’t really matter as long as they are consistent in all places.
Also, what happens if you run the command "/opt/mailman/venv/bin/mailman-web qcluster” as a “mailman” user on your machine? Do you see the traceback like above or does it start a process like this?
mailman@mailman:~$ /opt/mailman3/venv/bin/mailman-web qcluster
05:05:29 [Q] INFO Q Cluster april-east-hot-potato starting.
05:05:29 [Q] INFO Process-1:1 ready for work at 3364005
05:05:29 [Q] INFO Process-1:2 ready for work at 3364006
05:05:29 [Q] INFO Process-1 guarding cluster april-east-hot-potato
05:05:29 [Q] INFO Process-1:3 monitoring at 3364007
05:05:29 [Q] INFO Q Cluster april-east-hot-potato running.
05:05:29 [Q] INFO Process-1:4 pushing tasks at 3364008
If it's none of the above, I'm out of ideas. Maybe Mark or Abhilash has more experience.
Steve
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, Abhilash Raj (maxking)
Since I am having the same issue, I’ll consolidate on this thread. Here is my uwsgi-error.log at start-up:
*** Starting uWSGI 2.0.19.1 (64bit) on [Tue May 11 08:01:48 2021] *** compiled with version: 8.3.1 20191121 (Red Hat 8.3.1-5) on 09 May 2021 00:39:19 os: Linux-4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 nodename: xxxxx machine: x86_64 clock source: unix detected number of CPU cores: 12 current working directory: / detected binary path: /usr/local/mailman3/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! your processes number limit is 126645 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 10 Python version: 3.8.3 (default, Aug 31 2020, 16:03:14) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] PEP 405 virtualenv detected: /usr/local/mailman3 Set PythonHome to /usr/local/mailman3 Python main interpreter initialized at 0x9cc410 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 250032 bytes (244 KB) for 4 cores *** Operational MODE: preforking+threaded *** added /etc/mailman3/ to pythonpath. WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x9cc410 pid: 20599 9 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 205999) spawned uWSGI worker 1 (pid: 206001, cores: 2) spawned uWSGI worker 2 (pid: 206002, cores: 2) [uwsgi-daemons] spawning "/usr/local/mailman3/bin/mailman-web qcluster" (uid: 10 01 gid: 1001) Traceback (most recent call last): File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 224, in fetch_command app_name = commands[subcommand] KeyError: 'qcluster'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/mailman3/bin/mailman-web", line 8, in <module> sys.exit(main()) File "/usr/local/mailman3/lib64/python3.8/site-packages/mailman_web/manage.py" , line 30, in main execute_from_command_line(sys.argv) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 401, in execute_from_command_line utility.execute() File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 231, in fetch_command settings.INSTALLED_APPS File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 76, in __getattr__ self._setup(name) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 63, in _setup self._wrapped = Settings(settings_module) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 142, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'settings' [uwsgi-daemons] throttling "/usr/local/mailman3/bin/mailman-web qcluster" for 1 seconds [uwsgi-daemons] respawning "/usr/local/mailman3/bin/mailman-web qcluster" (uid: 1001 gid: 1001) Traceback (most recent call last): File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 224, in fetch_command app_name = commands[subcommand] KeyError: 'qcluster'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/mailman3/bin/mailman-web", line 8, in <module> sys.exit(main()) File "/usr/local/mailman3/lib64/python3.8/site-packages/mailman_web/manage.py" , line 30, in main execute_from_command_line(sys.argv) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 401, in execute_from_command_line utility.execute() File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 231, in fetch_command settings.INSTALLED_APPS File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 76, in __getattr__ self._setup(name) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 63, in _setup self._wrapped = Settings(settings_module) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 142, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'settings' [uwsgi-daemons] throttling "/usr/local/mailman3/bin/mailman-web qcluster" for 1 seconds [uwsgi-daemons] respawning "/usr/local/mailman3/bin/mailman-web qcluster" (uid: 1001 gid: 1001) Traceback (most recent call last): File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 224, in fetch_command app_name = commands[subcommand] KeyError: 'qcluster'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/mailman3/bin/mailman-web", line 8, in <module> sys.exit(main()) File "/usr/local/mailman3/lib64/python3.8/site-packages/mailman_web/manage.py" , line 30, in main execute_from_command_line(sys.argv) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 401, in execute_from_command_line utility.execute() File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/core/management /__init__.py", line 231, in fetch_command settings.INSTALLED_APPS File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 76, in __getattr__ self._setup(name) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 63, in _setup self._wrapped = Settings(settings_module) File "/usr/local/mailman3/lib64/python3.8/site-packages/django/conf/__init__.p y", line 142, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named ‘settings'
and so on…
Here is my uwsgi.ini:
# /etc/mailman3/uwsgi.ini #
[uwsgi] # Port on which uwsgi will be listening. uwsgi-socket = 127.0.0.1:8000
# If running uwsgi from the virtual environment ... virtualenv = /usr/local/mailman3
module=mailman_web.wsgi:application # Add to python import path. pythonpath = /etc/mailman3/
# The default settings module. env = DJANGO_SETTINGS_MODULE=settings
# Setup default number of processes and threads per process. master = true processes = 2 threads = 2
# Setup the django_q related worker processes. attach-daemon = /usr/local/mailman3/bin/mailman-web qcluster
# Setup the request log. req-logger = file:/usr/local/mailman3/web/logs/uwsgi.log
# Log qcluster commands separately. logger = qcluster file:/usr/local/mailman3/web/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons
# Last log and it logs the rest of the stuff. logger = file:/usr/local/mailman3/web/logs/uwsgi-error.log
Running from the command line as mailman looks pretty good:
[mailman3]# sudo -u mailman bin/mailman-web qcluster 12:15:26 [Q] INFO Q Cluster orange-chicken-violet-moon starting. 12:15:26 [Q] INFO Process-1:1 ready for work at 206071 12:15:26 [Q] INFO Process-1:2 ready for work at 206072 12:15:26 [Q] INFO Process-1:3 ready for work at 206073 12:15:26 [Q] INFO Process-1:4 ready for work at 206074 12:15:26 [Q] INFO Process-1:5 ready for work at 206075 12:15:26 [Q] INFO Process-1:6 ready for work at 206076 12:15:26 [Q] INFO Process-1:7 ready for work at 206077 12:15:26 [Q] INFO Process-1:8 ready for work at 206078 12:15:26 [Q] INFO Process-1:9 ready for work at 206079 12:15:26 [Q] INFO Process-1:10 ready for work at 206080 12:15:26 [Q] INFO Process-1:11 ready for work at 206081 12:15:26 [Q] INFO Process-1:12 ready for work at 206082 12:15:26 [Q] INFO Process-1:13 monitoring at 206083 12:15:26 [Q] INFO Process-1 guarding cluster orange-chicken-violet-moon 12:15:26 [Q] INFO Process-1:14 pushing tasks at 206084 12:15:26 [Q] INFO Q Cluster orange-chicken-violet-moon running. 12:15:26 [Q] INFO Process-1:1 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:2 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:3 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:4 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:5 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:6 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:7 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:8 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:9 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:10 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:11 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:12 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:1 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:2 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:3 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:4 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:5 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:6 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:7 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:8 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:9 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:10 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:11 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:1 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:2 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:4 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:12 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:3 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:5 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:8 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:7 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Process-1:9 processing [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month] 12:15:26 [Q] INFO Processed [rebuild_mailinglist_cache_for_month]
I appreciate your willingness to assist with this issue. Thanks very much.
Jeff
I found a work around for the problem with the missing settings module. I modified:
/etc/systemd/system/mailmanweb.service
to add the PYTHONPATH environmental variable:
[Service] Environment="PYTHONPATH=/etc/mailman3/" User=mailman Group=mailman ExecStart=/usr/local/mailman3/bin/uwsgi --ini /etc/mailman3/uwsgi.ini
Now it starts up fine:
*** Starting uWSGI 2.0.19.1 (64bit) on [Tue May 11 09:38:47 2021] *** compiled with version: 8.3.1 20191121 (Red Hat 8.3.1-5) on 09 May 2021 00:39:19 os: Linux-4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 nodename: xxxxxx machine: x86_64 clock source: unix detected number of CPU cores: 12 current working directory: / detected binary path: /usr/local/mailman3/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! your processes number limit is 126645 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 10 Python version: 3.8.3 (default, Aug 31 2020, 16:03:14) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] PEP 405 virtualenv detected: /usr/local/mailman3 Set PythonHome to /usr/local/mailman3 Python main interpreter initialized at 0x7e65a0 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 250032 bytes (244 KB) for 4 cores *** Operational MODE: preforking+threaded *** added /etc/mailman3/ to pythonpath. WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x7e65a0 pid: 207058 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 207058) spawned uWSGI worker 1 (pid: 207060, cores: 2) spawned uWSGI worker 2 (pid: 207062, cores: 2) [uwsgi-daemons] spawning "/usr/local/mailman3/bin/mailman-web qcluster" (uid: 1001 gid: 1001) 09:38:48 [Q] INFO Q Cluster oklahoma-thirteen-johnny-alpha starting. 09:38:48 [Q] INFO Process-1:1 ready for work at 207067 09:38:48 [Q] INFO Process-1:2 ready for work at 207068 09:38:48 [Q] INFO Process-1:3 ready for work at 207069 09:38:48 [Q] INFO Process-1:4 ready for work at 207070 09:38:48 [Q] INFO Process-1:5 ready for work at 207071 09:38:48 [Q] INFO Process-1:6 ready for work at 207072 09:38:48 [Q] INFO Process-1:7 ready for work at 207073 09:38:48 [Q] INFO Process-1:8 ready for work at 207074 09:38:48 [Q] INFO Process-1:9 ready for work at 207075 09:38:48 [Q] INFO Process-1:10 ready for work at 207076 09:38:48 [Q] INFO Process-1:11 ready for work at 207077 09:38:48 [Q] INFO Process-1:12 ready for work at 207078 09:38:48 [Q] INFO Process-1:13 monitoring at 207079 09:38:48 [Q] INFO Process-1 guarding cluster oklahoma-thirteen-johnny-alpha 09:38:48 [Q] INFO Process-1:14 pushing tasks at 207080 09:38:48 [Q] INFO Q Cluster oklahoma-thirteen-johnny-alpha running.
On 5/11/21 6:43 AM, Jeff wrote:
I found a work around for the problem with the missing settings module. I modified:
/etc/systemd/system/mailmanweb.service
to add the PYTHONPATH environmental variable:
[Service] Environment="PYTHONPATH=/etc/mailman3/" User=mailman Group=mailman ExecStart=/usr/local/mailman3/bin/uwsgi --ini /etc/mailman3/uwsgi.ini
Now it starts up fine:
That is the appropriate solution. I've updated the doc.
-- 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 5/11/21 6:43 AM, Jeff wrote:
I found a work around for the problem with the missing settings module. I modified: /etc/systemd/system/mailmanweb.service to add the PYTHONPATH environmental variable: [Service] Environment="PYTHONPATH=/etc/mailman3/" User=mailman Group=mailman ExecStart=/usr/local/mailman3/bin/uwsgi --ini /etc/mailman3/uwsgi.ini Now it starts up fine:
That is the appropriate solution. I've updated the doc.
That's works for the systemd service, but in case uswgi ist started within the venv (as for test running as stated in the docs), PYHTONPATH need to be exported here as well to work properly:
- export PYTHONPATH=/etc/mailman3/
Best regards, Adrian
Hi. Thank you for your replies, everyone!
Perhaps I should first mention that I checked uwsgi.ini and it is set to /etc/mailman3/, which is where my configuration files actually are. I had a typo in my message to the list about that (but not on the server), where I accidentally omitted the "3" in the directory path. So everything was actually in order there. Good catch in any case! :)
The start of the uwsgi.ini file is as follows:
*** Starting uWSGI 2.0.19.1 (64bit) on [Mon May 10 11:11:01 2021] *** compiled with version: 8.3.1 20191121 (Red Hat 8.3.1-5.0.2) on 10 May 2021 00:42:28 os: Linux-5.4.17-2102.200.13.el8uek.x86_64 #2 SMP Sun Mar 28 14:48:36 PDT 2021 nodename: hostname machine: x86_64 clock source: unix detected number of CPU cores: 2 current working directory: / detected binary path: /opt/mailman/venv/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! your processes number limit is 6642 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 0.0.0.0:8000 fd 10 Python version: 3.6.8 (default, Mar 9 2021, 15:28:46) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5.0.1)] PEP 405 virtualenv detected: /opt/mailman/venv/ Set PythonHome to /opt/mailman/venv/ Python main interpreter initialized at 0x10ccf30 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 250032 bytes (244 KB) for 4 cores *** Operational MODE: preforking+threaded *** added /etc/mailman3/ to pythonpath. Traceback (most recent call last): File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman_web/wsgi.py", line 16, in <module> application = get_wsgi_application() File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application django.setup(set_prefix=False) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/__init__.py", line 19, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 76, in __getattr__ self._setup(name) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 63, in _setup self._wrapped = Settings(settings_module) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/__init__.py", line 142, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named 'settings' unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 38878) spawned uWSGI worker 1 (pid: 38882, cores: 2) spawned uWSGI worker 2 (pid: 38883, cores: 2) [uwsgi-daemons] spawning "/opt/mailman/venv/bin/mailman-web qcluster" (uid: 1002 gid: 1002) Traceback (most recent call last): File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/management/__init__.py", line 224, in fetch_command app_name = commands[subcommand] KeyError: 'qcluster'
Running qcluster interactively does appear to work properly:
(venv) [mailman@hostname ~]$ /opt/mailman/venv/bin/mailman-web qcluster /opt/mailman/venv/lib64/python3.6/site-packages/django_q/conf.py:138: UserWarning: Retry and timeout are misconfigured. Set retry larger than timeout, failure to do so will cause the tasks to be retriggered before completion. See https://django-q.readthedocs.io/en/latest/configure.html#retry for details. See https://django-q.readthedocs.io/en/latest/configure.html#retry for details.""") 20:16:21 [Q] INFO Q Cluster berlin-angel-south-california starting. 20:16:21 [Q] INFO Process-1:1 ready for work at 57948 20:16:21 [Q] INFO Process-1:2 ready for work at 57949 20:16:21 [Q] INFO Process-1:3 monitoring at 57950 20:16:21 [Q] INFO Process-1 guarding cluster berlin-angel-south-california 20:16:21 [Q] INFO Q Cluster berlin-angel-south-california running. 20:16:21 [Q] INFO Process-1:4 pushing tasks at 57951
My uwsgi.ini file:
# /etc/mailman3/uwsgi.ini # [uwsgi] # Port on which uwsgi will be listening. uwsgi-socket = 0.0.0.0:8000 # If running uwsgi from the virtual environment ... virtualenv = /opt/mailman/venv/
module=mailman_web.wsgi:application # Add to python import path. pythonpath = /etc/mailman3/ # The default settings module. env = DJANGO_SETTINGS_MODULE=settings
# Setup default number of processes and threads per process. master = true processes = 2 threads = 2
# Setup the django_q related worker processes. attach-daemon = /opt/mailman/venv/bin/mailman-web qcluster
# Setup the request log. req-logger = file:/opt/mailman/web/logs/uwsgi.log
# Log qcluster commands separately. logger = qcluster file:/opt/mailman/web/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons
# Last log and it logs the rest of the stuff. logger = file:/opt/mailman/web/logs/uwsgi-error.log
Files in /etc/mailman3/
(venv) [mailman@hostname ~]$ ls /etc/mailman3/ mailman.cfg __pycache__/ settings.py uwsgi.ini
Regarding Steve's comment on WSGI vs. Gunicorn, we used WSGI as the application server for Mailman 3 because that's what the Mailman 3 venv instructions say to use -- I did my best to follow them exactly (the only difference is in the way I installed PostgreSQL -- I used the official EL PostgreSQL repository for that). So, hopefully, the developers consider it okay for us to use UWSGI (at least for now). :D
Thank you for your help!! Michela
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Monday, May 10, 2021 10:08 PM, Abhilash Raj <maxking@asynchronous.in> wrote:
On May 10, 2021, at 8:11 PM, Stephen J. Turnbull turnbull.stephen.fw@u.tsukuba.ac.jp wrote: Michela via Mailman-users writes:
The log file, /opt/mailman/web/logs/uwsgi-error.log, contains the following stack trace, however. Note the bit toward the bottom: "ModuleNotFoundError: No module named 'settings'"
Given that you can run the applications from the command line as systemd services, this almost certainly localizes the problem to uwsgi itself. Note that uwsgi has been problematic lately. I don't recall the details. I think there's a preference for gunicorn as the SGI provider among the Mailman 3 developers (and it's what core uses internally to provide the REST interface) so uwsgi may not get "beta" testing in production from us. Specifically, is this line pythonpath = /etc/mailman3/ present, correct, and not commented out in uswgi.ini?
My configuration files outside of the Mailman virtual environment are in /etc/mailman/:
Is it possible you have /etc/mailman/ instead of /etc/mailman3/ in uwsgi.ini as in the above quote? (I am pretty sure that's a typo in the post, but gotta check everything.) On the other hand, maybe we did a typo, and there should be no trailing slash on /etc/mailman3 in this statement. (Usually trailing slashes aren't a problem, applications mostly ignore them, but there is no trailing slash on any directory in my sys.path, so it's worth a try.)
Yeah, it would be good to share the full contents of /etc/mailman3/uwsgi.ini, for some reason what is listed in the docs1 is working on one of my test servers. Although, given that there are more than one reports of the same error, it is possible something is wrong or missing in the docs.
The trailing slashes in this case isn’t really a problem I think.
If you can share some initial parts of your uwsgi-error.log part where uwsgi initializes that would be useful too. I am looking something that looks like this:
*** Starting uWSGI 2.0.19.1 (64bit) on [Thu Jan 21 08:49:16 2021] *** compiled with version: 9.3.0 on 21 January 2021 08:40:15 os: Linux-5.4.0-1036-azure #38-Ubuntu SMP Wed Jan 6 18:26:25 UTC 2021 nodename: mailman machine: x86_64 clock source: unix detected number of CPU cores: 2 current working directory: /opt/mailman3 detected binary path: /opt/mailman3/venv/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! your processes number limit is 15571 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 8 Python version: 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] PEP 405 virtualenv detected: /opt/mailman3/venv/ Set PythonHome to /opt/mailman3/venv/ Python main interpreter initialized at 0x56002ba3aed0 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 166688 bytes (162 KB) for 2 cores *** Operational MODE: threaded *** added /etc/mailman3/ to pythonpath. WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x56002ba3aed0 pid: 715893 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 715893) spawned uWSGI worker 1 (pid: 715897, cores: 2) [uwsgi-daemons] spawning "mailman-web qcluster" (uid: 1001 gid: 1001) 08:49:18 [Q] INFO Q Cluster december-nebraska-helium-montana starting. 08:49:18 [Q] INFO Process-1:1 ready for work at 715904 08:49:18 [Q] INFO Process-1:2 ready for work at 715905
Please ignore that the paths in my logs are
/opt/mailman3/*
, I have multiple installations on my test server, the docs say it should be/opt/mailman/*
. It doesn’t really matter as long as they are consistent in all places.Also, what happens if you run the command "/opt/mailman/venv/bin/mailman-web qcluster” as a “mailman” user on your machine? Do you see the traceback like above or does it start a process like this?
mailman@mailman:~$ /opt/mailman3/venv/bin/mailman-web qcluster 05:05:29 [Q] INFO Q Cluster april-east-hot-potato starting. 05:05:29 [Q] INFO Process-1:1 ready for work at 3364005 05:05:29 [Q] INFO Process-1:2 ready for work at 3364006 05:05:29 [Q] INFO Process-1 guarding cluster april-east-hot-potato 05:05:29 [Q] INFO Process-1:3 monitoring at 3364007 05:05:29 [Q] INFO Q Cluster april-east-hot-potato running. 05:05:29 [Q] INFO Process-1:4 pushing tasks at 3364008
If it's none of the above, I'm out of ideas. Maybe Mark or Abhilash has more experience. Steve
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, Abhilash Raj (maxking)
Oh! I just noticed Jeff and Mark's posts about the solution for this issue.
I just adjusted my systemd unit file and, of course, that worked for me as well.
Thank you so much for your help on this, everyone!
Best, Michela
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, May 11, 2021 1:37 PM, Michela via Mailman-users <mailman-users@mailman3.org> wrote:
Hi. Thank you for your replies, everyone!
Perhaps I should first mention that I checked uwsgi.ini and it is set to /etc/mailman3/, which is where my configuration files actually are. I had a typo in my message to the list about that (but not on the server), where I accidentally omitted the "3" in the directory path. So everything was actually in order there. Good catch in any case! :)
The start of the uwsgi.ini file is as follows:
*** Starting uWSGI 2.0.19.1 (64bit) on [Mon May 10 11:11:01 2021] *** compiled with version: 8.3.1 20191121 (Red Hat 8.3.1-5.0.2) on 10 May 2021 00:42:28 os: Linux-5.4.17-2102.200.13.el8uek.x86_64 #2 SMP Sun Mar 28 14:48:36 PDT 2021 nodename: hostname machine: x86_64 clock source: unix detected number of CPU cores: 2 current working directory: / detected binary path: /opt/mailman/venv/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! your processes number limit is 6642 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 0.0.0.0:8000 fd 10 Python version: 3.6.8 (default, Mar 9 2021, 15:28:46) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5.0.1)] PEP 405 virtualenv detected: /opt/mailman/venv/ Set PythonHome to /opt/mailman/venv/ Python main interpreter initialized at 0x10ccf30 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 250032 bytes (244 KB) for 4 cores *** Operational MODE: preforking+threaded *** added /etc/mailman3/ to pythonpath. Traceback (most recent call last): File "/opt/mailman/venv/lib64/python3.6/site-packages/mailman_web/wsgi.py", line 16, in <module> application = get_wsgi_application() File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application django.setup(set_prefix=False) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/init.py", line 19, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/init.py", line 76, in getattr self._setup(name) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/init.py", line 63, in _setup self._wrapped = Settings(settings_module) File "/opt/mailman/venv/lib64/python3.6/site-packages/django/conf/init.py", line 142, in init mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named 'settings' unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 38878) spawned uWSGI worker 1 (pid: 38882, cores: 2) spawned uWSGI worker 2 (pid: 38883, cores: 2) [uwsgi-daemons] spawning "/opt/mailman/venv/bin/mailman-web qcluster" (uid: 1002 gid: 1002) Traceback (most recent call last): File "/opt/mailman/venv/lib64/python3.6/site-packages/django/core/management/init.py", line 224, in fetch_command app_name = commands[subcommand] KeyError: 'qcluster'
Running qcluster interactively does appear to work properly:
(venv) [mailman@hostname ~]$ /opt/mailman/venv/bin/mailman-web qcluster /opt/mailman/venv/lib64/python3.6/site-packages/django_q/conf.py:138: UserWarning: Retry and timeout are misconfigured. Set retry larger than timeout, failure to do so will cause the tasks to be retriggered before completion. See https://django-q.readthedocs.io/en/latest/configure.html#retry for details. See https://django-q.readthedocs.io/en/latest/configure.html#retry for details.""") 20:16:21 [Q] INFO Q Cluster berlin-angel-south-california starting. 20:16:21 [Q] INFO Process-1:1 ready for work at 57948 20:16:21 [Q] INFO Process-1:2 ready for work at 57949 20:16:21 [Q] INFO Process-1:3 monitoring at 57950 20:16:21 [Q] INFO Process-1 guarding cluster berlin-angel-south-california 20:16:21 [Q] INFO Q Cluster berlin-angel-south-california running. 20:16:21 [Q] INFO Process-1:4 pushing tasks at 57951
My uwsgi.ini file:
/etc/mailman3/uwsgi.ini
========================
==
[uwsgi]
Port on which uwsgi will be listening.
=======================================
uwsgi-socket = 0.0.0.0:8000
If running uwsgi from the virtual environment ...
==================================================
virtualenv = /opt/mailman/venv/ module=mailman_web.wsgi:application
Add to python import path.
===========================
pythonpath = /etc/mailman3/
The default settings module.
=============================
env = DJANGO_SETTINGS_MODULE=settings
Setup default number of processes and threads per process.
===========================================================
master = true processes = 2 threads = 2
Setup the django_q related worker processes.
=============================================
attach-daemon = /opt/mailman/venv/bin/mailman-web qcluster
Setup the request log.
=======================
req-logger = file:/opt/mailman/web/logs/uwsgi.log
Log qcluster commands separately.
==================================
logger = qcluster file:/opt/mailman/web/logs/uwsgi-qcluster.log log-route = qcluster uwsgi-daemons
Last log and it logs the rest of the stuff.
============================================
logger = file:/opt/mailman/web/logs/uwsgi-error.log
Files in /etc/mailman3/
(venv) [mailman@hostname ~]$ ls /etc/mailman3/ mailman.cfg pycache/ settings.py uwsgi.ini
Regarding Steve's comment on WSGI vs. Gunicorn, we used WSGI as the application server for Mailman 3 because that's what the Mailman 3 venv instructions say to use -- I did my best to follow them exactly (the only difference is in the way I installed PostgreSQL -- I used the official EL PostgreSQL repository for that). So, hopefully, the developers consider it okay for us to use UWSGI (at least for now). :D
Thank you for your help!! Michela
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Monday, May 10, 2021 10:08 PM, Abhilash Raj maxking@asynchronous.in wrote:
On May 10, 2021, at 8:11 PM, Stephen J. Turnbull turnbull.stephen.fw@u.tsukuba.ac.jp wrote: Michela via Mailman-users writes:
The log file, /opt/mailman/web/logs/uwsgi-error.log, contains the following stack trace, however. Note the bit toward the bottom: "ModuleNotFoundError: No module named 'settings'"
Given that you can run the applications from the command line as systemd services, this almost certainly localizes the problem to uwsgi itself. Note that uwsgi has been problematic lately. I don't recall the details. I think there's a preference for gunicorn as the SGI provider among the Mailman 3 developers (and it's what core uses internally to provide the REST interface) so uwsgi may not get "beta" testing in production from us. Specifically, is this line pythonpath = /etc/mailman3/ present, correct, and not commented out in uswgi.ini?
My configuration files outside of the Mailman virtual environment are in /etc/mailman/:
Is it possible you have /etc/mailman/ instead of /etc/mailman3/ in uwsgi.ini as in the above quote? (I am pretty sure that's a typo in the post, but gotta check everything.) On the other hand, maybe we did a typo, and there should be no trailing slash on /etc/mailman3 in this statement. (Usually trailing slashes aren't a problem, applications mostly ignore them, but there is no trailing slash on any directory in my sys.path, so it's worth a try.)
Yeah, it would be good to share the full contents of /etc/mailman3/uwsgi.ini, for some reason what is listed in the docs1 is working on one of my test servers. Although, given that there are more than one reports of the same error, it is possible something is wrong or missing in the docs. The trailing slashes in this case isn’t really a problem I think. If you can share some initial parts of your uwsgi-error.log part where uwsgi initializes that would be useful too. I am looking something that looks like this:
*** Starting uWSGI 2.0.19.1 (64bit) on [Thu Jan 21 08:49:16 2021] *** compiled with version: 9.3.0 on 21 January 2021 08:40:15 os: Linux-5.4.0-1036-azure #38-Ubuntu SMP Wed Jan 6 18:26:25 UTC 2021 nodename: mailman machine: x86_64 clock source: unix detected number of CPU cores: 2 current working directory: /opt/mailman3 detected binary path: /opt/mailman3/venv/bin/uwsgi !!! no internal routing support, rebuild with pcre support !!! your processes number limit is 15571 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address 127.0.0.1:8000 fd 8 Python version: 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] PEP 405 virtualenv detected: /opt/mailman3/venv/ Set PythonHome to /opt/mailman3/venv/ Python main interpreter initialized at 0x56002ba3aed0 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 166688 bytes (162 KB) for 2 cores *** Operational MODE: threaded *** added /etc/mailman3/ to pythonpath. WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x56002ba3aed0 pid: 715893 (default app) *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 715893) spawned uWSGI worker 1 (pid: 715897, cores: 2) [uwsgi-daemons] spawning "mailman-web qcluster" (uid: 1001 gid: 1001) 08:49:18 [Q] INFO Q Cluster december-nebraska-helium-montana starting. 08:49:18 [Q] INFO Process-1:1 ready for work at 715904 08:49:18 [Q] INFO Process-1:2 ready for work at 715905
Please ignore that the paths in my logs are
/opt/mailman3/*
, I have multiple installations on my test server, the docs say it should be/opt/mailman/*
. It doesn’t really matter as long as they are consistent in all places. Also, what happens if you run the command "/opt/mailman/venv/bin/mailman-web qcluster” as a “mailman” user on your machine? Do you see the traceback like above or does it start a process like this?mailman@mailman:~$ /opt/mailman3/venv/bin/mailman-web qcluster 05:05:29 [Q] INFO Q Cluster april-east-hot-potato starting. 05:05:29 [Q] INFO Process-1:1 ready for work at 3364005 05:05:29 [Q] INFO Process-1:2 ready for work at 3364006 05:05:29 [Q] INFO Process-1 guarding cluster april-east-hot-potato 05:05:29 [Q] INFO Process-1:3 monitoring at 3364007 05:05:29 [Q] INFO Q Cluster april-east-hot-potato running. 05:05:29 [Q] INFO Process-1:4 pushing tasks at 3364008
If it's none of the above, I'm out of ideas. Maybe Mark or Abhilash has more experience. Steve 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, Abhilash Raj (maxking)
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/
participants (7)
-
Abhilash Raj
-
Adrian Wiedemann
-
Jeff
-
Mark Sapiro
-
Michela
-
mm3@steele.com
-
Stephen J. Turnbull