nix icon indicating copy to clipboard operation
nix copied to clipboard

Show which filesystem is full on "error: writing to file: No space left on device"

Open bjornfor opened this issue 11 months ago • 3 comments

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


Add :+1: to issues you find important.

bjornfor avatar Mar 04 '25 07:03 bjornfor

Should show the path it's writing to I suppose, since it could also be a size restriction on the directory.

L-as avatar Mar 18 '25 12:03 L-as

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.

peterbecich avatar Nov 23 '25 06:11 peterbecich

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.

bjornfor avatar Nov 23 '25 08:11 bjornfor