From torgeriedel@gmx.de Sun Nov 15 09:20:44 2020 From: Torge Riedel To: mailman-users@mailman3.org Subject: [MM3-users] KeyError: 'subject_prefix' Date: Sun, 15 Nov 2020 10:20:39 +0100 Message-ID: <56b7ec85-eacd-30b7-d862-82fd83ff9750@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8585850639320645345==" --===============8585850639320645345== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 s= omething 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/rest= base/base.py", line 119, in __getattr__ return self._get(name) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/rest= base/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 =3D getattr(mm_list, propname) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/rest= base/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/sy= nc_mailman.py", line 36, in execute sync_with_mailman() File "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/lib/mai= lman.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 =3D mm_list.settings[propname] File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/rest= base/base.py", line 146, in __getitem__ return self._get(key) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/rest= base/base.py", line 88, in _get return self.rest_data[key] File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/rest= base/base.py", line 74, in rest_data response, content =3D self._connection.call(self._url) File "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/rest= base/connection.py", line 112, in call error_msg, response, None) urllib.error.HTTPError: HTTP Error 500: Internal Server Error

Internal Server Error

ERROR OCCURED IN DAILY JOB: sync_mailman (APP: hyperkitty) START TRACEBACK: END TRACEBACK --===============8585850639320645345==-- From turnbull.stephen.fw@u.tsukuba.ac.jp Sun Nov 15 11:20:28 2020 From: "Stephen J. Turnbull" To: mailman-users@mailman3.org Subject: [MM3-users] KeyError: 'subject_prefix' Date: Sun, 15 Nov 2020 20:20:20 +0900 Message-ID: <24497.3828.369135.986877@turnbull.sk.tsukuba.ac.jp> In-Reply-To: <56b7ec85-eacd-30b7-d862-82fd83ff9750@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2211008941344658726==" --===============2211008941344658726== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Torge Riedel writes: > today I had the following error in my inbox: >=20 > 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/r= estbase/connection.py", line 112, in call > error_msg, response, None) > urllib.error.HTTPError: HTTP Error 500: > > Internal Server Error > > >

Internal Server Error

>=20 > > 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. --===============2211008941344658726==-- From torgeriedel@gmx.de Sun Nov 15 12:39:39 2020 From: Torge Riedel To: mailman-users@mailman3.org Subject: [MM3-users] Re: KeyError: 'subject_prefix' Date: Sun, 15 Nov 2020 13:39:29 +0100 Message-ID: <27cf63ce-8f5f-0b95-6e2c-0839b3d2b83d@gmx.de> In-Reply-To: <24497.3828.369135.986877@turnbull.sk.tsukuba.ac.jp> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7819078190969088740==" --===============7819078190969088740== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.s= h 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 sto= red 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 cro= n 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 r= eplaced the list name by @.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/= @.de/config Traceback (most recent call last): =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/e= ngine/result.py", line 779, in _getter =C2=A0=C2=A0=C2=A0 getter =3D 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): =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/gunicorn/wor= kers/sync.py", line 134, in handle =C2=A0=C2=A0=C2=A0 self.handle_request(listener, req, client, addr) =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/gunicorn/wor= kers/sync.py", line 175, in handle_request =C2=A0=C2=A0=C2=A0 respiter =3D self.wsgi(environ, resp.start_response) =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/data= base/transaction.py", line 50, in wrapper =C2=A0=C2=A0=C2=A0 rtn =3D function(*args, **kws) =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/rest= /wsgiapp.py", line 193, in __call__ =C2=A0=C2=A0=C2=A0 return super().__call__(environ, start_response) =C2=A0 File "falcon/api.py", line 274, in falcon.api.API.__call__ =C2=A0 File "falcon/api.py", line 269, in falcon.api.API.__call__ =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/rest= /listconf.py", line 279, in on_get =C2=A0=C2=A0=C2=A0 value =3D getter.get(self._mlist, attribute) =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/rest= /listconf.py", line 52, in get =C2=A0=C2=A0=C2=A0 return sorted(aliases.aliases) =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/mailman/mode= l/mailinglist.py", line 563, in aliases =C2=A0=C2=A0=C2=A0 for alias in aliases: =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/o= rm/loading.py", line 101, in instances =C2=A0=C2=A0=C2=A0 cursor.close() =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/u= til/langhelpers.py", line 69, in __exit__ =C2=A0=C2=A0=C2=A0 exc_value, with_traceback=3Dexc_tb, =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/u= til/compat.py", line 178, in raise_ =C2=A0=C2=A0=C2=A0 raise exception =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/o= rm/loading.py", line 61, in instances =C2=A0=C2=A0=C2=A0 for query_entity in query._entities =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/o= rm/loading.py", line 61, in =C2=A0=C2=A0=C2=A0 for query_entity in query._entities =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/o= rm/query.py", line 4375, in row_processor =C2=A0=C2=A0=C2=A0 polymorphic_discriminator=3Dself._polymorphic_discriminat= or, =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/o= rm/loading.py", line 422, in _instance_processor =C2=A0=C2=A0=C2=A0 getter =3D result._getter(col, False) =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/e= ngine/result.py", line 781, in _getter =C2=A0=C2=A0=C2=A0 return self._non_result(None, err) =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/e= ngine/result.py", line 1241, in _non_result =C2=A0=C2=A0=C2=A0 replace_context=3Derr, =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchemy/u= til/compat.py", line 178, in raise_ =C2=A0=C2=A0=C2=A0 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/@.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/mailmanclien= t/restbase/connection.py", line 112, in call > > error_msg, response, None) > > urllib.error.HTTPError: HTTP Error 500: > > > > Internal Server Error > > > > > >

