conda "CondaHTTPError: HTTP 000 / failed to fetch" in CI
conda could not download a channel’s repodata.json or a package, reporting a CondaHTTPError. These are usually transient network failures - a blip, a slow mirror, or a proxy - and frequently succeed on retry.
What this error means
A conda install/env create fails fetching channel metadata or a package with CondaHTTPError: HTTP 000 CONNECTION FAILED (or a 5xx). Re-running the job often works with no change, the hallmark of a transient network issue.
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
<https://conda.anaconda.org/conda-forge/linux-64/repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.Common causes
Transient connectivity or mirror slowness
A brief network drop or an overloaded channel mirror times out the fetch. Nothing is wrong with the environment spec.
A proxy or firewall in the path
A corporate proxy or egress restriction intermittently blocks conda.anaconda.org, surfacing as a connection failure rather than a clean error.
How to fix it
Raise remote retries and timeouts, then re-run
conda config --set remote_max_retries 5
conda config --set remote_connect_timeout_secs 30
conda config --set remote_read_timeout_secs 120
conda install -c conda-forge numpyConfigure the proxy if egress is restricted
When the runner must go through a proxy, set the proxy env vars so conda can reach the channel.
export HTTPS_PROXY=http://proxy.internal:3128
export HTTP_PROXY=http://proxy.internal:3128
conda env create -f environment.ymlCache the package cache to reduce fetches
- Cache
~/conda_pkgs_dir(or the configured pkgs dir) keyed onenvironment.yml. - Point conda at an internal channel mirror for high-volume pipelines.
- Pin the environment so the fetch set is stable and cacheable.
How to prevent it
- Set conda remote retries/timeouts for resilience in CI.
- Cache the conda package cache keyed on the environment file.
- Use an internal channel mirror to reduce public-network dependence.