Your message dated Wed, 13 Jan 2021 22:18:32 +0000
with message-id <[email protected]>
and subject line Bug#958977: fixed in mailman3 3.3.2-1
has caused the Debian Bug report #958977,
regarding mailman3: logrotate script should invoke "reopen" via 
mailman-wrapper, not mailman
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
958977: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958977
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mailman3
Version: 3.2.1-1
Control: tags -1 + patch

When mailman3 is configured with a postgresql database, only the `list`
user has direct access to the database.

In this case, when logrotate tries to invoke "mailman reopen", it fails
with pretty verbose error messages (see below).

This is resolved by invoking the "reopen" subcommand via
mailman-wrapper, not mailman as root, as in the attached patch.

See also:

https://salsa.debian.org/mailman-team/mailman3/-/merge_requests/1

                 --dkg

From d4ddff58fa9b318c95c8938c7f3f556e5ae6abe3 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <[email protected]>
Date: Sun, 26 Apr 2020 14:45:31 -0400
Subject: [PATCH] logrotate: invoke reopen as "list" user

logrotate's "reopen" invocation will fail if mailman is run as the
root user, and the backend database doesn't provide access to the
superuser.

For example, if mailman is connected to a postgresql database, the
credentials to connect to the database might not be immediately
available to the superuser, resulting in errors like:

    sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) \
        FATAL:  role "root" does not exist
---
 debian/mailman3.logrotate | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/mailman3.logrotate b/debian/mailman3.logrotate
index 0b048c8..d092400 100644
--- a/debian/mailman3.logrotate
+++ b/debian/mailman3.logrotate
@@ -8,7 +8,7 @@
 	create 640 list list
 	postrotate
 		if /etc/init.d/mailman3 status >/dev/null; then \
-		    /usr/bin/mailman reopen >/dev/null; \
+		    /usr/bin/mailman-wrapper reopen >/dev/null; \
 		fi;
 	endscript
 }
-- 
2.26.2

