Show which filesystem is full on "error: writing to file: No space left on device"
Is your feature request related to a problem?
I need to import a big zip file (FPGA tools installer) into the Nix store and with too little space in /tmp it fails like this:
$ nix-prefetch-url file:///path/to/big/file.zip
error: writing to file: No space left on device
However, knowing that the problem is related to /tmp isn't straight forward, because after the error Nix cleans up the (big) temporary files. So as a user, I see that error message and run df -hT, but then there are no full (or nearly full) filesystems!
Proposed solution
The error message should say what device/filesystem caused the error.
And perhaps how much space the directory Nix was working in was using up to that point?
Alternative solutions
Additional context
Once I figured out where the problem was, I added more swap and increased the size of /tmp: sudo mount -o remount,size=16G
Checklist
- [x] checked latest Nix manual (source)
- [x] checked open feature issues and pull requests for possible duplicates
Add :+1: to issues you find important.
Should show the path it's writing to I suppose, since it could also be a size restriction on the directory.
This would be very nice. I have wasted some time not realizing /tmp is full.
Could be implemented similarly to MySQL:
MySQL said: Can't create/write to file '/tmp/MLX3o6NG' (Errcode: 28 - No space left on device)
Also useful for Nix in a CI build environment.
I had a look at extending writeFull so that it could report the problematic path, but was blocked by https://github.com/NixOS/nix/issues/14626.