Lix does not respect max-connect-timeout in a usable way #1197

Open
opened 2026-04-28 09:10:40 +00:00 by tom-hubrecht · 0 comments
Member

Describe the bug

Setting the option max-connect-timeout via the CLI is almost useless as the connections are performed in almost all cases by the daemon which never sees that option.

Steps To Reproduce

  1. Have a substituter that never answer and will timeout
  2. Try to build anything that is not present in the store
  3. Remember that max-connect-timeout exists and try to use it nix-buil --max-connect-timeout 5 ...
  4. Cry as it has no effect whatsoever

Expected behavior

That the timeouts actually respect the max timeout required

nix --version output

nix (Lix, like Nix) 2.96.0-dev-be34bc0481c29f858f9444989851a6527c3e813c
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/thubrecht/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/thubrecht/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/thubrecht/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/thubrecht/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/store/w0bzzj5hh51idan8mdk6l0s0xfang4kn-gnome-settings-daemon-49.1/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/scqwah9vmfj3k43finb0m5s3zsiqnzrr-lix-2.96.0-dev-be34bc0481c29f858f9444989851a6527c3e813c/share

Additional context

$ nix-build lix -A devShells.x86_64-darwin.native-clangStdenvPackages -v --max-connect-timeout 5 --substituters https://snix-store.dgnum.eu
fetching git input 'git+file:///home/thubrecht/Software/git.lix.systems/lix-project/lix'
using revision 68834b7841e37a902f1e4bdd3577a4a825e62e2f of repo '/home/thubrecht/Software/git.lix.systems/lix-project/lix'
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5006 milliseconds (curl error code=28); retrying in 599 ms (attempt 1/5)
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 10010 milliseconds (curl error code=28); retrying in 1007 ms (attempt 2/5)
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 20008 milliseconds (curl error code=28); retrying in 2015 ms (attempt 3/5)
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 40039 milliseconds (curl error code=28); retrying in 3954 ms (attempt 4/5)
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
disabling binary cache 'https://snix-store.dgnum.eu' for 60 seconds
warning: Failed to setup the substituter at URI 'https://snix-store.dgnum.eu': error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 80073 milliseconds (curl error code=28)

vs.

# NIX_REMOTE="/tmp/store" nix-build lix -A devShells.x86_64-darwin.native-clangStdenvPackages -v --max-connect-timeout 5 --substituters https://snix-store.dgnum.eu
fetching git input 'git+file:///home/thubrecht/Software/git.lix.systems/lix-project/lix'
using revision 68834b7841e37a902f1e4bdd3577a4a825e62e2f of repo '/home/thubrecht/Software/git.lix.systems/lix-project/lix'
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5005 milliseconds (curl error code=28); retrying in 521 ms (attempt 1/5)
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5004 milliseconds (curl error code=28); retrying in 1042 ms (attempt 2/5)
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5004 milliseconds (curl error code=28); retrying in 1967 ms (attempt 3/5)
downloading 'https://snix-store.dgnum.eu/nix-cache-info'...
warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5005 milliseconds (curl error code=28); retrying in 3909 ms (attempt 4/5)
## Describe the bug Setting the option `max-connect-timeout` via the CLI is almost useless as the connections are performed in almost all cases by the daemon which never sees that option. ## Steps To Reproduce 1. Have a substituter that never answer and will timeout 2. Try to build anything that is not present in the store 3. Remember that `max-connect-timeout` exists and try to use it `nix-buil --max-connect-timeout 5 ...` 4. Cry as it has no effect whatsoever ## Expected behavior That the timeouts actually respect the max timeout required ## `nix --version` output ``` nix (Lix, like Nix) 2.96.0-dev-be34bc0481c29f858f9444989851a6527c3e813c System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/thubrecht/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/thubrecht/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/thubrecht/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/thubrecht/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/store/w0bzzj5hh51idan8mdk6l0s0xfang4kn-gnome-settings-daemon-49.1/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/scqwah9vmfj3k43finb0m5s3zsiqnzrr-lix-2.96.0-dev-be34bc0481c29f858f9444989851a6527c3e813c/share ``` ## Additional context ```console $ nix-build lix -A devShells.x86_64-darwin.native-clangStdenvPackages -v --max-connect-timeout 5 --substituters https://snix-store.dgnum.eu fetching git input 'git+file:///home/thubrecht/Software/git.lix.systems/lix-project/lix' using revision 68834b7841e37a902f1e4bdd3577a4a825e62e2f of repo '/home/thubrecht/Software/git.lix.systems/lix-project/lix' downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5006 milliseconds (curl error code=28); retrying in 599 ms (attempt 1/5) downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 10010 milliseconds (curl error code=28); retrying in 1007 ms (attempt 2/5) downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 20008 milliseconds (curl error code=28); retrying in 2015 ms (attempt 3/5) downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 40039 milliseconds (curl error code=28); retrying in 3954 ms (attempt 4/5) downloading 'https://snix-store.dgnum.eu/nix-cache-info'... disabling binary cache 'https://snix-store.dgnum.eu' for 60 seconds warning: Failed to setup the substituter at URI 'https://snix-store.dgnum.eu': error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 80073 milliseconds (curl error code=28) ``` vs. ```console # NIX_REMOTE="/tmp/store" nix-build lix -A devShells.x86_64-darwin.native-clangStdenvPackages -v --max-connect-timeout 5 --substituters https://snix-store.dgnum.eu fetching git input 'git+file:///home/thubrecht/Software/git.lix.systems/lix-project/lix' using revision 68834b7841e37a902f1e4bdd3577a4a825e62e2f of repo '/home/thubrecht/Software/git.lix.systems/lix-project/lix' downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5005 milliseconds (curl error code=28); retrying in 521 ms (attempt 1/5) downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5004 milliseconds (curl error code=28); retrying in 1042 ms (attempt 2/5) downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5004 milliseconds (curl error code=28); retrying in 1967 ms (attempt 3/5) downloading 'https://snix-store.dgnum.eu/nix-cache-info'... warning: error: unable to download 'https://snix-store.dgnum.eu/nix-cache-info': Connection timed out after 5005 milliseconds (curl error code=28); retrying in 3909 ms (attempt 4/5) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1197
No description provided.