Skip to content

nix log fails to find remote log owing to URL encoding #12910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
peterwaller-arm opened this issue Apr 3, 2025 · 1 comment
Open
2 tasks done

nix log fails to find remote log owing to URL encoding #12910

peterwaller-arm opened this issue Apr 3, 2025 · 1 comment
Labels

Comments

@peterwaller-arm
Copy link

Describe the bug

If you have a derivation with a + in the name, nix log <drv> fetching from a substituter will result in a 404. Under the hood, + is the URL encoding for space ( ). Nix needs to translate the filename into a URL through URL encoding when it does a query.

Steps To Reproduce

  1. Copy log of derivation with + in the name to a binary cache such as S3.
  2. Use nix log /nix/store/asdf-foobar+2.drv

Observe failure:

error: build log of '/nix/store/asdf-foobar+2.drv' is not available

Obvious workaround is to URL encode the filename, but that fails without trying to query the remote cache:

error: getting status of '/nix/store/asdf-foobar%2B2.drv': No such file or directory

Expected behavior

It should be possible to do 'nix log' for a derivation with + in the name.

Metadata

nix (Nix) 2.24.8

Also tested:

nix (Nix) 2.29.0pre20250403_5e19252

Additional context

Checklist


Add 👍 to issues you find important.

@Mic92
Copy link
Member

Mic92 commented Apr 8, 2025

Probably some fix is here required:

auto logPath = "log/" + std::string(baseNameOf(printStorePath(path)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants