NixOS/nix

feat: substituter: show redirect destination on failure

開放

#9,998 建立於 2024年2月12日

 (0 則留言) (1 個反應) (1 位負責人)C++ (1,293 個分叉)batch import
error-messagesfeaturefetchinggood first issue

倉庫指標

星標
 (9,803 顆星)
PR 合併指標
 (平均合併 7天 11小時) (30 天內合併 83 個 PR)

描述

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.

貢獻者指南