Bug 2017933

Summary: python-eventlet cannot be imported without DNS resolver configuration
Product: [Fedora] Fedora Reporter: Ben Beasley <code>
Component: python-eventletAssignee: Kevin Fenzi <kevin>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: apevec, dtantsur, igor.raits, kevin, shamardin, temotor
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-01 16:01:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Beasley 2021-10-27 18:21:35 UTC
Description of problem:

When no DNS resolver is configured, such as in the RPM mock build environment, the “eventlet” package does not even import successfully.

Version-Release number of selected component (if applicable): 0.32.0-2.fc36


How reproducible:


Steps to Reproduce:
1. $ mock -r fedora-rawhide-x86_64 --clean
2. $ mock -r fedora-rawhide-x86_64 -i python3-eventlet
3. $ mock -r fedora-rawhide-x86_64 --shell
4. <mock-chroot> sh-5.1# python3 -c 'import eventlet'

Actual results:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/eventlet/__init__.py", line 17, in <module>
    from eventlet import convenience
  File "/usr/lib/python3.10/site-packages/eventlet/convenience.py", line 7, in <module>
    from eventlet.green import socket
  File "/usr/lib/python3.10/site-packages/eventlet/green/socket.py", line 21, in <module>
    from eventlet.support import greendns
  File "/usr/lib/python3.10/site-packages/eventlet/support/greendns.py", line 411, in <module>
    resolver = ResolverProxy(hosts_resolver=HostsResolver())
  File "/usr/lib/python3.10/site-packages/eventlet/support/greendns.py", line 325, in __init__
    self.clear()
  File "/usr/lib/python3.10/site-packages/eventlet/support/greendns.py", line 328, in clear
    self._resolver = dns.resolver.Resolver(filename=self._filename)
  File "/usr/lib/python3.10/site-packages/dns/resolver.py", line 734, in __init__
    self.read_resolv_conf(filename)
  File "/usr/lib/python3.10/site-packages/dns/resolver.py", line 826, in read_resolv_conf
    raise NoResolverConfiguration
dns.resolver.NoResolverConfiguration: Resolver configuration could not be read or specified no nameservers.


Expected results:

(no output)

Additional info:

This works fine in python-eventlet-0.31.1-1.fc35 and earlier. The change breaks any Fedora package that uses eventlet in its tests. One example is python-engineio.

Comment 2 Ben Beasley 2021-11-06 21:03:31 UTC
From that upstream issue, I found that

> export EVENTLET_NO_GREENDNS=yes

is a workaround for testing python-engineio.

Comment 3 Dmitry Tantsur 2021-11-08 12:21:05 UTC
Not limited to Fedora, affects pip installations just as well.

Comment 4 Sergey Shepelev 2021-11-16 20:13:00 UTC
Fix by @dtantsur released in 0.33.0. This is opposite of single patch release, contains few big changes.

Comment 5 Dmitry Tantsur 2021-11-17 11:02:32 UTC
Not sure why needinfo on me? I'm not an eventlet maintainer, just provided a fix for the problem that broke us.

Comment 6 Sergey Shepelev 2021-11-17 12:59:55 UTC
Sorry, I don't know this software, it did set flag automatically with @mention.

Comment 7 Ben Cotton 2022-02-08 21:27:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 8 Ben Beasley 2022-05-01 16:01:32 UTC
(In reply to Sergey Shepelev from comment #4)
> Fix by @dtantsur released in 0.33.0. This is opposite of single
> patch release, contains few big changes.

I can confirm this fixes the issue in F36+.