You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched open reports and couldn't find a duplicate
What happened?
rattler version:rattler_networking on main @ e4ed482, reproduced through pixi 0.72.2
I'm trying to point pixi at an Amazon ECR pull-through cache of ghcr.io/channel-mirrors/conda-forge, so conda packages can be managed via a pull-through cache we already use for container images:
Two things in crates/rattler_networking/src/oci_middleware.rs rule this out.
1. The token exchange is unconditional, and ECR has no token endpoint. get_blob_url always fetches https://{host}/token?scope=… and fails hard on error. ECR
doesn't serve /token, and its challenge is Basic only:
Credentials don't help, because OciMiddleware never reads the authentication storage — a RATTLER_AUTH_FILE entry for the registry host is ignored:
$ RATTLER_AUTH_FILE=ecr-auth.json pixi installError: × failed to solve requirements of environment 'default' for platform 'linux-64' ├─▶ × Reqwest error: HTTP status client error (401 Unauthorized) for url │ │ (https://<acct>.dkr.ecr.<region>.amazonaws.com/token?scope=repository: │ │ cache/ghcr/channel-mirrors/conda-forge/noarch/repodata.json:pull)
2. The digest shortcut never triggers the cache import.
When repodata supplies the sha256 (X-Expected-Sha256), get_blob_url addresses the blob directly and skips the manifest. An ECR pull-through cache imports an upstream artifact only when its manifest is pulled, so the first request for every package is a 404 NAME_UNKNOWN, and nothing ever triggers the import that would fix it. An ordinary OCI client can't hit this — it has to read the manifest to learn a digest at all; rattler is unusual in knowing it up front.
The registry side is fine once both are worked around by hand: ECR accepts the conda media types, a manifest pull imports the artifact, and the blob then serves the .conda
byte-for-byte, sha256 matching pixi.lock.
Proposed fix
I have a working patch confined to oci_middleware.rs and would like to open a PR - but there are some design de
Resolve credentials for the registry host from AuthenticationStorage and skip the token exchange when they exist. Registries without stored credentials keep the anonymous path, and new keeps its signature, so nothing changes downstream. A fuller fix would follow the registry's WWW-Authenticate challenge instead of assuming /token — happy to go either way.
When a digest-addressed blob comes back 404, resolve through the manifest and retry once. Costs one extra round trip only on a miss. This is the design call I'd like an opinion on before a PR.
Checklist
What happened?
rattler version:
rattler_networkingonmain@e4ed482, reproduced through pixi 0.72.2I'm trying to point pixi at an Amazon ECR pull-through cache of
ghcr.io/channel-mirrors/conda-forge, so conda packages can be managed via a pull-through cache we already use for container images:Two things in
crates/rattler_networking/src/oci_middleware.rsrule this out.1. The token exchange is unconditional, and ECR has no token endpoint.
get_blob_urlalways fetcheshttps://{host}/token?scope=…and fails hard on error. ECRdoesn't serve
/token, and its challenge isBasiconly:Credentials don't help, because
OciMiddlewarenever reads the authentication storage — aRATTLER_AUTH_FILEentry for the registry host is ignored:2. The digest shortcut never triggers the cache import.
When repodata supplies the sha256 (
X-Expected-Sha256),get_blob_urladdresses the blob directly and skips the manifest. An ECR pull-through cache imports an upstream artifact only when its manifest is pulled, so the first request for every package is a404 NAME_UNKNOWN, and nothing ever triggers the import that would fix it. An ordinary OCI client can't hit this — it has to read the manifest to learn a digest at all; rattler is unusual in knowing it up front.The registry side is fine once both are worked around by hand: ECR accepts the conda media types, a manifest pull imports the artifact, and the blob then serves the
.condabyte-for-byte, sha256 matching
pixi.lock.Proposed fix
I have a working patch confined to
oci_middleware.rsand would like to open a PR - but there are some design deAuthenticationStorageand skip the token exchange when they exist. Registries without stored credentials keep the anonymous path, andnewkeeps its signature, so nothing changes downstream. A fuller fix would follow the registry'sWWW-Authenticatechallenge instead of assuming/token— happy to go either way.main).AI Disclosure
This issue report was generated with AI and edited by me.