sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none()
Hi Team,
Today, I found an error message like "Multiple rows were found
for one_or_none()" when a hold message is approved for a list. Until yesterday the mails were accepted and delivered fine.
But today the above said error message is thrown. Apart from
that, I saw the mail had gone into the shunt queue.
The "mailman qfile" output of the shunt message and the respective
traceback log from mailman.log are attached. You may please go through them and help me out.
Please also let me know if I have to share any more details.
-- Thanks & Regards, Shashi Kanth.K 9052671936
On 7/24/20 10:34 AM, Shashikanth Komandoor wrote:
Hi Team,
Today, I found an error message like "Multiple rows were found
for one_or_none()" when a hold message is approved for a list. Until yesterday the mails were accepted and delivered fine.
We have seen this issue before. See <https://gitlab.com/mailman/mailman/-/issues/657>. There are also multiple threads on it in the archive, e.g., <https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/6PLIYZHUOFTOISGRIECI5FFSHMXMV7X5/>.
We don't know how it happens, but the issue is that the listarchiver
table in the database has multiple mhonarc
entries for the same
mailing_list_id
.
You can see the problem with the query
select * from listarchiver where name = 'mhonarc';
There will be two entries with the same mailing_list_id
and deleting
one of them will fix this and you can run mailman unshunt
to reprocess
the shunted messages.
The above referenced issue contains a script that can be run to remove the extra entry.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thank you Mark.
What you have said is right..
I found a list with two "hyperkitty" records in the listarchiver in the database. I had removed the list and recreated it and now I found it is working fine. The recreated list is having only one record.
After searching the links you provided I found there is just a work around but not the precaution to be taken for not getting the duplicate record.
Can you say what might be the reason for this duplication? If I need to provide any details, please let me know.
On Fri, Jul 24, 2020 at 11:50 PM Mark Sapiro <mark@msapiro.net> wrote:
On 7/24/20 10:34 AM, Shashikanth Komandoor wrote:
Hi Team,
Today, I found an error message like "Multiple rows were found
for one_or_none()" when a hold message is approved for a list. Until yesterday the mails were accepted and delivered fine.
We have seen this issue before. See <https://gitlab.com/mailman/mailman/-/issues/657>. There are also multiple threads on it in the archive, e.g., < https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/6...
.
We don't know how it happens, but the issue is that the
listarchiver
table in the database has multiplemhonarc
entries for the samemailing_list_id
.You can see the problem with the query
select * from listarchiver where name = 'mhonarc';
There will be two entries with the same
mailing_list_id
and deleting one of them will fix this and you can runmailman unshunt
to reprocess the shunted messages.The above referenced issue contains a script that can be run to remove the extra entry.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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 & Regards, Shashi Kanth.K 9052671936
On 7/26/20 10:45 AM, Shashikanth Komandoor wrote:
Thank you Mark.
What you have said is right..
I found a list with two "hyperkitty" records in the listarchiver in the database. I had removed the list and recreated it and now I found it is working fine. The recreated list is having only one record.
OK, but that's not a reasonable way to fix this in general. You can just
remove the extra
record using a direct database query which is
probably the least disruptive way to fix this.
After searching the links you provided I found there is just a work around but not the precaution to be taken for not getting the duplicate record.
Can you say what might be the reason for this duplication? If I need to provide any details, please let me know.
As noted in the threads I referenced, we don't know the cause. Yours is
the first report of this issue with the hyperkitty
archiver. In all
the other reports, the duplicate archiver has been mhonarc
.
If it happens again and you know the exact sequence of events that led to it, i.e. what was done with the list between the last time it worked and when it stopped working, that might give us clues, but currently we are at a total loss to understand how this happens.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thank you Mark for your response.
But I am having a final query over this issue. Out of the two hyperkitty records I observed in the database, I am confused which record do I need to remove directly from the database? Because I doubt still there is one more list with the same style i.e. with two hyperkitty records.
Please advise.
On Mon, Jul 27, 2020 at 4:40 AM Mark Sapiro <mark@msapiro.net> wrote:
On 7/26/20 10:45 AM, Shashikanth Komandoor wrote:
Thank you Mark.
What you have said is right..
I found a list with two "hyperkitty" records in the listarchiver in the database. I had removed the list and recreated it and now I found it is working fine. The recreated list is having only one record.
OK, but that's not a reasonable way to fix this in general. You can just remove the
extra
record using a direct database query which is probably the least disruptive way to fix this.After searching the links you provided I found there is just a work around but not the precaution to be taken for not getting the duplicate record.
Can you say what might be the reason for this duplication? If I need to provide any details, please let me know.
As noted in the threads I referenced, we don't know the cause. Yours is the first report of this issue with the
hyperkitty
archiver. In all the other reports, the duplicate archiver has beenmhonarc
.If it happens again and you know the exact sequence of events that led to it, i.e. what was done with the list between the last time it worked and when it stopped working, that might give us clues, but currently we are at a total loss to understand how this happens.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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 & Regards, Shashi Kanth.K 9052671936
On 7/26/20 10:13 PM, Shashikanth Komandoor wrote:
Thank you Mark for your response.
But I am having a final query over this issue. Out of the two hyperkitty records I observed in the database, I am confused which record do I need to remove directly from the database? Because I doubt still there is one more list with the same style i.e. with two hyperkitty records.
If there are multiple rows in the listarchiver for the same
mailing_list_id
and archiver name
, you can safely delete all but one
of them. It doesn't matter which ones you delete. They should be
identical except for the id
.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
参加者 (2)
-
Mark Sapiro
-
Shashikanth Komandoor