Hi,
today I had the following error in my inbox:
KeyError: 'subject_prefix' AttributeError: 'MailingList' object has no attribute 'subject_prefix'
I checked the database, there is a column "subject_prefix", so I feel it is something in the code causing the error.
It's mailman 3.3.1 and I don't see a fix for such an error in the Changes of 3.3.2
Kind regards Torge
Traceback (most recent call last): File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 119, in __getattr__ return self._get(name) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 86, in _get raise KeyError(key) KeyError: 'subject_prefix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/models/mailinglist.py", line 197, in update_from_mailman value = getattr(mm_list, propname) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 124, in __getattr__ self.__class__.__name__, name)) AttributeError: 'MailingList' object has no attribute 'subject_prefix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/web/venv/lib/python3.6/site-packages/django_extensions/management/commands/runjobs.py", line 36, in runjobs job().execute() File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/jobs/sync_mailman.py", line 36, in execute sync_with_mailman() File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/lib/mailman.py", line 132, in sync_with_mailman mlist.update_from_mailman() File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/models/mailinglist.py", line 199, in update_from_mailman value = mm_list.settings[propname] File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 146, in __getitem__ return self._get(key) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 88, in _get return self.rest_data[key] File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 74, in rest_data response, content = self._connection.call(self._url) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/connection.py", line 112, in call error_msg, response, None) urllib.error.HTTPError: HTTP Error 500: <html> <head> <title>Internal Server Error</title> </head> <body> <h1><p>Internal Server Error</p></h1>
</body> </html>
ERROR OCCURED IN DAILY JOB: sync_mailman (APP: hyperkitty) START TRACEBACK: END TRACEBACK
Torge Riedel writes:
today I had the following error in my inbox:
KeyError: 'subject_prefix' AttributeError: 'MailingList' object has no attribute 'subject_prefix'
This isn't very helpful. Does this happen for all lists? A particular list? How long have you been running this version of Mailman 3 (time since last update)?
Is there anything in the logs from Mailman core (this error is coming from the client side of the REST API module)?
I checked the database,
Which database? It looks to me like subject_prefix is declared in both Mailman core and HyperKitty (I haven't checked Postorius). I'm not real familiar with this code, so it could be that eventually everything boils down to REST calls to Mailmman core, but it looks like Django's database is involved for HyperKitty.
there is a column "subject_prefix", so I feel it is something in the code causing the error.
Sure, but what? We eventually see this:
File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/connection.py", line 112, in call error_msg, response, None) urllib.error.HTTPError: HTTP Error 500: <html> <head> <title>Internal Server Error</title> </head> <body> <h1><p>Internal Server Error</p></h1>
</body> </html>
which is mailmanclient passing on the REST API's report that Mailman core is very confused. There should be a log message from core for this.
Am 15.11.20 um 12:20 schrieb Stephen J. Turnbull:
This isn't very helpful. Does this happen for all lists? A particular list? How long have you been running this version of Mailman 3 (time since last update)?
This happens when daily cron is executed (/opt/mailman/web/bin/django-admin.sh runjobs daily) and I received the mail by cron.
I think I have updated to 3.3.1 two or three weeks after release.
But 3 days ago I recognized that mails from cron for user "mailman" where stored in /var/mail/mailman instead forwarding them to my admin inbox. Missed an alias. I changed this and checked the mail file for entries and found it is flooded with errors due to a wrong script (not the one mentioned here) in cron job. Maybe I have overseen this error happened already before, between all those other errors.
Looks like it is happening only for one list, see mailman core log below. I replaced the list name by <listid>@<listdomain>.de
A - maybe important - info: Archiving is disabled at all.
Is there anything in the logs from Mailman core (this error is coming from the client side of the REST API module)?
[2020-11-15 00:00:10 +0100] [9949] [ERROR] Error handling request /3.1/lists/<listid>@<listdomain>.de/config Traceback (most recent call last): File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/engine/result.py", line 779, in _getter getter = self._metadata._getter AttributeError: 'NoneType' object has no attribute '_getter'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/opt/mailman/core/venv/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 134, in handle self.handle_request(listener, req, client, addr) File "/opt/mailman/core/venv/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 175, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/database/transaction.py", line 50, in wrapper rtn = function(*args, **kws) File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/rest/wsgiapp.py", line 193, in __call__ return super().__call__(environ, start_response) File "falcon/api.py", line 274, in falcon.api.API.__call__ File "falcon/api.py", line 269, in falcon.api.API.__call__ File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/rest/listconf.py", line 279, in on_get value = getter.get(self._mlist, attribute) File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/rest/listconf.py", line 52, in get return sorted(aliases.aliases) File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/model/mailinglist.py", line 563, in aliases for alias in aliases: File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 101, in instances cursor.close() File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__ exc_value, with_traceback=exc_tb, File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_ raise exception File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 61, in instances for query_entity in query._entities File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 61, in <listcomp> for query_entity in query._entities File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 4375, in row_processor polymorphic_discriminator=self._polymorphic_discriminator, File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 422, in _instance_processor getter = result._getter(col, False) File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/engine/result.py", line 781, in _getter return self._non_result(None, err) File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/engine/result.py", line 1241, in _non_result replace_context=err, File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_ raise exception sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically. [15/Nov/2020:00:00:10 +0100] "GET /3.1/lists/<listid>@<listdomain>.de/config HTTP/1.1" 500 0 "-" "-"
I checked the database,
Which database? It looks to me like subject_prefix is declared in both Mailman core and HyperKitty (I haven't checked Postorius). I'm not real familiar with this code, so it could be that eventually everything boils down to REST calls to Mailmman core, but it looks like Django's database is involved for HyperKitty.
I checked both databases: mailman-web.hyperkitty_mailinglist and mailman-core.mailinglist
there is a column "subject_prefix", so I feel it is something in the code causing the error.
Sure, but what? We eventually see this:
File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/connection.py", line 112, in call error_msg, response, None) urllib.error.HTTPError: HTTP Error 500: <html> <head> <title>Internal Server Error</title> </head> <body> <h1><p>Internal Server Error</p></h1>
</body> </html>
which is mailmanclient passing on the REST API's report that Mailman core is very confused. There should be a log message from core for this.
Hope I provided all the information you requested for.
Kind regards Torge
Torge Riedel writes:
This happens when daily cron is executed (/opt/mailman/web/bin/django-admin.sh runjobs daily) and I received the mail by cron.
That's good. Not the behavior, but the fact that it happens consistently in the same place.
I think I have updated to 3.3.1 two or three weeks after release.
OK. So it's been happening for a while and it's reproducible. We will be able to fix this quickly, I think.
wrong script (not the one mentioned here) in cron job.
So that's fixed but the errors still happen, right?
Maybe I have overseen this error happened already before, between all those other errors.
The only interesting information from our point of view would be if it was happening *before* you updated, and if so, when it started. That might help to identify the particular code and what changed. But if that information isn't immediately available, don't worry about it, it's a minor data point that *might*, but might not, be useful at some point.
Looks like it is happening only for one list, see mailman core log below. I replaced the list name by <listid>@<listdomain>.de
OK. Can you confirm the other lists are being processed? It's not just this one being first, and the whole cron job crashes?
About the core logs:
Traceback (most recent call last): File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/engine/result.py", line 779, in _getter getter = self._metadata._getter AttributeError: 'NoneType' object has no attribute '_getter'
[snip]
sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically. [15/Nov/2020:00:00:10 +0100] "GET /3.1/lists/<listid>@<listdomain>.de/config HTTP/1.1" 500 0 "-" "-"
This is weird. It seems like your list doesn't exist. :-(
I don't have a good idea what that means, except that obviously something Mailman did not expect happened. Can you check the database for that list and see if it looks sane? (I'm not sure what "sane" means in this context. Maybe Mark or Abhilash can be more helpful.)
I checked both databases: mailman-web.hyperkitty_mailinglist and mailman-core.mailinglist
OK, that's good.
Hope I provided all the information you requested for.
Yes, you did.
I'm sorry, but at this point I'm at the end of my existing knowledge, and until next Saturday I have a very busy week. I will spend a little time if I can, but can't make any promises because I'll have to go diving into dark corners of the code. I hope that Mark or Abhilash will be able to pick this up, and the information you've given should help them a lot. If you can check the database for this list, and confirm that other lists are being processed, those two data would probably help.
Steve
Am 15.11.20 um 17:50 schrieb Stephen J. Turnbull:
That's good. Not the behavior, but the fact that it happens consistently in the same place. Didn't happen again. I would have expected that from a daily cron-job.
wrong script (not the one mentioned here) in cron job.
So that's fixed but the errors still happen, right? It happened just once after the fix. But then not again. The only interesting information from our point of view would be if it was happening *before* you updated, and if so, when it started. That might help to identify the particular code and what changed. But if that information isn't immediately available, don't worry about it, it's a minor data point that *might*, but might not, be useful at some point. Sadly I deleted the local mail file.
About the core logs:
Traceback (most recent call last): File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/engine/result.py", line 779, in _getter getter = self._metadata._getter AttributeError: 'NoneType' object has no attribute '_getter'
[snip]
sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically. [15/Nov/2020:00:00:10 +0100] "GET /3.1/lists/<listid>@<listdomain>.de/config HTTP/1.1" 500 0 "-" "-"
This is weird. It seems like your list doesn't exist. :-( Well, it exists. I'm thinking of resource shortage. It's a 2 GB with several apps on it. One ist mailman3 consuming 600 MB, so the VM is always a little bit short on free RAM.
On Sun, Nov 15, 2020, at 1:20 AM, Torge Riedel wrote:
Hi,
today I had the following error in my inbox:
KeyError: 'subject_prefix' AttributeError: 'MailingList' object has no attribute 'subject_prefix'
I checked the database, there is a column "subject_prefix", so I feel it is something in the code causing the error.
It's mailman 3.3.1 and I don't see a fix for such an error in the Changes of 3.3.2
Is the value of subject prefix for that list set to *something* in Mailman? You can check via API or if you have Postorius, you can go to List's settings page and under the "List Identity" tab there is a field.
I am suspecting Hyperkitty wants to read this attribute but since it is not set in database, Core is skipping the field in API response for /list/<listid>/config which typically returns all the list settings.
Abhilash
Kind regards Torge
Traceback (most recent call last): File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 119, in __getattr__ return self._get(name) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 86, in _get raise KeyError(key) KeyError: 'subject_prefix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/models/mailinglist.py", line 197, in update_from_mailman value = getattr(mm_list, propname) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 124, in __getattr__ self.__class__.__name__, name)) AttributeError: 'MailingList' object has no attribute 'subject_prefix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/mailman/web/venv/lib/python3.6/site-packages/django_extensions/management/commands/runjobs.py", line 36, in runjobs job().execute() File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/jobs/sync_mailman.py", line 36, in execute sync_with_mailman() File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/lib/mailman.py", line 132, in sync_with_mailman mlist.update_from_mailman() File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/models/mailinglist.py", line 199, in update_from_mailman value = mm_list.settings[propname] File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 146, in __getitem__ return self._get(key) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 88, in _get return self.rest_data[key] File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/base.py", line 74, in rest_data response, content = self._connection.call(self._url) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/connection.py", line 112, in call error_msg, response, None) urllib.error.HTTPError: HTTP Error 500: <html> <head> <title>Internal Server Error</title> </head> <body> <h1><p>Internal Server Error</p></h1>
</body> </html>
ERROR OCCURED IN DAILY JOB: sync_mailman (APP: hyperkitty) START TRACEBACK: END TRACEBACK
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)
Am 15.11.20 um 23:24 schrieb Abhilash Raj:
Is the value of subject prefix for that list set to*something* in Mailman?
Hi,
yes, it is:
Mail list is "aktive@lists.<domain>" and the subject_prefix is "[Aktive]". In database and also visible in Postorius.
The error report also didn't happen again.
Kind regards Torge
participants (3)
-
Abhilash Raj
-
Stephen J. Turnbull
-
Torge Riedel