Internal Server Error

> > > > > > > > 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 --===============7819078190969088740==-- From turnbull.stephen.fw@u.tsukuba.ac.jp Sun Nov 15 16:50:47 2020 From: "Stephen J. Turnbull" To: mailman-users@mailman3.org Subject: [MM3-users] Re: KeyError: 'subject_prefix' Date: Mon, 16 Nov 2020 01:50:39 +0900 Message-ID: <24497.23647.383783.769679@turnbull.sk.tsukuba.ac.jp> In-Reply-To: <27cf63ce-8f5f-0b95-6e2c-0839b3d2b83d@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2942706610595823695==" --===============2942706610595823695== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 @.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): > =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalchem= y/engine/result.py", line 779, in _getter > =C2=A0=C2=A0=C2=A0 getter =3D 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/@.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 --===============2942706610595823695==-- From maxking@asynchronous.in Sun Nov 15 22:24:49 2020 From: Abhilash Raj To: mailman-users@mailman3.org Subject: [MM3-users] Re: KeyError: 'subject_prefix' Date: Sun, 15 Nov 2020 14:24:22 -0800 Message-ID: In-Reply-To: <56b7ec85-eacd-30b7-d862-82fd83ff9750@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7608851072833908665==" --===============7608851072833908665== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sun, Nov 15, 2020, at 1:20 AM, Torge Riedel wrote: > Hi, >=20 > today I had the following error in my inbox: >=20 > KeyError: 'subject_prefix' > AttributeError: 'MailingList' object has no attribute 'subject_prefix' >=20 > I checked the database, there is a column "subject_prefix", so I feel=20 > it is something in the code causing the error. >=20 > It's mailman 3.3.1 and I don't see a fix for such an error in the=20 > Changes of 3.3.2 >=20 Is the value of subject prefix for that list set to *something* in Mailman? Y= ou 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 s= et in database, Core is skipping the field in API response for /list/= /config which typically returns all the list settings. Abhilash > Kind regards > Torge >=20 > Traceback (most recent call last): > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/b= ase.py", line 119, in __getattr__ > return self._get(name) > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/b= ase.py", line 86, in _get > raise KeyError(key) > KeyError: 'subject_prefix' >=20 > During handling of the above exception, another exception occurred: >=20 > Traceback (most recent call last): > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/models/mailin= glist.py", line 197, in update_from_mailman > value =3D getattr(mm_list, propname) > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/b= ase.py", line 124, in __getattr__ > self.__class__.__name__, name)) > AttributeError: 'MailingList' object has no attribute 'subject_prefix' >=20 > During handling of the above exception, another exception occurred: >=20 > Traceback (most recent call last): > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/django_extensions/manage= ment/commands/runjobs.py", line 36, in runjobs > job().execute() > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/jobs/sync_mai= lman.py", line 36, in execute > sync_with_mailman() > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/lib/mailman.p= y", line 132, in sync_with_mailman > mlist.update_from_mailman() > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/hyperkitty/models/mailin= glist.py", line 199, in update_from_mailman > value =3D mm_list.settings[propname] > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/b= ase.py", line 146, in __getitem__ > return self._get(key) > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/b= ase.py", line 88, in _get > return self.rest_data[key] > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/b= ase.py", line 74, in rest_data > response, content =3D self._connection.call(self._url) > File=20 > "/opt/mailman/web/venv/lib/python3.6/site-packages/mailmanclient/restbase/c= onnection.py", line 112, in call > error_msg, response, None) > urllib.error.HTTPError: HTTP Error 500: > > Internal Server Error > > >

Internal Server Error

>=20 > > >=20 > ERROR OCCURED IN DAILY JOB: sync_mailman (APP: hyperkitty) > START TRACEBACK: > END TRACEBACK > _______________________________________________ > Mailman-users mailing list -- mailman-users(a)mailman3.org > To unsubscribe send an email to mailman-users-leave(a)mailman3.org > https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ > --=20 thanks, Abhilash Raj (maxking) --===============7608851072833908665==-- From torgeriedel@gmx.de Wed Nov 18 17:03:54 2020 From: Torge Riedel To: mailman-users@mailman3.org Subject: [MM3-users] Re: KeyError: 'subject_prefix' Date: Wed, 18 Nov 2020 18:03:48 +0100 Message-ID: <384fc29d-e8d3-9c1c-2d77-125b515b710e@gmx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6623715359651005308==" --===============6623715359651005308== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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(a)lists." and the subject_prefix is "[Aktive]". = In database and also visible in Postorius. The error report also didn't happen again. Kind regards Torge --===============6623715359651005308==-- From torgeriedel@gmx.de Wed Nov 18 17:08:43 2020 From: Torge Riedel To: mailman-users@mailman3.org Subject: [MM3-users] Re: KeyError: 'subject_prefix' Date: Wed, 18 Nov 2020 18:08:32 +0100 Message-ID: In-Reply-To: <24497.23647.383783.769679@turnbull.sk.tsukuba.ac.jp> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2722532847343618463==" --===============2722532847343618463== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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): > > =C2=A0 File "/opt/mailman/core/venv/lib/python3.6/site-packages/sqlalc= hemy/engine/result.py", line 779, in _getter > > =C2=A0=C2=A0=C2=A0 getter =3D 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/@.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 b= it short on free RAM. --===============2722532847343618463==--