On Thu, 8 Dec 2022 17:27:13 +0100 Onyeibo Oku <onyeibo@schemefusion.com> wrote:
[Reviving this thread].
I abandoned the hyperkitty setup for a while and returned to it again today. I made progress. It turns out that I needed the uwsgi-logger-file rpm package and It wasn't installed with the uwsgi server. I adapted the settings also, since I was using Emperor mode (recall that there are other Django projects on the box). Currently, mailman, uwsgi and nginx are all running. They all seem to be happy until I assess the mailman-web home URL (e.g. http://my.server.com).
The outcome: "502 Bad Gateway"
Nothing shows in the logs except at /var/log/nginx/error.log:
2022/12/08 15:35:10 [error] 5879#5879: *7 upstream prematurely closed connection while reading response header from upstream, client: 105.113.33.89, server: my.server.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8000/favicon.ico", host: "my.server.com", referrer: "https://my.server.com/".
Something seems to be wrong between uwsgi and mailman, but I don't know where to look.
Regards Onyeibo
Happy New Year to all the Mailman People here (nice rhyme).
I pulled the plugs on uwsgi and installed Gunicorn. Gunicorn gave more mileage but something is still not right. When I visit the mailmanweb home with a browser, I see the following:
"Server Error. An error occurred while processing your request."
Mailmanweb and mailman3 services are running. I perused the log file at /opt/mailman/web/logs/mailmanweb.log and found the following:
raise MailmanConnectionError( mailmanclient.restbase.connection.MailmanConnectionError: ('Could not connect to Mailman API: ', 'ConnectionError(MaxRetryError("HTTPConnectionPool(host=\'localhost\', port=8001): Max retries exceeded with url: /3.1/lists?advertised=true&count=0&page=1 (Caused by NewConnectionError(\'<urllib3.connection.HTTPConnection object at 0x7f7f4b128c40>: Failed to establish a new connection: [Errno 111] 0x7f7f4b128c40>Connection refused\'))"))')
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/venv/lib64/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/core/handlers/base.py", line 199, in _get_response response = self.process_exception_by_middleware(e, request) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/core/handlers/base.py", line 362, in process_exception_by_middleware response = middleware_method(request, exception) File "/opt/mailman/venv/lib64/python3.10/site-packages/postorius/middleware.py", line 48, in process_exception return utils.render_api_error(request) File "/opt/mailman/venv/lib64/python3.10/site-packages/postorius/utils.py", line 36, in render_api_error return render(request, 'postorius/errors/generic.html', File "/opt/mailman/venv/lib64/python3.10/site-packages/django/shortcuts.py", line 24, in render content = loader.render_to_string(template_name, context, request, using=using) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/template/backends/django.py", line 62, in render return self.template.render(context) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/template/base.py", line 173, in render with context.bind_template(self): File "/usr/lib64/python3.10/contextlib.py", line 135, in __enter__ return next(self.gen) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/template/context.py", line 254, in bind_template updates.update(processor(self.request)) File "/opt/mailman/venv/lib64/python3.10/site-packages/django_mailman3/context_processors.py", line 32, in common context["site_name"] = get_current_site(request).name File "/opt/mailman/venv/lib64/python3.10/site-packages/django/contrib/sites/shortcuts.py", line 16, in get_current_site return Site.objects.get_current(request) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/contrib/sites/models.py", line 59, in get_current return self._get_site_by_id(site_id) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/contrib/sites/models.py", line 30, in _get_site_by_id site = self.get(pk=site_id) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailman/venv/lib64/python3.10/site-packages/django/db/models/query.py", line 650, in get raise self.model.DoesNotExist( django.contrib.sites.models.Site.DoesNotExist: Site matching query does not exist.
Can someone point me in the right direction please?
Regards Onyeibo