Describe the bug
When copying nix paths to two different s3 servers which have the same bucket name, the second copy does not copy the paths.
Steps To Reproduce
Copy a store path to foo.example.com:
nix copy -v /nix/store/... --to s3://nix?profile=foo&scheme=https&endpoint=foo.example.com
Then, for the same path, copy it to bar.example.com:
nix copy -v /nix/store/... --to s3://nix?profile=bar&scheme=https&endpoint=bar.example.com
This second command won't copy anything to the server, it will print copying 0 paths... and no connection attempts are made to the bar.example.com (according to strace and more verbose output).
The workaround is to specify --option narinfo-cache-positive-ttl 0, but it reduces the speed of copy dramatically if the closure is large.
Expected behavior
The path is copied to both servers.
Metadata
nix-env (Nix) 2.31.3
Additional context
I think the issue is that in ~/.cache/nix/binary-cache-v7.sqlite, nix registers the target as s3://nix (so only the bucket name is stored there), without the hostname or other parameters. That makes the second nix copy believe that the paths have been already copied.
Checklist
Describe the bug
When copying nix paths to two different s3 servers which have the same bucket name, the second copy does not copy the paths.
Steps To Reproduce
Copy a store path to foo.example.com:
Then, for the same path, copy it to bar.example.com:
This second command won't copy anything to the server, it will print
copying 0 paths...and no connection attempts are made to the bar.example.com (according to strace and more verbose output).The workaround is to specify
--option narinfo-cache-positive-ttl 0, but it reduces the speed of copy dramatically if the closure is large.Expected behavior
The path is copied to both servers.
Metadata
nix-env (Nix) 2.31.3Additional context
I think the issue is that in
~/.cache/nix/binary-cache-v7.sqlite, nix registers the target ass3://nix(so only the bucket name is stored there), without the hostname or other parameters. That makes the secondnix copybelieve that the paths have been already copied.Checklist