-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BR]: Fails to build with Python 3.12 - ModuleNotFoundError: No module named 'asynchat' #3487
Comments
Python 3.12 is hitting Fedora Rawhide now, so this would be nice to get address soon if possible. |
Thanks Orion. |
Related #2690 |
So the migration to 3.x is fulfilled (#2690 is closed) now... |
Where do I got the version ported to 3.12? I just grabbed from github and it is still failing with failure to find module asynchat. |
Nowhere at the moment. As you can see the issue is still open. |
My apologies, I should wake-up before I attempt to read this stuff. |
Since this is still preventing me from building in Fedora Rawhide I thought I'd ask. Is the module used for all tests or just some? If only some, I could disable those tests? |
Nope! This is one of main modules of fil2ban-server (also used for communication between client and server). |
Would it make sense to (at least temporarily) use pyasynchat and pyasyncore on Python 3.12+? The imports should remain compatible, so it boils down to declaring a dependency on them with an environment marker, e.g.:
|
Note that even with that resolved there's another issue - tests/action_d/test_smtp.py uses |
As for Regarding pyasynchat and pyasyncore, I'm still unsure:
|
I don't think the smtpd removal affects any 'real' code - it's just the test case that uses it, as a way to check the smtp actions are doing what they should. So I think the actions should keep working fine (unless something breaks them and we don't notice because the test doesn't work :>), it's just the test case that can't work. |
This test covers However another worse thing would be - disabling that test will decrease coverage for usage of pythonic actions under real circumstances (it was sole stock pythonic action tested completely), so we'd need either another pythonic (dummy-)action or another SMTP server for test. |
ah, yeah, that sucks. but yes, theoretically at least, the action should still work. it doesn't use It's just the test case that uses the server-y |
I installed pyasynchat from https://github.com/simonrob/pyasynchat and pyasyncore from https://github.com/simonrob/pyasyncore . This is a temporary method until a fail2ban will be rebased on asyncio (https://docs.python.org/3/library/asyncio.html). I don't use smtpd module. fail2ban works for me with python 3.12 on Gentoo linux fine. |
OK, there is new branch python-3.12--asyncore that actually works with 3.12 in CI of GHA. But:
|
The issue with setuptools is fixed now (it should be installed for python version used to test, whereas apt seems to install it for stock python version). Anyway it works now. This can be closed (and get a TODO "rewrite f2b to asyncio"), but... @fail2ban/maintainers, @opoplawski, @sylvestre what should we do with asynchat and asyncore now? Please vote in following 2 comments, 👍 (in favor), 👎 (against) and 👀 (abstain). |
Variant I:we will use pyasynchat and pyasyncore packages provided by pip, distro packet-manager, etc |
Variant II:we shall add copies of asynchat and asyncore as local modules of fail2ban (libraries get bundled in fail2ban) |
Hopefully I interpreted things correctly but in the case of Fedora, internet access is not allowed during the build process. We would just need the two libraries bundled in fail2ban. Additionally we're almost to the point of having Python 3.13 in Rawhide and I'm not sure if that causes any additional issues or not... |
Well, one doesn't need them during build process. Variant I means that fail2ban package should get a dependency to pip- or distro- or whatever else package. No idea what exactly is possible and which packages are available in distros (I'm not maintainer).
Then you'd vote for Variant II. |
Yes it caused few compat issues (deprecated removals only)... |
awesome, thanks a lot! |
Hope this makes it inside 24.04 Soon |
wiki :: Manual installation of debian upstream-package released here... |
We do server management and use tools like Ansible. Doing manual installation on 1000's of servers is more of a headache and needs custom scripts to keep it updated. So hope Ubuntu finds this asap and uses a later version Thanks for help and prompt response |
Im still getting No module named 'asynchat' when trying 1.1.0-1 upstream-package. What am i doing wrong? Running Ubuntu 24.04-rpi5. Edit: I tried installing pyasynchat, didn't solve it |
I'm not sure how, but i think i solved it by uninstalling f2b, re-installing 1.0.2 via apt, stopping the service and client, finally installing 1.1.0-1 over it. |
I can only recommend everybody who is affected to vote the bugreport |
Here is how to fix the problem
|
It really depends, whether whether this fixes the issue or not. At least for me, as a user of Plesk, some jails won't work anymore. Instead, installing the pyasynchat extension with pip actually fixes the issue. At least Plesk's fail2ban integration keeps working which is broken by installing the newer version from launchpad. |
At this point it sounds like maybe there's a downstream issue - Ubuntu and/or Debian maybe did not introduce a package dependency on the split-out asynchat/asyncore libraries when they packaged the new release. It might be better to report that to Debian/Ubuntu package maintainers? At least looking at https://packages.debian.org/sid/fail2ban , it doesn't look like any dependency on asynchat/asyncore is listed there. @sylvestre seems to be the Debian maintainer - did you miss this new dep, or am I misreading the Debian metadata? |
Will the fix that comes along be able to solve our problems? Or, will it require a reinstall? |
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Reason - is error in ubuntu 24.04 "ERROR No module named 'asynchat'" fail2ban/fail2ban#3487
Well, there may be still an issue with Possible solution:
|
…at folder (pyinotify module may have dependency to asyncore module, see fail2ban#3487 (comment)); amend to 054e1d8
Related to CI it seems to be alright now (so 304c3cd ultimately closes this). |
It Worked in Ubuntu 24.x. THanks |
Environment:
The issue:
fail2ban fails to build with Python 3.12.0a5.
asynchat and asyncore have been removed according to the schedule in PEP 594,
having been deprecated in Python 3.6. Use asyncio instead. (Contributed by
Nikita Sobolev in gh-96580.)
python/cpython#96580
https://docs.python.org/3.12/whatsnew/3.12.html
For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05573413-fail2ban/
For all our attempts to build fail2ban with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/fail2ban/
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.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/
Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=2176186
The text was updated successfully, but these errors were encountered: