Skip to content

Network errors during wheel cache lookup are silently swallowed in _download_wheel_from_cache() #1025

@LalatenduMohanty

Description

@LalatenduMohanty

Summary

In bootstrapper.py:1054-1058, a bare except Exception catches all errors during wheel cache lookup — including network timeouts, DNS failures, and auth errors — and treats them identically to "wheel not found", silently falling through to an expensive source build.

Problem

# bootstrapper.py lines 1054-1058
except Exception:
    logger.info(
        f"did not find wheel for {resolved_version} in {self.cache_wheel_server_url}"
    )
    return None, None

The entire _download_wheel_from_cache() method (lines 1008-1058) is wrapped in a single try/except. This catches:

  • requests.ConnectionError (DNS failure, refused connection)
  • requests.Timeout (server not responding)
  • requests.HTTPError (401 Unauthorized, 403 Forbidden)
  • Any other unexpected exception

All are logged at INFO level with a misleading "did not find wheel" message and return (None, None) — the same result as a genuinely missing wheel. The caller then proceeds to build from source.

Testing suggestions

  • Verify that legitimate "not found" errors (e.g. ResolverException) are still handled gracefully and return (None, None).

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions