Bug 1900668 - mailman3 fails to build with Python 3.10: OSError: [Errno 9] Bad file descriptor
Summary: mailman3 fails to build with Python 3.10: OSError: [Errno 9] Bad file descri...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mailman3
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1960659 (view as bug list)
Depends On: 1948945 1968971 1968996
Blocks: F35FTBFS F35FailsToInstall F36FTBFS PYTHON3.10 F35BetaFreezeException
TreeView+ depends on / blocked
 
Reported: 2020-11-23 13:56 UTC by Tomáš Hrnčiar
Modified: 2021-09-24 20:32 UTC (History)
5 users (show)

Fixed In Version: mailman3-3.3.4-5.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-24 20:32:48 UTC
Type: Bug


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-11-23 13:56:26 UTC
mailman3 fails to build with Python 3.10.0a2.

(mailman.mta.tests.test_connection.TestSTARTTLSConnectionCount) ... ERROR:asyncio:Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f51e0684fd0>
transport: <_SelectorSocketTransport closing fd=31>
Traceback (most recent call last):
  File "/usr/lib64/python3.10/asyncio/selector_events.py", line 918, in write
    n = self._sock.send(data)
OSError: [Errno 9] Bad file descriptor

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01782955-mailman3/

For all our attempts to build mailman3 with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/mailman3/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2021-02-09 15:27:15 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Miro Hrončok 2021-06-04 20:14:40 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 3 Miro Hrončok 2021-06-07 22:59:16 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 4 Fedora Admin user for bugzilla script actions 2021-07-14 14:56:28 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 5 Miro Hrončok 2021-07-27 09:07:24 UTC
*** Bug 1960659 has been marked as a duplicate of this bug. ***

Comment 6 Fedora Release Engineering 2021-08-01 04:22:27 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 35.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-01-18).

A week before the mass branching of Fedora 36 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 34 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-36/f-36-key-tasks.html

Comment 7 Neal Gompa 2021-08-02 12:16:42 UTC
Blocked on aiosmtpd...

Comment 8 Ben Cotton 2021-08-10 12:49:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 9 Miro Hrončok 2021-09-23 13:51:18 UTC
There are currently 2 test errors/failures:

======================================================================
ERROR: LayerSuite
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mailman-3.3.4/src/mailman/testing/layers.py", line 297, in setUp
    cls.smtpd.start()
  File "/builddir/build/BUILD/mailman-3.3.4/src/mailman/testing/mta.py", line 177, in start
    super().start()
  File "/usr/lib/python3.10/site-packages/aiosmtpd/controller.py", line 288, in start
    self._trigger_server()
  File "/usr/lib/python3.10/site-packages/aiosmtpd/controller.py", line 481, in _trigger_server
    InetMixin._trigger_server(self)
  File "/usr/lib/python3.10/site-packages/aiosmtpd/controller.py", line 428, in _trigger_server
    s = stk.enter_context(self.ssl_context.wrap_socket(s))
  File "/usr/lib64/python3.10/ssl.py", line 512, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib64/python3.10/ssl.py", line 1061, in _create
    self._sslobj = self._context._wrap_socket(
ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:801)
======================================================================
FAIL: test_interact_default_banner (mailman.utilities.tests.test_interact.TestInteract)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mailman-3.3.4/src/mailman/utilities/tests/test_interact.py", line 71, in test_interact_default_banner
    self.assertEqual(stderr[0], banner.splitlines()[0])
AssertionError: 'Pyth[34 chars], 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux' != 'Pyth[34 chars], 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux '
- Python 3.10.0rc1 (default, Aug  3 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux
+ Python 3.10.0rc1 (default, Aug  3 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux 
?                                                                                                    +
----------------------------------------------------------------------
Ran 2009 tests in 169.016s



The test_interact_default_banner failure is just a missing space. I have no idea if that is severe, bu adapting the test not to expect the space at the end is trivial:


    def test_interact_default_banner(self):
        self._enter(hackenv('PYTHONSTARTUP', None))
        interact()
        stderr = self._stderr.getvalue().splitlines()
        banner = 'Python {} on {} '.format(sys.version, sys.platform)     #  <--- remove the trailing space here
        self.assertEqual(stderr[0], banner.splitlines()[0])



The SSLError is actually a problem in aiosmtpd. Is seems to try to wrap a client socket in a server context. No idea what for, but adding a check not to do that into /usr/lib/python3.10/site-packages/aiosmtpd/controller.py like this:

    def _trigger_server(self):
        ...
        with ExitStack() as stk:
            s = stk.enter_context(create_connection((hostname, self.port), 1.0))
            if self.ssl_context and self.ssl_context.protocol != ssl.PROTOCOL_TLS_SERVER:  # <-- added the second part of this conditonal
                s = stk.enter_context(self.ssl_context.wrap_socket(s))
            s.recv(1024)

Makes the tests pass.

Comment 10 Fedora Update System 2021-09-23 15:07:45 UTC
FEDORA-2021-1eb02fcffb has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-1eb02fcffb

Comment 11 Miro Hrončok 2021-09-24 12:40:32 UTC
Hello,

Please note that this comment was generated automatically. If you feel that this output has mistakes, please contact me via email (mhroncok).

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 36.

Thanks for taking care of it!

Comment 12 Fedora Update System 2021-09-24 20:32:48 UTC
FEDORA-2021-1eb02fcffb has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.