Error when rebuilding with `texliveFull` package

Hello! My nixos-rebuild switch fails with an error when the texliveFull package is added to my system package list in my configuration.nix.

I was able to reproduce this error in a fresh NixOS 26.05 virtual machine.

Here’s the bits of the console output that look important on running nixos-rebuild switch. I also included a copy of my configuration.nix.

nixos-rebuild switch console output sections
...
copying path '/nix/store/ykw6901bgmm649wlp006bmjgakslzh5h-luarandom-0.02-tex' from 'https://cache.nixos.org'...
error: hash mismatch importing path '/nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex';
         specified: sha256:033w5cd8z7r02h4r2p8lha6z81qqvky69a7aiahjpd15smss4wjp
         got:       sha256:1f0v56g28nl5v8pmxg9cf7d8rm3jnb2950dknd613z1nlvqw78fc
error: path '/nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex' is required, but there is no substituter that can build it
...
copying path '/nix/store/777kr18s20l18hbz5v6qn2fbimykvi97-mathspic-1.13-texdoc' from 'https://cache.nixos.org'...
error: some references of path '/nix/store/3b1j5jipjpakdak6par146z865lwq8rp-texlive-2025-r78234-final-env-texmfdist' could not be realised
copying path '/nix/store/917c0jiq9jlb7cjmqsl1jvq9g6356gm8-mkpic-1.03-texdoc' from 'https://cache.nixos.org'...
...
copying path '/nix/store/pn8lgc7mrbsb41jdvmi3jbfpjazlrp35-mptopdf-78011-texdoc' from 'https://cache.nixos.org'...
error: some references of path '/nix/store/9b43jnj9kf61158gw13wk6a8xih4rgiz-texlive-2025-r78234-final-env' could not be realised


e[31;1mterminating due to unexpected unrecoverable internal error: e[0mcopying path '/nix/store/lc9f5j11vcndpkzx8hzj4kz3yzq3wm5v-musixtnt-69742-texdoc' from 'https://cache.nixos.org'...
copying path '/nix/store/g9xh139q7f0cc0cl4bnjld6lad9s07s9-omegaware-73848-texdoc' from 'https://cache.nixos.org'...
copying path '/nix/store/3gsd0wvx9jd7r7njg8pv4p563wmnwvp7-optex-1.19-texdoc' from 'https://cache.nixos.org'...
Assertion 'result == ecSuccess || result == ecFailed || result == ecNoSubstituters' failed in nix::Goal::Done nix::Goal::amDone(ExitCode) at ../build/goal.cc:204
Nix crashed. This is a bug. Please report this at https://github.com/NixOS/nix/issues with the following information included:

std::terminate() called without exception
Stack trace:
 0# 0x00000000001124AE in nix-build
 1# 0x00000000000C539A in /nix/store/chqq8mpmpyfi9kgsngya71akv5xicn03-gcc-15.2.0-lib/lib/libstdc++.so.6
 2# std::unexpected() in /nix/store/chqq8mpmpyfi9kgsngya71akv5xicn03-gcc-15.2.0-lib/lib/libstdc++.so.6
 3# 0x00000000000E92EF in /nix/store/a90px0h1szz9y9c67ww1sa163z44flf9-nix-util-2.34.7/lib/libnixutil.so.2.34.7
 4# __wrap___assert_fail in /nix/store/yxb9ryjd5nrkjyisq612laz9w23s900b-nix-store-2.34.7/lib/libnixstore.so.2.34.7
 5# 0x00000000000BD59C in /nix/store/yxb9ryjd5nrkjyisq612laz9w23s900b-nix-store-2.34.7/lib/libnixstore.so.2.34.7
 6# 0x00000000001B5A0E in /nix/store/yxb9ryjd5nrkjyisq612laz9w23s900b-nix-store-2.34.7/lib/libnixstore.so.2.34.7
 7# nix::Goal::work() in /nix/store/yxb9ryjd5nrkjyisq612laz9w23s900b-nix-store-2.34.7/lib/libnixstore.so.2.34.7
 8# nix::Worker::run(std::set<std::shared_ptr<nix::Goal>, nix::CompareGoalPtrs, std::allocator<std::shared_ptr<nix::Goal> > > const&) in /nix/store/yxb9ryjd5nrkjyisq612laz9w23s900b-nix-store-2.34.7/lib/libnixstore.so.2.34.7
 9# nix::Store::buildPaths(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath> > const&, nix::BuildMode, std::shared_ptr<nix::Store>) in /nix/store/yxb9ryjd5nrkjyisq612laz9w23s900b-nix-store-2.34.7/lib/libnixstore.so.2.34.7
10# 0x0000000000200F62 in nix-build
11# 0x00000000002093BC in nix-build
12# 0x000000000019EC47 in nix-build
13# nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, nix::fun<void ()>) in /nix/store/a90px0h1szz9y9c67ww1sa163z44flf9-nix-util-2.34.7/lib/libnixutil.so.2.34.7
14# 0x00000000000E1A0B in nix-build
15# 0x000000000002B285 in /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6
16# __libc_start_main in /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6
17# 0x00000000000E6675 in nix-build

Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link' died with <Signals.SIGABRT: 6>.

configuration.nix
# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.loader.grub.enable = true;
  boot.loader.grub.device = "/dev/vda";
  boot.loader.grub.useOSProber = true;

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "America/Los_Angeles";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "en_US.UTF-8";
    LC_IDENTIFICATION = "en_US.UTF-8";
    LC_MEASUREMENT = "en_US.UTF-8";
    LC_MONETARY = "en_US.UTF-8";
    LC_NAME = "en_US.UTF-8";
    LC_NUMERIC = "en_US.UTF-8";
    LC_PAPER = "en_US.UTF-8";
    LC_TELEPHONE = "en_US.UTF-8";
    LC_TIME = "en_US.UTF-8";
  };

  # Enable the X11 windowing system.
  # You can disable this if you're only using the Wayland session.
  services.xserver.enable = true;

  # Enable the KDE Plasma Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "us";
    variant = "";
  };

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  services.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users."user" = {
    isNormalUser = true;
    description = "user";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
      kdePackages.kate
    #  thunderbird
    ];
  };

  # Install firefox.
  programs.firefox.enable = true;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
     texliveFull
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "26.05"; # Did you read the comment?

}

I’d like help with getting the package working.

2 Likes

Oh hey, I got the same hash mismatch a few hours ago! I asked Claude to debug it, and it claims that this is due to cache.nixos.org somehow getting a straight-up wrong object for the /nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex path:

The object served at cache.nixos.org/nar/033w5cd8….nar.zst is not the lpform TeX file at all. It’s the Haskell half-0.3.3 library built for GHC 9.10.3 (~1 MB, 13 files: libHShalf-*.so/.a, .hi, .hie, a package .conf). Decompressed and restored it hashes to 1f0v56g28… — your exact failure hash.

Claude gave me two commands to check this, the first of which reproduces the hash mismatch by fetching from cache.nixos.org

nix build --store "$(mktemp -d)" /nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex

… and the second of which shows that the failure does not occur when building locally:

nix build --option substitute false 'github:NixOS/nixpkgs/a8d610af3f1a5fb71e23e08434d8d61a466fc942#texlive.pkgs.lpform.tex'
2 Likes

Hydra has successfully built texliveFull on all platforms, so you’re not actually building it, just fetching it from our cache: https://hydra.nixos.org/eval/1826339?filter=texliveFull

I think the robot answers are half-correct - what seems more likely to me, is that your machine failed partway through a path fetch, causing the truncated incomplete fetch to report the wrong content hash.

What are the specs of your virtual machine? You might need to bump up its RAM allocation in particular for such large fetches. If I try to build (i.e. fetch from cache) texliveFull on my machine, I get this printout before the fetching starts:

these 3638 paths will be fetched (1.4 GiB download, 3.4 GiB unpacked):

So for a hefty package like this, you might need 4GB or so of RAM.

1 Like

Thanks for your response! My virtual machine has 12 GB of RAM, but I only gave it one vCPU by mistake.
The hash mismatch error with the same package first happened on a modern machine with 32 GB of RAM, running on bare metal several hours before I tried to reproduce the error in a VM. The errors in the logs are similar if not the same as those reproduced on the VM.

1 Like

This is what I thought at first too, but I don’t think this is true. Here’s a third command Claude gave me, which you can use to see that this is indeed the Haskell package I described earlier:

d=$(mktemp -d); curl -s https://cache.nixos.org/nar/033w5cd8z7r02h4r2p8lha6z81qqvky69a7aiahjpd15smss4wjp.nar.zst | unzstd | nix-store --restore "$d/tree"; cat "$d"/tree/lib/ghc-*/lib/package.conf.d/*.conf | head -3

I originally hit this error on a machine with 128 GiB RAM, so I don’t think that’s the issue. Did you try running the repro commands I listed above? Do you not get the same results I get?

Wow, you are quite correct, I’ve never seen this before. I must have had that specific path cached from something else I had built previously - after deleting it (and any referrer paths that prevented me from deleting it):

$ nix build /nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex/                                                                                                                
error: hash mismatch importing path '/nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex';
         specified: sha256-V3KiddUltCuhiuqoZPzcGAf0jYIUXZEJFCCfjxorfAw=
         got:       sha256-zKHD8aY2/BFMs7OBksSyctSM2nEsvV4v2oVaJJ4pG7g=
2 Likes

OK glad I’m not crazy :sweat_smile:

This seems pretty bad to be honest. Is there a good place to report this? Like a Nix infra Matrix chat or something?

1 Like

Yeah, it seems like we’ll need some kind of infra-level intervention to fix this if that’s indeed what’s happening here. NixOS Infrastructure channel is here: https://matrix.to/#/#infra:nixos.org

1 Like

In the meantime, does this workaround work for you?

nix build github:NixOS/nixpkgs/a8d610af3f1a5fb71e23e08434d8d61a466fc942#texlive.pkgs.lpform.tex --option substituters '' --print-out-paths                                                 
/nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex

After doing that, I’m able to build texliveFull successfully:

nix build github:NixOS/nixpkgs/a8d610af3f1a5fb71e23e08434d8d61a466fc942#texliveFull --print-out-paths                                                                                      
/nix/store/d3davysji0wcn4584m9vj5jk53g9kidj-texlive-2025-env-man
/nix/store/p2vzpmdnzgmirvsyniwgfmasyggaapz8-texlive-2025-env
1 Like

I tried that command running in root shell:

nix build /nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex/ --option substituters '' --extra-experimental-features nix-command

I get this error as a result:

error: path '/nix/store/gypp7g48p2fcpjx952i84dhw4ak95npl-lpform-36918-tex' is required, but there is no substituter that can build it

Apologies, I clearly copy/pasted the wrong command from my messy shell session. Edited, try the version that’s properly using a nixpkgs flakeref + attr path. (Of course; you can’t build a raw store path without any substituters to provide it :person_facepalming: )

You found a pretty bad issue, thank you. Tracked at [new HQR] queue builder uploaded to a wrong NAR path on S3 · Issue #1804 · NixOS/hydra · GitHub

7 Likes

I succeeded in doing a nixos-rebuild switch with texliveFull in my package list after running your first command! The build that command started took around a couple of hours to finish on my modern hardware.

I ran the exact command as follows in a root shell:
# nix build github:NixOS/nixpkgs/a8d610af3f1a5fb71e23e08434d8d61a466fc942#texlive.pkgs.lpform.tex --option substituters '' --print-out-paths --extra-experimental-features nix-command --extra-experimental-features flakes

3 Likes