Skip to content

What to do about the user agent?ย #2201

@chrisburr

Description

@chrisburr

This is prompted by #general > rattler-build is getting 403 but can curl source file @ ๐Ÿ’ฌ

I have no idea what the right way of handling this is. rattler-build should definitely be setting a application specific user agent but that wouldn't actually work in this case. This least bad working option I can come up with for this server is:

$ curl -sI -A "rattler-build/0.57.2 (compatible; conda; python-requests/2.32) reqwest/0.12" https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz
HTTP/2 200
date: Mon, 23 Feb 2026 05:11:18 GMT
content-type: application/x-gzip
content-length: 17056067
server: cloudflare

I have no idea if this is a one-off bad server config or if it could be more widespread. Maybe @matthewfeickert knows if it's practical to contact Argonne to fix thier cloudflare config?

rattler-build attempt

`recipe.yaml`
schema_version: 1

package:
  name: test-download
  version: "0.1.0"

source:
  url: https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz
  sha256: 8d24a38619eb9fd326c7bdf9fdb01466149a0ab7dc3ef1caffda728858bf5a85

build:
  script:
    - echo "Works" >> $PREFIX/test-download.txt
$ rattler-build build --recipe recipe.yaml

 โ•ญโ”€ Finding outputs from recipe
 โ”‚ Found 1 variants
 โ”‚
 โ”‚ Build variant: test-download-0.1.0-hb0f4dca_0
 โ”‚
 โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
 โ”‚ โ”‚ Variant         โ”† Version    โ”‚
 โ”‚ โ•žโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ก
 โ”‚ โ”‚ target_platform โ”† "linux-64" โ”‚
 โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
 โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ (took 0 seconds)

 โ•ญโ”€ Running build for recipe: test-download-0.1.0-hb0f4dca_0
 โ”‚
 โ”‚ โ•ญโ”€ Fetching source code
 โ”‚ โ”‚ Fetching source from url: https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz
 โ”‚ โ”‚
 โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ (took 1 second)
 โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ (took 1 second)
Error:   ร— Failed to download source from url: HTTP status client error (403 Forbidden) for url (https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz)
  โ•ฐโ”€โ–ถ HTTP status client error (403 Forbidden) for url (https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz)

curl with default User-Agent

$ curl -sI https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz | head -3
HTTP/2 200
date: Mon, 23 Feb 2026 05:01:11 GMT
content-type: application/x-gzip

User-Agent comparison

Each test runs: curl -sI -A "..." https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz

  • โŒ `` (403)
  • โŒ reqwest (403)
  • โŒ rattler-build/0.57.2 (403)
  • โŒ wget/1.21 (403)
  • โŒ Mozilla/5.0 (403)
  • โœ… curl/8.0.0
  • โœ… python-requests/2.32.5
  • โœ… CPython/3.12.12
  • โœ… CPython/99.0.0
  • โŒ conda/25.11.1 requests/2.32.5 (403)
  • โœ… conda/25.11.1 requests/2.32.5 CPython/3.12.12
  • โœ… conda/25.11.1 requests/2.32.5 CPython/3.12.12 Linux/5.14.0-611.26.1.el9_7.x86_64 rhel/9.7 glibc/2.34 solver/libmamba conda-libmamba-solver/25.11.0 libmambapy/2.5.0
  • โœ… rattler-build/0.57.2 python-requests/2.32.5
  • โœ… rattler-build/0.57.2 CPython/3.12.12

403 response is a Cloudflare managed challenge

$ curl -s -A "reqwest" https://web.cels.anl.gov/projects/sigma/downloads/moab/moab-5.6.0.tar.gz | grep -oE "(cdn-cgi/challenge-platform|cType: .managed.|Just a moment)"
Just a moment
cType: 'managed'
cdn-cgi/challenge-platform

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions