You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just reinstalled a NixOs from scratch (23.11), with a very minimalist configuration, and then I tried to load my old, bigger, configuration. But it failed with an error Too many open files. As pointed by @bennofs in #6007 (comment) , the limit has been raised in the nix-daemon process used when running nix-build as a single user, but not when building a new derivation as root (no idea why).
Steps To Reproduce
Create a test.py python file with:
l = []
for i in range(10000):
print(i)
l += [ open(f"myfile-{i}.txt", "w") ]
print("All files were successfully opened.")
for d in l:
d.close()
Then, you can run nix-build as a normal user, this phase will succeed (of course not everything since the install phase does not create the $out directory) and you will see the text print("All files were successfully opened."). On the other hand, do:
$ sudo nix-build
and you will get error:
…
1019
1020
1021
Traceback (most recent call last):
File "/nix/store/2bnkvm5bsymxxkqq4373j1rrqifb50sn-foo/test.py", line 4, in <module>
OSError: [Errno 24] Too many open files: 'myfile-1021.txt'
For now, my workaround is to build my configuration first as a normal user, and then once it fails due to root right missing, I run again the command as root… but highly unpractical.
Describe the bug
I just reinstalled a NixOs from scratch (23.11), with a very minimalist configuration, and then I tried to load my old, bigger, configuration. But it failed with an error
Too many open files
. As pointed by @bennofs in #6007 (comment) , the limit has been raised in thenix-daemon
process used when runningnix-build
as a single user, but not when building a new derivation as root (no idea why).Steps To Reproduce
Create a
test.py
python file with:Create a
derivation.nix
containing:and a
default.nix
containing:Then, you can run
nix-build
as a normal user, this phase will succeed (of course not everything since the install phase does not create the$out
directory) and you will see the textprint("All files were successfully opened.")
. On the other hand, do:and you will get error:
For now, my workaround is to build my configuration first as a normal user, and then once it fails due to root right missing, I run again the command as root… but highly unpractical.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: