Before submitting
Area
apps/server
Steps to reproduce
- On NixOS with
programs.nix-ld.enable = true and its default library set, let T3 install its preview browser (call html_preview from any thread).
html_preview fails with "This host is missing libraries T3's browser needs (libglib-2.0.so.0, libgobject-2.0.so.0, libnspr4.so, … 22 in all). Run sudo t3 browser setup on the host to install them, then try again."
sudo t3 browser setup finds no apt-get and prints "Install them with your package manager, then run this again."
- Give nix-ld the libraries (list under Workaround) and switch.
html_preview and html_render now work.
- Run
t3 browser setup again. It still lists all 22 libraries as missing.
Expected behavior
The library check agrees with what the loader finds when the browser starts, so once the libraries are there, neither T3 nor t3 browser setup reports them missing.
Actual behavior
PreviewBrowserHost.missingLibraries runs ldd <chrome-headless-shell>. On NixOS, ldd runs the glibc loader from the Nix store, and that loader doesn't read nix-ld's library path. The browser itself starts through /lib64/ld-linux-x86-64.so.2, which is nix-ld and does read it. So ldd reports all 22 libraries as not found whether or not nix-ld provides them:
$ NIX_LD_LIBRARY_PATH=<set with the libraries> chrome-headless-shell --version
Google Chrome for Testing 154.0.8037.92
$ NIX_LD_LIBRARY_PATH=<same set> ldd chrome-headless-shell | grep -c 'not found'
22
What follows from that:
t3 browser setup never reports a NixOS host as ready.
- When the browser fails for some other reason on such a host,
diagnoseLaunchFailure still blames missing libraries and points at sudo t3 browser setup, which hides the real cause.
t3 browser setup can only install libraries with apt-get (DEBIAN_PACKAGES).
A check that trusts the loader would avoid this. For example, report missing libraries only when Chrome's own stderr has the loader's error while loading shared libraries: line (glibc prints it on every distro, nix-ld included). In t3 browser setup, start the browser with --version before listing libraries.
Related: on NixOS this missing-libraries exit is also what triggered the server crash in #16794 for us (the fix is #16555).
Impact
Minor bug or occasional failure
Version or commit
nightly 0.0.46-nightly.20261007.2761 (PreviewBrowserHost.ts is unchanged on main @ 611132c)
Environment
NixOS 26.11 x86_64, nix-ld 2.0.6, T3 executable (Node 26.8.2), Chrome for Testing headless shell 154.0.8037.92
Workaround
Give nix-ld the libraries the headless shell links (nixpkgs attribute names):
programs.nix-ld.libraries = with pkgs; [
alsa-lib at-spi2-core dbus expat glib libgbm libx11 libxcb libxcomposite libxdamage
libxext libxfixes libxkbcommon libxrandr nspr nss systemd
];
at-spi2-core provides libatk, libatk-bridge and libatspi, and systemd provides libudev. After a switch, the browser picks them up the next time it starts. t3 browser setup keeps listing them, as described above.
Found and written with Claude Opus 5.5 in T3 Code (OpenCode 2 + cursor-opencode-provider).
Before submitting
Area
apps/server
Steps to reproduce
programs.nix-ld.enable = trueand its default library set, let T3 install its preview browser (callhtml_previewfrom any thread).html_previewfails with "This host is missing libraries T3's browser needs (libglib-2.0.so.0, libgobject-2.0.so.0, libnspr4.so, … 22 in all). Runsudo t3 browser setupon the host to install them, then try again."sudo t3 browser setupfinds no apt-get and prints "Install them with your package manager, then run this again."html_previewandhtml_rendernow work.t3 browser setupagain. It still lists all 22 libraries as missing.Expected behavior
The library check agrees with what the loader finds when the browser starts, so once the libraries are there, neither T3 nor
t3 browser setupreports them missing.Actual behavior
PreviewBrowserHost.missingLibrariesrunsldd <chrome-headless-shell>. On NixOS,lddruns the glibc loader from the Nix store, and that loader doesn't read nix-ld's library path. The browser itself starts through/lib64/ld-linux-x86-64.so.2, which is nix-ld and does read it. Solddreports all 22 libraries asnot foundwhether or not nix-ld provides them:What follows from that:
t3 browser setupnever reports a NixOS host as ready.diagnoseLaunchFailurestill blames missing libraries and points atsudo t3 browser setup, which hides the real cause.t3 browser setupcan only install libraries with apt-get (DEBIAN_PACKAGES).A check that trusts the loader would avoid this. For example, report missing libraries only when Chrome's own stderr has the loader's
error while loading shared libraries:line (glibc prints it on every distro, nix-ld included). Int3 browser setup, start the browser with--versionbefore listing libraries.Related: on NixOS this missing-libraries exit is also what triggered the server crash in #16794 for us (the fix is #16555).
Impact
Minor bug or occasional failure
Version or commit
nightly 0.0.46-nightly.20261007.2761 (
PreviewBrowserHost.tsis unchanged on main @ 611132c)Environment
NixOS 26.11 x86_64, nix-ld 2.0.6, T3 executable (Node 26.8.2), Chrome for Testing headless shell 154.0.8037.92
Workaround
Give nix-ld the libraries the headless shell links (nixpkgs attribute names):
at-spi2-coreprovides libatk, libatk-bridge and libatspi, andsystemdprovides libudev. After a switch, the browser picks them up the next time it starts.t3 browser setupkeeps listing them, as described above.Found and written with Claude Opus 5.5 in T3 Code (OpenCode 2 + cursor-opencode-provider).