NixOS/nix

feat: substituter: show redirect destination on failure

Open

#9,998 创建于 2024年2月12日

在 GitHub 查看
 (0 评论) (1 反应) (1 负责人)C++ (9,803 star) (1,293 fork)batch import
error-messagesfeaturefetchinggood first issue

描述

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.

贡献者指南