Issue with building python3.11 while doing nixos-rebuild

I am running sudo nixos-rebuild switch --flake ".#$(hostname)" and everything on my system has been working fine before. I ran nix flake update and then the command I just mentioned. I am now seeing the following output

error: builder for '/nix/store/sx436n2css1hfmfw5vnsyvwqh0qq7bf0-python3.11-pylint-3.3.3.drv' failed with exit code 1;
       last 25 log lines:
       >         if batches:
       >             new_argv.append(f"--batches={batches}")
       >         with patch("sys.argv", new_argv):
       >             Primer(PRIMER_DIRECTORY, PACKAGES_TO_PRIME_PATH).run()
       >         with open(PRIMER_DIRECTORY / "comment.txt", encoding="utf8") as f:
       >             content = f.read()
       >         with open(expected_file, encoding="utf8") as f:
       >             expected = f.read()
       >         # rstrip so the expected.txt can end with a newline
       > >       assert content == expected.rstrip("\n")
       > E       AssertionError: assert '🤖 **Effect o...mmit v2.14.2*' == '🤖 According ...mmit v2.14.2*'
       > E         - 🤖 According to the primer, this change has **no effect** on the checked open source code. 🤖🎉
       > E         + 🤖 **Effect of this PR on checked open source code:** 🤖
       > E         +
       > E         +
       > E         +
       > E         + **Effect on [astroid](https://github.com/pylint-dev/astroid):**
       > E         + The following messages are no longer emitted:...
       > E
       > E         ...Full output truncated (13 lines hidden), use '-vv' to show
       >
       > tests/testutils/_primer/test_primer.py:108: AssertionError
       > =========================== short test summary info ============================
       > FAILED tests/testutils/_primer/test_primer.py::TestPrimer::test_compare[both_empty] - AssertionError: assert '🤖 **Effect o...mmit v2.14.2*' == '🤖 According ......
       > ============ 1 failed, 970 passed, 250 skipped, 5 xfailed in 19.26s ============
       For full logs, run 'nix log /nix/store/sx436n2css1hfmfw5vnsyvwqh0qq7bf0-python3.11-pylint-3.3.3.drv'.
error: 1 dependencies of derivation '/nix/store/8j9fms9v4ln0yz3c6agfwqjq1w5jy9zn-python3.11-python-lsp-server-1.12.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/297d0swr1dcnc6mnqi7h3lqixlgd6dyq-helix-wrapped-25.01.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9rgw1xaw2x3b5v2xgsi8yihkbgwmw9gn-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ns6i9cqv29xsl0v228x13mdbakhh8q21-man-paths.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x724z4gzyq7142s8jdn53knfcwx0sq4r-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gggpxx1akipzwd8f2s6kvvgm588lavwn-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pfsh3hf2qriqxs5h0v7pmxh4qf6gi2sw-etc.drv' failed to build
error (ignored): error: cannot unlink '"/tmp/nix-build-nvidia-settings-550.142.drv-0/build"': Directory not empty
error: 1 dependencies of derivation '/nix/store/332i0j4s8qzp9g1zp1mb69yl0cpjlx3w-nixos-system-NAVI-SolarisOS-25.05.20250213.2ff53fe.drv' failed to build

Any suggestions for help would be appreciated.

wait what?! I reran the command and it worked? Hold on, let me verify this again.

The build failure is due to a failing test case. Maybe the test case is flaky.

I mean, I get that much. Just strange now it just magically started working again :eyes:

Yeah, that’s what a “flaky” test means - sometimes it passes, sometimes it doesn’t. You’re welcome to still report it at https://github.com/NixOS/nixpkgs/issues as a flaky test.

EDIT: and the package in question appears to be python311Packages.pylint, not python itself.

Do you know what’s pulling in the python 3.11 LSP?

Ahh I see, thanks for the clarification on the terminology. I imagine neovim (via nixvim) is pulling that or helix. I’m trying out a few different editors.

The logs say helix-wrapped, but helix doesn’t depend on that LSP> and it’s not called helix-wrapped in nixpkgs. Where are you getting it from?

Woah that’s weird. Home manager maybe? I don’t know too much of the internals of nix, but these are the only channels I’m really using.

    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    nixvim = {
      url = "github:nix-community/nixvim";
      inputs.nixpkgs.follows = "nixpkgs";
    };

Hello, was there a resolution to this issue? I’m getting the same error:

error: builder for '/nix/store/zzr169440jgckvjf5297j12w2yk0s4wv-python3.12-python-lsp-server-1.12.2.drv' failed with exit code 1;
       last 25 log lines:
       > Arguments: ()
       > --- Logging error ---
       > Traceback (most recent call last):
       >   File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/logging/__init__.py", line 1163, in emit
       >     stream.write(msg + self.terminator)
       > ValueError: I/O operation on closed file.
       > Call stack:
       >   File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/threading.py", line 1032, in _bootstrap
       >     self._bootstrap_inner()
       >   File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
       >     self.run()
       >   File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/threading.py", line 1433, in run
       >     self.function(*self.args, **self.kwargs)
       >   File "/build/source/pylsp/_utils.py", line 43, in run
       >     return func(*args, **kwargs)
       >   File "/build/source/pylsp/python_lsp.py", line 445, in lint
       >     self._lint_text_document(
       >   File "/build/source/pylsp/python_lsp.py", line 454, in _lint_text_document
       >     workspace.publish_diagnostics(
       >   File "/build/source/pylsp/workspace.py", line 189, in publish_diagnostics
       >     self._endpoint.notify(
       >   File "/nix/store/405q953gjha7aa6klmninmni2bf8s81c-python3.12-python-lsp-jsonrpc-1.1.2/lib/python3.12/site-packages/pylsp_jsonrpc/endpoint.py", line 50, in notify
       >     log.debug('Sending notification: %s %s', method, params)
       > Message: 'Sending notification: %s %s'
       > Arguments: ('textDocument/publishDiagnostics', {'uri': 'file:///build/pytest-of-nixbld/pytest-0/test_multiple_workspaces0/workspace2/file1.py', 'diagnostics': [{'source': 'pyflakes', 'range': {'start': {'line': 0, 'character': 0}, 'end': {'line': 0, 'character': 10}}, 'message': "'sys' imported but unused", 'severity': 2}, {'source': 'pycodestyle', 'range': {'start': {'line': 0, 'character': 10}, 'end': {'line': 0, 'character': 10}}, 'message': 'W292 no newline at end of file', 'code': 'W292', 'severity': 2}], 'version': 1})
       For full logs, run 'nix log /nix/store/zzr169440jgckvjf5297j12w2yk0s4wv-python3.12-python-lsp-server-1.12.2.drv'.
error: 1 dependencies of derivation '/nix/store/74ncl9n0n3xfaks3bk75wqh1gsgj80r3-neovim-0.10.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jqnbkplla3f8zgbra1p1yjzryb31zwcg-nixvim.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4v7cyxdcadvy25c1w7l6619p51j215i7-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wa09smqb84fdwjlldi10vqgn5krm0626-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1a52sbbd2yxdz8s9v7zdvji063iy9r2z-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xsmavz7cf4n4qsn1dkdq87wl6k4b1gdi-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/safzj63p9c70ag33ik8azz5cjpzj44zr-nixos-system-bqnix-25.05.20250309.e3e32b6.drv' failed to build

nix log /nix/store/zzr169440jgckvjf5297j12w2yk0s4wv-python3.12-python-lsp-server-1.12.2.drv

https://ctxt.io/2/AAB49XcsFQ

Unfortunately I did not have one. The test magically started passing again. It’s possible the test is non-deterministic in some way for my case.

hmm. welp going to re-install and change to stable, hopefully that will get me back operational. TY!

Re-installing won’t really do anything for you here. You can try rebuilding if it’s flaky, but ultimately you will have to somehow debug or report this in the appropriate repo if it continues to fail.