Apr 26 00:00:03 host systemd[1]: Starting Rotate log files...
Apr 26 00:00:06 host logrotate[12668]: Traceback (most recent call last):
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 2228, in 
_wrap_pool_connect
Apr 26 00:00:06 host logrotate[12668]:     return fn()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 425, in connect
Apr 26 00:00:06 host logrotate[12668]:     return 
_ConnectionFairy._checkout(self)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 822, in _checkout
Apr 26 00:00:06 host logrotate[12668]:     fairy = 
_ConnectionRecord.checkout(pool)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 554, in checkout
Apr 26 00:00:06 host logrotate[12668]:     rec = pool._do_get()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 1250, in _do_get
Apr 26 00:00:06 host logrotate[12668]:     self._dec_overflow()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/util/langhelpers.py", line 67, in 
__exit__
Apr 26 00:00:06 host logrotate[12668]:     compat.reraise(exc_type, exc_value, 
exc_tb)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 277, in reraise
Apr 26 00:00:06 host logrotate[12668]:     raise value
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 1247, in _do_get
Apr 26 00:00:06 host logrotate[12668]:     return self._create_connection()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 370, in 
_create_connection
Apr 26 00:00:06 host logrotate[12668]:     return _ConnectionRecord(self)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 499, in __init__
Apr 26 00:00:06 host logrotate[12668]:     
self.__connect(first_connect_check=True)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 701, in __connect
Apr 26 00:00:06 host logrotate[12668]:     connection = 
pool._invoke_creator(self)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/strategies.py", line 114, in 
connect
Apr 26 00:00:06 host logrotate[12668]:     return dialect.connect(*cargs, 
**cparams)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 437, in 
connect
Apr 26 00:00:06 host logrotate[12668]:     return self.dbapi.connect(*cargs, 
**cparams)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 130, in connect
Apr 26 00:00:06 host logrotate[12668]:     conn = _connect(dsn, 
connection_factory=connection_factory, **kwasync)
Apr 26 00:00:06 host logrotate[12668]: psycopg2.OperationalError: FATAL:  role 
"root" does not exist
Apr 26 00:00:06 host logrotate[12668]: The above exception was the direct cause 
of the following exception:
Apr 26 00:00:06 host logrotate[12668]: Traceback (most recent call last):
Apr 26 00:00:06 host logrotate[12668]:   File "/usr/bin/mailman", line 11, in 
<module>
Apr 26 00:00:06 host logrotate[12668]:     load_entry_point('mailman==3.2.1', 
'console_scripts', 'mailman')()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
Apr 26 00:00:06 host logrotate[12668]:     return self.main(*args, **kwargs)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/click/core.py", line 716, in main
Apr 26 00:00:06 host logrotate[12668]:     with self.make_context(prog_name, 
args, **extra) as ctx:
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/click/core.py", line 641, in make_context
Apr 26 00:00:06 host logrotate[12668]:     self.parse_args(ctx, args)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/click/core.py", line 1089, in parse_args
Apr 26 00:00:06 host logrotate[12668]:     rest = Command.parse_args(self, ctx, 
args)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/click/core.py", line 940, in parse_args
Apr 26 00:00:06 host logrotate[12668]:     value, args = 
param.handle_parse_result(ctx, opts, args)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/click/core.py", line 1477, in 
handle_parse_result
Apr 26 00:00:06 host logrotate[12668]:     self.callback, ctx, self, value)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/click/core.py", line 96, in 
invoke_param_callback
Apr 26 00:00:06 host logrotate[12668]:     return callback(ctx, param, value)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/mailman/bin/mailman.py", line 94, in 
initialize_config
Apr 26 00:00:06 host logrotate[12668]:     initialize(value)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/mailman/core/initialize.py", line 218, in 
initialize
Apr 26 00:00:06 host logrotate[12668]:     
initialize_2(propagate_logs=propagate_logs)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/mailman/core/initialize.py", line 177, in 
initialize_2
Apr 26 00:00:06 host logrotate[12668]:     config.db = 
getUtility(IDatabaseFactory, utility_name).create()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/mailman/database/factory.py", line 55, in create
Apr 26 00:00:06 host logrotate[12668]:     
SchemaManager(database).setup_database()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/mailman/database/factory.py", line 83, in 
setup_database
Apr 26 00:00:06 host logrotate[12668]:     context = 
MigrationContext.configure(self._database.store.connection())
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/orm/session.py", line 1120, in 
connection
Apr 26 00:00:06 host logrotate[12668]:     execution_options=execution_options,
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/orm/session.py", line 1126, in 
_connection_for_bind
Apr 26 00:00:06 host logrotate[12668]:     engine, execution_options
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/orm/session.py", line 424, in 
_connection_for_bind
Apr 26 00:00:06 host logrotate[12668]:     conn = bind.contextual_connect()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 2192, in 
contextual_connect
Apr 26 00:00:06 host logrotate[12668]:     
self._wrap_pool_connect(self.pool.connect, None),
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 2232, in 
_wrap_pool_connect
Apr 26 00:00:06 host logrotate[12668]:     e, dialect, self
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1528, in 
_handle_dbapi_exception_noconnection
Apr 26 00:00:06 host logrotate[12668]:     
util.raise_from_cause(sqlalchemy_exception, exc_info)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 296, in 
raise_from_cause
Apr 26 00:00:06 host logrotate[12668]:     reraise(type(exception), exception, 
tb=exc_tb, cause=cause)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 276, in reraise
Apr 26 00:00:06 host logrotate[12668]:     raise value.with_traceback(tb)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 2228, in 
_wrap_pool_connect
Apr 26 00:00:06 host logrotate[12668]:     return fn()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 425, in connect
Apr 26 00:00:06 host logrotate[12668]:     return 
_ConnectionFairy._checkout(self)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 822, in _checkout
Apr 26 00:00:06 host logrotate[12668]:     fairy = 
_ConnectionRecord.checkout(pool)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 554, in checkout
Apr 26 00:00:06 host logrotate[12668]:     rec = pool._do_get()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 1250, in _do_get
Apr 26 00:00:06 host logrotate[12668]:     self._dec_overflow()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/util/langhelpers.py", line 67, in 
__exit__
Apr 26 00:00:06 host logrotate[12668]:     compat.reraise(exc_type, exc_value, 
exc_tb)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 277, in reraise
Apr 26 00:00:06 host logrotate[12668]:     raise value
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 1247, in _do_get
Apr 26 00:00:06 host logrotate[12668]:     return self._create_connection()
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 370, in 
_create_connection
Apr 26 00:00:06 host logrotate[12668]:     return _ConnectionRecord(self)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 499, in __init__
Apr 26 00:00:06 host logrotate[12668]:     
self.__connect(first_connect_check=True)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 701, in __connect
Apr 26 00:00:06 host logrotate[12668]:     connection = 
pool._invoke_creator(self)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/strategies.py", line 114, in 
connect
Apr 26 00:00:06 host logrotate[12668]:     return dialect.connect(*cargs, 
**cparams)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 437, in 
connect
Apr 26 00:00:06 host logrotate[12668]:     return self.dbapi.connect(*cargs, 
**cparams)
Apr 26 00:00:06 host logrotate[12668]:   File 
"/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 130, in connect
Apr 26 00:00:06 host logrotate[12668]:     conn = _connect(dsn, 
connection_factory=connection_factory, **kwasync)
Apr 26 00:00:06 host logrotate[12668]: sqlalchemy.exc.OperationalError: 
(psycopg2.OperationalError) FATAL:  role "root" does not exist
Apr 26 00:00:06 host logrotate[12668]:  (Background on this error at: 
http://sqlalche.me/e/e3q8)
Apr 26 00:00:06 host logrotate[12668]: error: error running non-shared 
postrotate script for /var/log/mailman3/mailman.log of 
'/var/log/mailman3/mailman.log '
Apr 26 00:00:06 host systemd[1]: logrotate.service: Main process exited, 
code=exited, status=1/FAILURE
Apr 26 00:00:06 host systemd[1]: logrotate.service: Failed with result 
'exit-code'.
Apr 26 00:00:06 host systemd[1]: Failed to start Rotate log files.

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: mailman3
Source-Version: 3.3.2-1
Done: Jonas Meurer <[email protected]>

We believe that the bug you reported is fixed in the latest version of
mailman3, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Meurer <[email protected]> (supplier of updated mailman3 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 03 Jan 2021 21:20:45 +0100
Source: mailman3
Architecture: source
Version: 3.3.2-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Mailman Team <[email protected]>
Changed-By: Jonas Meurer <[email protected]>
Closes: 958976 958977 960072 968371 968817 977935 978959
Changes:
 mailman3 (3.3.2-1) unstable; urgency=medium
 .
   [ Daniel Kahn Gillmor ]
   * d/mailman3.logrotate: use mailman-wrapper instead of mailman binary
     after logrotate's job. (Closes: #958977)
 .
   [ Pierre-Elliott Bécue ]
   * New upstream release 3.3.1. (Closes: #958976, #960072, #968371)
   * Update dependencies and patches for the new upstream release
 .
   [ Jonas Meurer ]
   * New upstream release 3.3.2. (Closes: #968817, #977935)
   * d/mailman3.cron.d: (Closes: #978959)
     - Fix cronjob for digests
     - Add cronjob for sending out pending moderation notifications
     - Add cronjob for gating messages from usenet to mailinglists
   * d/control:
     - Bump Standards-Version to 4.5.1
     - Remove versioned build-dependency on python3-falcon
     - Add build-dependency on python3-sphinx-rtd-theme
     - Add build-dependency on python3-importlib-resources
   * d/p/0002-remove_importlib_resources_dependency.patch: Remove, the Debian
     package now uses `importlib_resources` just like mailman3 upstream.
   * d/p/0003-remove_sphinxcontrib.zopeext_dependency.patch: New patch to
     remove build-dependency on `sphinxcontrib-zopeext`
   * d/p/0004-add_missing_sphinx_configplugin.patch: New patch to add the
     missing custom sphinx plugin `configplugin`
   * d/mailman3.lintian-overrides: Ignore warnings about testing files
   * d/p/0005-fix_template_permissions.patch: Fix permissions of italian
     template translation files.
   * d/mailman3.postinst: Replace deprecated `tempfile` with `mktemp`
Checksums-Sha1:
 7ca18174d100c633e24f039229b31bf8ce453dab 2939 mailman3_3.3.2-1.dsc
 b5a3a964abf770020b388a6b87394006c52493b9 1396750 mailman3_3.3.2.orig.tar.gz
 4cc95a8416324f78d705c6fe613b40c16f9bdc57 833 mailman3_3.3.2.orig.tar.gz.asc
 950907e90a86465f3ec21282f5d6db1aaf930918 28740 mailman3_3.3.2-1.debian.tar.xz
 1377b090956be8d22bae9780c624377728fc1b20 9580 mailman3_3.3.2-1_amd64.buildinfo
Checksums-Sha256:
 87f89228bc2da3e5c7cfd2c9137a5443ffa635fb8b8dffcce2924d1f3766c620 2939 
mailman3_3.3.2-1.dsc
 af01971a6abd9002211ced964c650066f6451ab8fa967b16127e3088dc9aac28 1396750 
mailman3_3.3.2.orig.tar.gz
 29d16aac3297aa145cfe822ea031d6ba8e530e97ff01c7a9a7a5a335d78707cd 833 
mailman3_3.3.2.orig.tar.gz.asc
 e701dd466e43097e43432f4e76014af0e2fc8dfc4a3e65acb56f8daa98559023 28740 
mailman3_3.3.2-1.debian.tar.xz
 b918c7e0a391913c45a5fc7d9718b24e35ef2cf4cbc8c41308bd11a4da0fb760 9580 
mailman3_3.3.2-1_amd64.buildinfo
Files:
 9044ffb2d2f30f5ff22d47b73a4baadc 2939 mail optional mailman3_3.3.2-1.dsc
 3ccf891602708c9b9ad4d58ea9213f9d 1396750 mail optional 
mailman3_3.3.2.orig.tar.gz
 a7f6c4068c48c1b52c141ed747e5b759 833 mail optional 
mailman3_3.3.2.orig.tar.gz.asc
 9d0e7b80d99440f7e28e7f1e8fe26ea1 28740 mail optional 
mailman3_3.3.2-1.debian.tar.xz
 da8837a024a7b42065fc4e02447e9484 9580 mail optional 
mailman3_3.3.2-1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEELIzSg9Pv30M4kOeDUmLn/0kQSf4FAl//b4wACgkQUmLn/0kQ
Sf6wQhAAhD9LsdBvJp3QqSRz2vsZsOTzQ8TmQKLValPBjThhELArJTqxVvXOiPFz
apYlGGjtEQfw5S/TjF3bPxS7etEgB4BPItip+ebymX2XxsbTuEryKMdyIfBrGzeC
EnEv6Sv+A/kFJGF98LunZ8IgQMoGjPtB1DWXLGGhUZ6mjrEwi/VrxBfM7xghGAc9
sWrWurvN1J64IGDiFB0ZHUqMtkLuXiazDVTumKGShAPUO+DvhHVzcioapFM91Fck
8IZJJXKIfDkSp3xhRMVT89UzMNyJS6HIPTElK67VysG4pT8USVivoVeO2wr1Ys+Z
kmvRYvWBjAaR/68naDMF7bH8NNrmRgVLO9gdo7QwYOqelLyR3a+EkdIRqfrID8go
gTMeGsg9zwpBmOmPlD0HZqyalpdWsChwDXxKVZTefo+Yf5EiwX+mECy9Wb2mouu8
mwhlhuEMP9DAKEPPTUBeq0t1krSOoLIfHxwW/E1Lv+1HAi49Xk4p187lQPX5GN4f
70V6FFMffKRUYojneAYT1R2J/L0yU0VIwsjRwW5YMFXRmPMOeRCaIN1HkwhK1gHO
4+vjnKP84YrZF08hYaNjfi2SNCUxJN8pT9lUQpkUPSh5zEgyf+sfVWTU8D3AnEVb
4RzVD2dK+at0QWYa6pO9DLdwTUfxNG6MBLFiHgDxscrJmAJIReg=
=xJtG
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to