Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator doesn't respect $TMPDIR #293

Closed
Goorzhel opened this issue Feb 12, 2024 · 2 comments
Closed

Generator doesn't respect $TMPDIR #293

Goorzhel opened this issue Feb 12, 2024 · 2 comments

Comments

@Goorzhel
Copy link

Somewhat related to #279. I have a tmpfs-as-root system, so it makes more sense to build images in a different root:

❯ df -HT /tmp /zpool/tmp
Filesystem     Type   Size  Used Avail Use% Mounted on
tmpfs          tmpfs  4.3G  1.3G  3.1G  30% /
zpool/tmp      zfs    697G  1.1G  696G   1% /zpool/tmp
❯ export TMPDIR=/zpool/tmp
❯ nix run github:nix-community/nixos-generators --  --format do --flake '.#vm' -o ./result

But my desginated TMPDIR sits empty while all the action still happens in /tmp:

❯ ls -l /zpool/tmp/nix-build-370889-0
❯ ls -l /tmp/nix-build-digital-ocean-image.drv-0
drwxr-xr-x - nixbld1 11 Feb 16:01 root
drwxr-xr-x - nixbld1 11 Feb 16:01 state
drwxr-xr-x - nixbld1 11 Feb 16:01 xchg
nix log '/nix/store/d8w7jrsz4x91sf8ml0h6ybciwhma8wsp-digital-ocean-image.drv^out' | tail -50
[    1.398199] Btrfs loaded, crc32c=crc32c-generic, zoned=no, fsverity=no
[    1.398383] Warning: unable to open an initial console.
[    1.398391] This architecture does not have kernel memory protection.
[    1.398396] Run /init as init process
[    1.399396] EXT4-fs (vda1): mounted filesystem with ordered data mode. Opts: . Quota mode: disabled.
[    1.716810] random: fast init done
[    3.051155] random: crng init done
[    4.219822] blk_update_request: I/O error, dev vda, sector 461736 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.219956] blk_update_request: I/O error, dev vda, sector 462760 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220100] blk_update_request: I/O error, dev vda, sector 464808 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220107] blk_update_request: I/O error, dev vda, sector 464816 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220112] blk_update_request: I/O error, dev vda, sector 464824 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220117] blk_update_request: I/O error, dev vda, sector 464832 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220121] blk_update_request: I/O error, dev vda, sector 464840 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220126] blk_update_request: I/O error, dev vda, sector 464848 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220130] blk_update_request: I/O error, dev vda, sector 464856 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220135] blk_update_request: I/O error, dev vda, sector 464864 op 0x1:(WRITE) flags 0x4000 phys_seg 1 prio class 0
[    4.220157] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149976 starting block 58112)
[    4.220532] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149976 starting block 58226)
[    4.220571] Buffer I/O error on device vda1, logical block 56960
[    4.220590] Buffer I/O error on device vda1, logical block 56961
[    4.220595] Buffer I/O error on device vda1, logical block 56962
[    4.220600] Buffer I/O error on device vda1, logical block 56963
[    4.220605] Buffer I/O error on device vda1, logical block 56964
[    4.220608] Buffer I/O error on device vda1, logical block 56965
[    4.220613] Buffer I/O error on device vda1, logical block 56966
[    4.220616] Buffer I/O error on device vda1, logical block 56967
[    4.220620] Buffer I/O error on device vda1, logical block 56968
[    4.220624] Buffer I/O error on device vda1, logical block 56969
[    4.221471] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149977 starting block 623977)
[    4.221722] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149979 starting block 622423)
[    4.221911] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149983 starting block 622434)
[    4.221937] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149986 starting block 622447)
[    4.221970] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149989 starting block 622465)
[    4.222164] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149992 starting block 622477)
[    4.222175] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149995 starting block 622490)
[    4.222189] EXT4-fs warning (device vda1): ext4_end_bio:342: I/O error 10 writing to inode 149998 starting block 622503)
[    5.387483] Aborting journal on device vda1-8.
[    5.388709] EXT4-fs error (device vda1): ext4_journal_check_start:83: comm host1: Detected aborted journal
[    5.388977] EXT4-fs (vda1): Remounting filesystem read-only
error processing entry /build/root/nix/store/0jj8vps0p42kqsm04alf5mnpf8q5kn46-vim-9.0.2116/share/vim/vim90/doc/version8.txt, aborting
error processing entry /build/root/nix/store/0jj8vps0p42kqsm04alf5mnpf8q5kn46-vim-9.0.2116/share/vim/vim90/doc, aborting
error processing entry /build/root/nix/store/0jj8vps0p42kqsm04alf5mnpf8q5kn46-vim-9.0.2116/share/vim/vim90, aborting
error processing entry /build/root/nix/store/0jj8vps0p42kqsm04alf5mnpf8q5kn46-vim-9.0.2116/share/vim, aborting
error processing entry /build/root/nix/store/0jj8vps0p42kqsm04alf5mnpf8q5kn46-vim-9.0.2116/share, aborting
error processing entry /build/root/nix/store/0jj8vps0p42kqsm04alf5mnpf8q5kn46-vim-9.0.2116, aborting
error processing entry /build/root/nix/store, aborting
error processing entry /build/root/nix, aborting
[    5.490380] reboot: Restarting system
ERROR: cptofs failed. diskSize might be too small for closure.
@Lassulus
Copy link
Collaborator

you probably have a nix-daemon, so you need to change TMPDIR of the daemon and not your user. Probably something like this in your nixos configuration:

systemd.services.nix-daemon.environment.TMPDIR = "/zpool/tmp";

@Goorzhel
Copy link
Author

Ah, yep, pure PEBKAC. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants