Failure on emitters with - Address family not supported by protocol
Closed this issue · 3 comments
Hi Team,
I do have configured dnf-automatic, with installation and notification. Installation works fine according to the log below. However emitters is getting called which is configured for "emit_via = stdio,email,motd".
dnf-automatic is pulling the error "OSError: [Errno 97] Address family not supported by protocol" , as you can see from below. The issue is clear, as my host has not IPv6 enabled and therefore the issue is happening.
What would be the solution to make it work? from my perspective dnf-automatic must honor the systems capabilities, which are in this case IPv4 only.
Any help is appreciated
`Oct 03 06:51:49 server-n3 dnf-automatic[633315]: systemd x86_64 252-32.el9_4.7 baseos 4.0 M
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: systemd-libs x86_64 252-32.el9_4.7 baseos 672 k
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: systemd-pam x86_64 252-32.el9_4.7 baseos 280 k
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: systemd-rpm-macros noarch 252-32.el9_4.7 baseos 69 k
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: systemd-udev x86_64 252-32.el9_4.7 baseos 1.8 M
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: tar x86_64 2:1.34-6.el9_4.1 baseos 876 k
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: wget x86_64 1.21.1-8.el9_4 appstream 768 k
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: Installing dependencies:
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: kernel-core x86_64 5.14.0-427.37.1.el9_4 baseos 20 M
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: kernel-modules x86_64 5.14.0-427.37.1.el9_4 baseos 38 M
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: kernel-modules-core x86_64 5.14.0-427.37.1.el9_4 baseos 32 M
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: Transaction Summary
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: ================================================================================
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: Install 4 Packages
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: Upgrade 72 Packages
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: Updates completed at Thu Oct 3 06:51:46 2024
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: Traceback (most recent call last):
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/bin/dnf-automatic", line 36, in
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: sys.exit(dnf.automatic.main.main(sys.argv[1:]))
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib/python3.9/site-packages/dnf/automatic/main.py", line 362, in main
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: emitters.commit()
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib/python3.9/site-packages/dnf/util.py", line 526, in fn
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: return list(map(call_what, self))
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib/python3.9/site-packages/dnf/util.py", line 525, in call_what
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: return method(*args, **kwargs)
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib/python3.9/site-packages/dnf/automatic/emitter.py", line 106, in commit
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: smtp = smtplib.SMTP(self._conf.email_host, timeout=300)
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib64/python3.9/smtplib.py", line 255, in init
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: (code, msg) = self.connect(host, port)
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib64/python3.9/smtplib.py", line 341, in connect
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: self.sock = self._get_socket(host, port, self.timeout)
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib64/python3.9/smtplib.py", line 312, in _get_socket
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: return socket.create_connection((host, port), timeout,
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib64/python3.9/socket.py", line 844, in create_connection
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: raise err
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib64/python3.9/socket.py", line 827, in create_connection
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: sock = socket(af, socktype, proto)
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: File "/usr/lib64/python3.9/socket.py", line 232, in init
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: _socket.socket.init(self, family, type, proto, fileno)
Oct 03 06:51:49 server-n3 dnf-automatic[633315]: OSError: [Errno 97] Address family not supported by protocol
Oct 03 06:51:49 server-n3 systemd[1]: dnf-automatic.service: Main process exited, code=exited, status=1/FAILURE
`
Sorry forget to mention the version:
dnf-automatic: 4.14.0-9
The error is from SMTP class of Python 3.9 smtplib library. It probably does not try all IP addresses associated with the host name and instead returns first met error. You will need to ask for a help a supplier of your Python.
You should be able to reproduce the error without DNF:
python3 -c 'import smtplib; smtplib.SMTP("your.host.you.did.reveal")'