Resetting template to previous value crashes handling and refreshing uri-based templates
I did a few trials and changes to footers. I found that if you change the value of the uri of a template back to the previous one, the list fails to deliver mail due to multiple rows in the database. I would say this is due to a broken file_cache handling.
I would like to be able to set exactly the same value to force a refresh of the file cache. Now you have to delete all files in the cache and empty the file_cache table in the database. I have tried to reset the expiry time in the database but that did not work although I did not try to restart mailman to force the issue.
I did all handling of templates from the "mailman shell", I have not tried to place files in the right place on the mailman path for an individual list. For path-based templates I have the impression that they are reloaded so that maybe would have been a better solution
Sep 23 14:48:11 2017 (5342) Traceback (most recent call last):
File ".../mailman-3.2.0a1-py3.5.egg/mailman/core/runner.py", line 173,
in _one_iteration
self._process_one_file(msg, msgdata)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/core/runner.py", line 266,
in _process_one_file
keepqueued = self._dispose(mlist, msg, msgdata)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/runners/pipeline.py", line
37, in _dispose
process(mlist, msg, msgdata, pipeline)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/core/pipelines.py", line 5
0, in process
handler.process(mlist, msg, msgdata)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/handlers/decorate.py", lin
e 247, in process
process(mlist, msg, msgdata)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/handlers/decorate.py", lin
e 76, in process
footer = decorate('list:member:regular:footer', mlist, d)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/handlers/decorate.py", lin
e 209, in decorate
template = getUtility(ITemplateLoader).get(name, mlist, **extradict)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/model/template.py", line 1
84, in get
name, lookup_context, **substitutions)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/database/transaction.py",
line 85, in wrapper
return function(args[0], config.db.store, *args[1:], **kws)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/model/template.py", line 9
8, in get
contents = cache_mgr.get(actual_uri)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/database/transaction.py",
line 85, in wrapper
return function(args[0], config.db.store, *args[1:], **kws)
File ".../mailman-3.2.0a1-py3.5.egg/mailman/model/cache.py", line 125,
in get
CacheEntry.key == key).one_or_none()
File ".../SQLAlchemy-1.2.0b2-py3.5-linux-x86_64.egg/sqlalchemy/orm/que
ry.py", line 2814, in one_or_none
"Multiple rows were found for one_or_none()")
sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none()
(path substituted with "...")