NixOS/nix

feat: substituter: show redirect destination on failure

Open

#9998 aperta il 12 feb 2024

Vedi su GitHub
 (0 commenti) (1 reazione) (1 assegnatario)C++ (1293 fork)batch import
error-messagesfeaturefetchinggood first issue

Metriche repository

Star
 (9803 star)
Metriche merge PR
 (Merge medio 4g 12h) (86 PR mergiate in 30 g)

Descrizione

Is your feature request related to a problem? Please describe.

I have a badly configured binary cache that is emitting an http 307.

The error is confusing because it doesn't show the redirect target url.

$ nix build -j0 "${REDACT}#output"
warning: error: unable to download 'https://redact.tar.gz': HTTP error 307 (curl error: Couldn't connect to server); retrying in 303 ms
warning: error: unable to download 'https://redact.tar.gz': HTTP error 307 (curl error: Couldn't connect to server); retrying in 617 ms
warning: error: unable to download 'https://redact.tar.gz': HTTP error 307 (curl error: Couldn't connect to server); retrying in 1388 ms
warning: error: unable to download 'https://redact.tar.gz': HTTP error 307 (curl error: Couldn't connect to server); retrying in 2044 ms
error:
       … while fetching the input 'https://redact.tar.gz'
       error: unable to download 'https://redact.tar.gz': HTTP error 307 (curl error: Couldn't connect to server)

In this case, "redact.tar.gz" is returning the 307 properly, and fine, but whatever server it's redirecting to isn't working.

Further, in this case, there are multiple redirects that curl is showing me, finally bottoming out on a host that is expectedly unreachable. But it's not shown in the error at all.

Describe the solution you'd like

Please show the redirect target URL in the error.

Describe alternatives you've considered n/a

Additional context n/a

Priorities

Add :+1: to issues you find important.

Guida contributor