AttributeError: ,> 'ReopenableFileHandler' object has no attribute '_stream'
((reposting with correct subject line -- sorry!))
Greetings. I am attempting a complete Mailman 3 installation on a Debian 10 system that already runs Mailman 2, following this documentation:
https://docs.mailman3.org/en/latest/install/virtualenv.html
Even following this guide, I'd had a lot of issues with permissions, where directories and files were owned by list rather than mailman. After correcting those issues, I then got to the point of checking mailman3's status, and systemctl shows this error:
Nov 19 20:09:57 [REDACTED] mailman[1463]: Error in atexit._run_exitfuncs: Nov 19 20:09:57 [REDACTED] mailman[1463]: Traceback (most recent call last): Nov 19 20:09:57 [REDACTED] mailman[1463]: File "/usr/lib/python3.7/logging/__init__.py", line 2038, in shutdown Nov 19 20:09:57 [REDACTED] mailman[1463]: h.flush() Nov 19 20:09:57 [REDACTED] mailman[1463]: File "/opt/mailman/venv/lib/python3.7/site-packages/mailman/core/logging.py", line 67, in flush Nov 19 20:09:57 [REDACTED] mailman[1463]: if self._stream: Nov 19 20:09:57 [REDACTED] mailman[1463]: AttributeError: 'ReopenableFileHandler' object has no attribute '_stream'
There is an October 2019 thread on this error [1] but I think it's in a different context, where the OP already had mailman3 running, and was trying to migrate Mailman 2 lists.
Also, regarding those permissions issues above, it matters which "layout" value is in /etc/mailman3/mailman.cfg. I'd tried "dev" because I saw a post from Mark Sapiro recommending that, but then mailman3 wanted me to create a bunch of directories under /etc, even though $var_dir was set to /var/lib/mailman3. Things seem to go better, except for the confusion between lists/mailman ownership, when I set layout to "debian", which was the default.
Thanks in advance for clues on addressing the ReopenableFileHandler error above.
dn
[1] https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/7...
On 11/19/21 9:43 PM, David Newman wrote:
((reposting with correct subject line -- sorry!))
Actually, the original Subject was probably closer to the problem.
Greetings. I am attempting a complete Mailman 3 installation on a Debian 10 system that already runs Mailman 2, following this documentation:
https://docs.mailman3.org/en/latest/install/virtualenv.html
Even following this guide, I'd had a lot of issues with permissions, where directories and files were owned by list rather than mailman. After correcting those issues, I then got to the point of checking mailman3's status, and systemctl shows this error:
Nov 19 20:09:57 [REDACTED] mailman[1463]: Error in atexit._run_exitfuncs: Nov 19 20:09:57 [REDACTED] mailman[1463]: Traceback (most recent call last): Nov 19 20:09:57 [REDACTED] mailman[1463]: File "/usr/lib/python3.7/logging/__init__.py", line 2038, in shutdown Nov 19 20:09:57 [REDACTED] mailman[1463]: h.flush() Nov 19 20:09:57 [REDACTED] mailman[1463]: File "/opt/mailman/venv/lib/python3.7/site-packages/mailman/core/logging.py", line 67, in flush Nov 19 20:09:57 [REDACTED] mailman[1463]: if self._stream: Nov 19 20:09:57 [REDACTED] mailman[1463]: AttributeError: 'ReopenableFileHandler' object has no attribute '_stream'
These generally stem from permissions errors preventing opening the log file.
There is an October 2019 thread on this error [1] but I think it's in a different context, where the OP already had mailman3 running, and was trying to migrate Mailman 2 lists.
Also, regarding those permissions issues above, it matters which "layout" value is in /etc/mailman3/mailman.cfg. I'd tried "dev" because I saw a post from Mark Sapiro recommending that,
I don't know in what context I recommended that. In my installs I use
layout: here
and in [paths.here] I specify an absolute path for var_dir.
but then mailman3 wanted me to create a bunch of directories under /etc, even though $var_dir was set to /var/lib/mailman3. Things seem to go better, except for the confusion between lists/mailman ownership, when I set layout to "debian", which was the default.
It seems you may be using the Debian packages as our source has no
debian
layout. I.e., if you are installing with pip in a virtualenv,
there would be no debian
layout. If you are using Debian packages the
Mailman user is list
not mailman
.
Thanks in advance for clues on addressing the ReopenableFileHandler error above.
Fix the underlying permissions error.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 11/19/21 10:04 PM, Mark Sapiro wrote:
but then mailman3 wanted me to create a bunch of directories under /etc, even though $var_dir was set to /var/lib/mailman3. Things seem to go better, except for the confusion between lists/mailman ownership, when I set layout to "debian", which was the default.
It seems you may be using the Debian packages as our source has no
debian
layout.
Thank you for spotting that. I'd cloned a test server from a production machine that did have the Debian mailman3 package installed, something I should have checked first.
The rest of the installation went OK. I'm using MariaDB and not Postgres, and that required a few deviations from the Virtualenv Installation documentation, but those tweaks things went OK from there.
I have a follow-up question about post-installation setup but will start a new thread for that. Thanks again!
dn
participants (2)
-
David Newman
-
Mark Sapiro