Skip to content

feat: substituter: show redirect destination on failure #9998

Open
@colemickens

Description

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 👍 to issues you find important.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

error-messagesConfusing messages and better diagnosticsfeatureFeature request or proposalfetchingNetworking with the outside (non-Nix) world, input locking

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions