Re: [Mailman-Users] MM3 startup issues
Restoring original Subject:, and doesn't this thread belong on mailman-users@msailman3.org - CCing there.
On 1/5/20 11:51 PM, Allan Hansen wrote:
Thanks again, Mark! My responses below.
On 1/4/20 5:47 PM, Allan Hansen wrote:
a. The server was set up with the wrong domain name (our fault), so I had to add the ‘correct’ one. I had seen the command ‘Add Domain’ in the UI and thought that would do it, but Brian kindly sent me a list of additional instructions, which we then implemented. That made it possible to create a list in the new domain, subscribe people and post messages. However, messages are not archived. What extra step is needed to enable archiving?
What are the setytings in Postorius -> Settings -> Archiving?
Archive policy: Private archives Archive archivers: hyperkitty, prototype
Are the messages in Mailman's var/archives/prototype/LIST@DOMAIN/new directory?
Are there messages in Mailman's var/archives/hyperkitty/spool/ directory?
What's the setting for base_url in mailman-hyperkitty.cfg?
Are there any errors in var/logs/mailman.log?
b. When go to the server using the new domain (both before and after logging in), I see not just the lists I created in the new domain, but the lists created in the old domain. These lists of lists are domain specific and should not be listed together. That’s just IMHO, but not serious, as I will soon get rid of anything in the old domain. So feel free to ignore this one if this is intended, which I could see might be the case.
Set
FILTER_VHOST = True
in settings_local.py
Yes, Brian told me to do the same. This is the what I wrote back:
hansen@rccrmail:/opt/mailman/mm$ sudo vi settings.py
Edited the setting to: # Only display mailing-lists from the same virtual host as the webserver FILTER_VHOST = True
You shouldn't edit settings.py. You should override the setting by putting it in settings_local.py.
Then Brian told me to restart qcluster: hansen@rccrmail:/opt/mailman/mm$ sudo systemctl restart qcluster
qcluster is not what you need to restart. You need to restart whatever is supporting the wsgi interface to Django. This may be uwsgi or gunicorn or ??. Whatever it is, that's what needs to be restarted.
I then logged in, but the same lists are showing. It either takes the system a long time to reset or it has ignored the setting. Just tried it again, and the lists are all showing. Do I need to manually recompile the file?
c. I then moved on to the templates and added a template for the message text to send to new subscribers. That resulted in the following error message when I went in as moderator to approve of a new subscription:
Something went wrong Mailman REST API not available. Please start Mailman core.
Postorius is unable to access core's REST API. Is Mailman running?
Well, I was able to post to the lists, so I assume it is. Listing at processes, I see a bunch of postgres, python3, nginx, django-adminp but nothing explicitly with a ‘mailman’ string.
If you do ps ax|grep runner=
, what do you see? If you don't see at
least three processes with --runner=rest:0:1
, stop Mailman and start
Mailman.
If so, what's in /opt/mailman/mm/var/logs/mailmansuite.log or whatever it's called - defined as
filename
in thefile
handler in the LOGGING definition in settings(_local).py.hansen@rccrmail:/opt/mailman/mm/logs$ tail -f mailmansuite.log return Site.objects.get_current(request) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/contrib/sites/models.py", line 60, in get_current return self._get_site_by_request(request) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/contrib/sites/models.py", line 45, in _get_site_by_request SITE_CACHE[domain] = self.get(domain__iexact=domain) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/db/models/query.py", line 408, in get self.model._meta.object_name django.contrib.sites.models.Site.DoesNotExist: Site matching query does not exist.
This is because of the domain change. In settings(_local).py you have a setting for SITE_ID. Possibly, setting that in settings_local.py to a value one greater that the current setting will do. To be certain of the correct value, you need to look at the django_site table in mailman's database. That table has 3 columns, id, domain and name. The id for the row of your domain is what needs to be set as SITE_ID.
[ABH] At this point I click to accept a subsription request:
ERROR 2020-01-06 07:32:41,439 699 postorius.middleware Mailman REST API not available Traceback (most recent call last): File "/opt/mailman/mm/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen chunked=chunked, File "/opt/mailman/mm/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/opt/mailman/mm/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.7/http/client.py", line 1321, in getresponse response.begin() File "/usr/lib/python3.7/http/client.py", line 296, in begin version, status, reason = self._read_status() File "/usr/lib/python3.7/http/client.py", line 265, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response
So yes, the REST API is not there. How can I get it going?
Stop Mailman and then start it.
Before we added the new domain, I was able to accept subscription requests to the previous domain’s lists. No more.
Yours,
Allan
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro wrote:
Restoring original Subject:, and doesn't this thread belong on mailman-users@msailman3.org - CCing there.
Sorry about both, Mark. I'm now here. Didn't know this one existed and was told to use the other list server.
On 1/4/20 5:47 PM, Allan Hansen wrote:
a. The server was set up with the wrong domain name (our fault), so I had to add the ‘correct’ one. I had seen the command ‘Add Domain’ in the UI and thought that would do it, but Brian kindly sent me a list of additional instructions, which we then implemented. That made it possible to create a list in the new domain, subscribe people and post messages. However, messages are not archived. What extra step is needed to enable archiving? What are the setytings in Postorius -> Settings -> Archiving? Archive policy: Private archives Archive archivers: hyperkitty, prototype
Are the messages in Mailman's var/archives/prototype/LIST@DOMAIN/new directory?
Yes! I found them. But the message files end with the name of the old host, not the new host name under the new domain.
Are there messages in Mailman's var/archives/hyperkitty/spool/ directory?
There are 5 .pck files there dated 1/5/2002.
What's the setting for base_url in mailman-hyperkitty.cfg?
It's base_url: https://<OLDHOSTNAME>/archives
I suppose it should be changed to base_url: https://<NEWHOSTNAME>/archives
But: What if we decided to have more than one domain, as the UI indicates is kosher?
Are there any errors in var/logs/mailman.log?
Yep. Lots. They all are of this nature:
Exception in "hyperkitty" archiver Traceback: ... File "/opt/mailman/mm/venv/lib/python3.7/site-packages/urllib3/connection.py", line 430, in _match_hostname match_hostname(cert, asserted_hostname) File "/usr/lib/python3.7/ssl.py", line 327, in match_hostname % (hostname, dnsnames[0])) ssl.SSLCertVerificationError: ("hostname 'OLDHOSTNAME' doesn't match 'NEWHOSTNAME'",)
b. When I go to the server using the new domain (both before and after logging in), I see not just the lists I created in the new domain, but the lists created in the old domain. These lists of lists are domain specific and should not be listed together. That’s just IMHO, but not serious, as I will soon get rid of anything in the old domain. So feel free to ignore this one if this is intended, which I could see might be the case.
Set FILTER_VHOST = True in settings_local.py
Yes, Brian told me to do the same (well, settings.py). This is the what I wrote back: hansen@rccrmail:/opt/mailman/mm$ sudo vi settings.py Edited the setting to: # Only display mailing-lists from the same virtual host as the webserver FILTER_VHOST = True
You shouldn't edit settings.py. You should override the setting by putting it in settings_local.py.
Silly. I should have remembered that from back in the days. But if the local file is overriding, it should have worked, I'd think.
Then Brian told me to restart qcluster: hansen@rccrmail:/opt/mailman/mm$ sudo systemctl restart qcluster
qcluster is not what you need to restart. You need to restart whatever is supporting the wsgi interface to Django. This may be uwsgi or gunicorn or ??. Whatever it is, that's what needs to be restarted.
Beats me, Mark. Brian, do you know?
I then logged in, but the same lists are showing. It either takes the system a long time to reset or it has ignored the setting. Just tried it again, and the lists are all showing. Do I need to manually recompile the file?
c. I then moved on to the templates and added a template for the message text to send to new subscribers. That resulted in the following error message when I went in as moderator to approve of a new subscription: Something went wrong Mailman REST API not available. Please start Mailman core. Postorius is unable to access core's REST API. Is Mailman running? Well, I was able to post to the lists, so I assume it is. Listing at processes, I see a bunch of postgres, python3, nginx, django-adminp but nothing explicitly with a ‘mailman’ string.
If you do ps ax|grep runner=, what do you see? If you don't see at least three processes with --runner=rest:0:1, stop Mailman and start Mailman.
Yep. I did not get the whole string before. With your options I see three of these rest:0:1 processes. So I guess the REST stuff is running anyway.
If so, what's in /opt/mailman/mm/var/logs/mailmansuite.log or whatever it's called - defined as filename in the file handler in the LOGGING definition in settings(_local).py.
hansen@rccrmail:/opt/mailman/mm/logs$ tail -f mailmansuite.log return Site.objects.get_current(request) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/contrib/sites/models.py", line 60, in get_current return self._get_site_by_request(request) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/contrib/sites/models.py", line 45, in _get_site_by_request SITE_CACHE[domain] = self.get(domain__iexact=domain) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/db/models/query.py", line 408, in get self.model._meta.object_name django.contrib.sites.models.Site.DoesNotExist: Site matching query does not exist.
This is because of the domain change. In settings(_local).py you have a setting for SITE_ID. Possibly, setting that in settings_local.py to a value one greater that the current setting will do.
Trying setting it to 1 (it was 0 before).
To be certain of the correct value, you need to look at the django_site table in mailman's database. That table has 3 columns, id, domain and name. The id for the row of your domain is what needs to be set as SITE_ID.
You lost me here. No idea how to access the Mailman database. Brian, do you know?
[ABH] At this point I click to accept a subsription request: ERROR 2020-01-06 07:32:41,439 699 postorius.middleware Mailman REST API not available Traceback (most recent call last): File "/opt/mailman/mm/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen chunked=chunked, File "/opt/mailman/mm/venv/lib/python3.7/site packages/urllib3/connectionpool.py", line 421, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/opt/mailman/mm/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.7/http/client.py", line 1321, in getresponse response.begin() File "/usr/lib/python3.7/http/client.py", line 296, in begin version, status, reason = self._read_status() File "/usr/lib/python3.7/http/client.py", line 265, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response
So yes, the REST API is not there. How can I get it going?
Stop Mailman and then start it.
No idea here, either. I looked online and found this:
$ from mailman.commands.cli_control import Stop But it complained: from: too many arguments
Must have found an out-of-date page. :-)
Yours,
Allan
On 1/7/20 2:16 AM, hansen@rc.org wrote:
Beats me, Mark. Brian, do you know?
Yes sir. Here are the three startup scripts that you will need to know. I should have included that in the communication I sent you and I apologize for that:
systemctl start/stop/restart/status mailman (this is for Mailman core)
systemctl start/stop/restart/status qcluster (this is for Django)
systemctl start/stop/restart/status gunicorn (this is for web access to postorius/hyperkitty)
-- Please let me know if you need further assistance.
Thank you for your business. We appreciate our clients. Brian Carpenter EMWD.com
-- EMWD's Knowledgebase: https://clientarea.emwd.com/index.php/knowledgebase
EMWD's Community Forums http://discourse.emwd.com/
On 1/6/20 11:16 PM, hansen@rc.org wrote:
Mark Sapiro wrote:
What's the setting for base_url in mailman-hyperkitty.cfg?
It's base_url: https://<OLDHOSTNAME>/archives
I suppose it should be changed to base_url: https://<NEWHOSTNAME>/archives
That's part of it, but see below.
But: What if we decided to have more than one domain, as the UI indicates is kosher?
Again, see below.
Are there any errors in var/logs/mailman.log?
Yep. Lots. They all are of this nature:
Exception in "hyperkitty" archiver Traceback: ... File "/opt/mailman/mm/venv/lib/python3.7/site-packages/urllib3/connection.py", line 430, in _match_hostname match_hostname(cert, asserted_hostname) File "/usr/lib/python3.7/ssl.py", line 327, in match_hostname % (hostname, dnsnames[0])) ssl.SSLCertVerificationError: ("hostname 'OLDHOSTNAME' doesn't match 'NEWHOSTNAME'",)
OK. So the real issue is you are trying to access HyperKitty via an https URL and the certificate presented by the web server doesn't allow the domain in the URL. The domain in the URL doesn't really matter as long as it resolves to the HyperKitty host, but if it's an https URL the host's certificate must include that domain.
It looks like in your case, the certificate is for 'NEWHOSTNAME', so setting
base_url: https://<NEWHOSTNAME>/archives
should be enough
qcluster is not what you need to restart. You need to restart whatever is supporting the wsgi interface to Django. This may be uwsgi or gunicorn or ??. Whatever it is, that's what needs to be restarted.
Beats me, Mark. Brian, do you know?
Brian has answered:
systemctl restart gunicorn
If you do ps ax|grep runner=, what do you see? If you don't see at least three processes with --runner=rest:0:1, stop Mailman and start Mailman.
Yep. I did not get the whole string before. With your options I see three of these rest:0:1 processes. So I guess the REST stuff is running anyway.
OK
If so, what's in /opt/mailman/mm/var/logs/mailmansuite.log or whatever it's called - defined as filename in the file handler in the LOGGING definition in settings(_local).py.
hansen@rccrmail:/opt/mailman/mm/logs$ tail -f mailmansuite.log return Site.objects.get_current(request) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/contrib/sites/models.py", line 60, in get_current return self._get_site_by_request(request) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/contrib/sites/models.py", line 45, in _get_site_by_request SITE_CACHE[domain] = self.get(domain__iexact=domain) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/mailman/mm/venv/lib/python3.7/site-packages/django/db/models/query.py", line 408, in get self.model._meta.object_name django.contrib.sites.models.Site.DoesNotExist: Site matching query does not exist.
This is because of the domain change. In settings(_local).py you have a setting for SITE_ID. Possibly, setting that in settings_local.py to a value one greater that the current setting will do.
Trying setting it to 1 (it was 0 before).
OK. You can just shotgun trying numbers until one works, or
To be certain of the correct value, you need to look at the django_site table in mailman's database. That table has 3 columns, id, domain and name. The id for the row of your domain is what needs to be set as SITE_ID.
You lost me here. No idea how to access the Mailman database. Brian, do you know?
It depends on the database engine. In the database section in your mailman.cfg there is a class: definition which will mention sqlite, mysql or postgresql. The tools for interacting with these are sqlite3, mysql and psql respectively.
Stop Mailman and then start it.
No idea here, either. I looked online and found this:
$ from mailman.commands.cli_control import Stop But it complained: from: too many arguments
That's a Python statement, not a shell command.
You would do
systemctl stop mailman systemctl start mailman
alternatively, you could do
/path/to/bin/mailman stop /path/to/bin/mailman start
but that appears to not be the issue.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Brian Carpenter
-
hansen@rc.org
-
Mark Sapiro