On Mar 17, 2017, at 11:22 AM, Mark Sapiro wrote:
The above is the last line of
exists = store.query(ListArchiver).filter( ListArchiver.mailing_list == mailing_list, ListArchiver.name == archiver_name).one_or_none()
which is querying the archivers enabled for this list for the name of a system enabled archiver and expects to find at most one entry
File "/usr/lib64/python3.4/site-packages/sqlalchemy/orm/query.py", line 2733, in one_or_none "Multiple rows were found for one_or_none()")
but finds more than one.
sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none() Mar 17 11:54:11 2017 (6217) SHUNTING: 1489748051.1949184+7a59df19c81493cb419306d620376efc0e381819
So the cause is there appear to be multiple database entries for this list and some archiver name, but I don't know how that can happen.
I don't know either, especially since ListArchiverSet.__init__() has this:
# Add any system enabled archivers which aren't already associated
# with the mailing list.
for archiver_name in system_archivers:
exists = store.query(ListArchiver).filter(
ListArchiver.mailing_list == mailing_list,
ListArchiver.name == archiver_name).one_or_none()
if exists is None:
store.add(ListArchiver(mailing_list, archiver_name,
system_archivers[archiver_name]))
It runs the exact same query, and only adds the archiver to the store if it doesn't already exist.
What does the following give you?
% mailman shell Welcome to the GNU Mailman shell
# You may have to use getUtility(...).get() to find the offending list m = list(getUtility(IListManager).mailing_lists)[0] m <mailing list "ant@example.com" at 0x7face8b2da20> from mailman.model.mailinglist import ListArchiver q = config.db.store.query(ListArchiver).filter( ... ListArchiver.mailing_list == m) list(a.name for a in q) ['mhonarc', 'prototype', 'mail-archive']
Cheers, -Barry