Error: 1 dependencies of derivation '/nix/store/...drv' failed to build

I’m trying to do a system rebuild but getting the following error. There’s no apparent traceback, at least as far as I can scroll back in the terminal. Most NixOS build errors are informative and I can find and fix the problem, but not sure how to find and fix this one. Any suggestions?

$> sudo nixos-rebuild -v --show-trace boot
...
linking '/nix/store/n7wyb6cs9bkz482piis84d628axdfkda-rocm-llvm-clang-unwrapped-5.7.1/bin/flang' to '/nix/store/.links/0qfip2hvwsdjnlbnkhfh218vrw6r8s3g5q90dr86046bz25v0rzr'
linking '/nix/store/n7wyb6cs9bkz482piis84d628axdfkda-rocm-llvm-clang-unwrapped-5.7.1/bin/clang-cl' to '/nix/store/.links/0qfip2hvwsdjnlbnkhfh218vrw6r8s3g5q90dr86046bz25v0rzr'
error: 1 dependencies of derivation '/nix/store/qvf8jg7a003lap26awnfkrqpvxhhv6ww-nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d.drv' failed to build

$> nix derivation show /nix/store/qvf8jg7a003lap26awnfkrqpvxhhv6ww-nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d.drv
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/qvf8jg7a003lap26awnfkrqpvxhhv6ww-nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d.drv^*'
...
    "name": "nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d",
    "outputs": {
      "out": {
        "path": "/nix/store/b11kiccbhvkyayv9yviwl965sz9ilbc6-nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d"
      }
    },
    "system": "x86_64-linux"
  }
}

$> nix log /nix/store/b11kiccbhvkyayv9yviwl965sz9ilbc6-nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d
error: build log of '/nix/store/b11kiccbhvkyayv9yviwl965sz9ilbc6-nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d' is not available

$>

How about just nix build -L '/nix/store/qvf8jg7a003lap26awnfkrqpvxhhv6ww-nixos-system-z10pe-d8-24.05pre582649.d934204a0f8d.drv^*'

1 Like

error: 1 dependencies of derivation is a symptom of the problem. You should see a more useful error message saying error: builder for '/nix/store/...-foo.drv' failed with exit code .... That is your actual failure.

3 Likes

Thanks, I found that but it’s just exit code 1. I redid my prior build attempt and this time sent stdout and stderr into a file, then searched the file and found the error was being caused package code-interpreter, so I removed it.

Unfortunately now there’s a new package causing the same build failure problem. Here’s the new error messages from the stdout and stderr file:

Warning: Schema ?org.gnome.system.locale? has path ?/system/locale/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/
system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy? has path ?/system/proxy/?.  Paths starting with ?/apps/?, ?/desktop/? or ?/sy
stem/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.http? has path ?/system/proxy/http/?.  Paths starting with ?/apps/?, ?/desktop
/? or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.https? has path ?/system/proxy/https/?.  Paths starting with ?/apps/?, ?/deskt
op/? or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.ftp? has path ?/system/proxy/ftp/?.  Paths starting with ?/apps/?, ?/desktop/?
 or ?/system/? are deprecated.
Warning: Schema ?org.gnome.system.proxy.socks? has path ?/system/proxy/socks/?.  Paths starting with ?/apps/?, ?/deskt
op/? or ?/system/? are deprecated.
Finished cargoSetupPostUnpackHook
setting SOURCE_DATE_EPOCH to timestamp 1679706793 of file cryptography-40.0.1/setup.cfg
Running phase: patchPhase
applying patch /nix/store/46rxbbvl2l3mrxb50y9rzy7ahgx0lraj-d741901dddd731895346636c0d3556c6fa51fbe6.patch
patching file tests/hazmat/primitives/test_aead.py
Hunk #1 FAILED at 56.
Hunk #2 FAILED at 197.
Hunk #3 FAILED at 378.
Hunk #4 FAILED at 525.
Hunk #5 FAILED at 700.
Hunk #6 FAILED at 844.
6 out of 6 hunks FAILED -- saving rejects to file tests/hazmat/primitives/test_aead.py.rej
copying path '/nix/store/mkaa3p5xxmpq0n25p7wcp95j63a4ngrq-clr-5.7.1-icd' from 'https://cache.nixos.org'...
downloading 'https://cache.nixos.org/nar/17s60wkkzanx1m5krlrcf1ircgqczxfprs6wifx3m2x29nb307mw.nar.xz'...
error: builder for '/nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv' failed with exit code 1

...

error: 1 dependencies of derivation '/nix/store/n07pa6agb3ccwvv3hgw3h77mlckniky5-python3-3.10.13-env.drv' failed to bu
ild
error: 1 dependencies of derivation '/nix/store/da0wg3d74m9dy48j32lhsvcaihw77slb-ceph-18.2.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/26r98hhkf2hwdmyp7d7grzbn1yhycsby-samba-4.19.4.drv' failed to build
building '/nix/store/7080l556w62lyhb5m5kxvykp65nn5680-steam-fhs.drv'...
building '/nix/store/8ifnxxhha3pcj36sv7bysk492y3qd60c-steam-run-fhs.drv'...
building '/nix/store/4cmxni2g32cxfq14ay5sgfqvd2cv3jqg-zulip-5.10.5-fhs.drv'...
error: 1 dependencies of derivation '/nix/store/fi549hv3v2lkfd3gd2ysi6mvvq0y1mns-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hal4185gxmsdkd8kbvd0j4sm8bd7k0qm-unit-samba-nmbd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/24i0smb4fkbfc9zrn0al0ajrhb5q325b-unit-samba-smbd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x8hbczxnksa8rf68y7h1pcga46513cxc-unit-samba-winbindd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q0m16a4idwhf29qaf7fx6xj60zb4lm25-nixos-system-z10pe-d8-24.05pre583447.f9d39fb9aff0.drv' failed to build

So a Python 3 crypography lib is the new culprit. I actually need its dependencies, namely Samba, so can’t solve it by deleting this time.

That’s odd, are you doing anything special with nixpkgs? python-cryptography is pretty widely used and is building on nixos-unstable for me. I’d ask to see your flake but it doesn’t look like you’re using one :slightly_frowning_face:.

2 Likes

I have flakes enabled but am not using any yet, still a monolithic configuration.nix on nixos-unstable. In the process of transitioning, just haven’t had a sufficiently free block of time to do it yet. This error may provide additional impetus though.

I’m not doing anything special with nixpkgs that I know of. I ran your suggested command and here’s the output:

$> nix build -L '/nix/store/3rvi495ijsn63fazapx06ym3yxzkvw0m-nixos-system-z10pe-d8-24.05pre583447.f9d39fb9aff0.drv^*'
opengl-drivers> created 76 symlinks in user environment

...

error: builder for '/nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: patchPhase
       > applying patch /nix/store/46rxbbvl2l3mrxb50y9rzy7ahgx0lraj-d741901dddd731895346636c0d3556c6fa51fbe6.patch
       > patching file tests/hazmat/primitives/test_aead.py
       > Hunk #1 FAILED at 56.
       > Hunk #2 FAILED at 197.
       > Hunk #3 FAILED at 378.
       > Hunk #4 FAILED at 525.
       > Hunk #5 FAILED at 700.
       > Hunk #6 FAILED at 844.
       > 6 out of 6 hunks FAILED -- saving rejects to file tests/hazmat/primitives/test_aead.py.rej
       For full logs, run 'nix log /nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv'.
error: 1 dependencies of derivation '/nix/store/n07pa6agb3ccwvv3hgw3h77mlckniky5-python3-3.10.13-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/da0wg3d74m9dy48j32lhsvcaihw77slb-ceph-18.2.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/26r98hhkf2hwdmyp7d7grzbn1yhycsby-samba-4.19.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/w44acsjzansh8shxshsi02gi4x8ilxs0-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hal4185gxmsdkd8kbvd0j4sm8bd7k0qm-unit-samba-nmbd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/24i0smb4fkbfc9zrn0al0ajrhb5q325b-unit-samba-smbd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x8hbczxnksa8rf68y7h1pcga46513cxc-unit-samba-winbindd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3rvi495ijsn63fazapx06ym3yxzkvw0m-nixos-system-z10pe-d8-24.05pre583447.f9d39fb9aff0.drv' failed to build

$>

And here’s the referenced full log:

$> nix log /nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv

Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pypa-build-hook
Using pypaBuildPhase
Sourcing python-runtime-deps-check-hook
Using pythonRuntimeDepsCheckHook
Sourcing pypa-install-hook
Using pypaInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing setuptools-rust-hook
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/99sqf8x328vb51r0syd0b5l02w8p1wvq-cryptography-40.0.1.tar.gz
source root is cryptography-40.0.1
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/c2k2j9xrj9mmzbr6y84bawgx5723srp6-cryptography-40.0.1-vendor.tar.gz
Finished cargoSetupPostUnpackHook
setting SOURCE_DATE_EPOCH to timestamp 1679706793 of file cryptography-40.0.1/setup.cfg
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
applying patch /nix/store/46rxbbvl2l3mrxb50y9rzy7ahgx0lraj-d741901dddd731895346636c0d3556c6fa51fbe6.patch
patching file tests/hazmat/primitives/test_aead.py
Hunk #1 FAILED at 56.
Hunk #2 FAILED at 197.
Hunk #3 FAILED at 378.
Hunk #4 FAILED at 525.
Hunk #5 FAILED at 700.
Hunk #6 FAILED at 844.
6 out of 6 hunks FAILED -- saving rejects to file tests/hazmat/primitives/test_aead.py.rej

As far as I can tell, that’s build a very old version, it looks like from a deprecated nixpkgs channel:

https://search.nixos.org/packages?channel=23.05&from=0&size=50&sort=relevance&type=packages&query=python+cryptography

Not sure if that’s intentional or not.

1 Like

Definitely not intentional. I have a clone of nixpkgs github repo on my hard drive, but no apparent references to it in configuration.nix. Both user and root user channels are set to nixos-unstable:

$> nix-channel --list                                                                        
nixos https://nixos.org/channels/nixos-unstable

$> sudo nix-channel --list
[sudo] password for bgibson: 
nixos https://nixos.org/channels/nixos-unstable

Going to delete nixpkgs on my hard drive and see if that does anything.

So, the channel looks fine, but it seems like you aren’t upgrading it!

Try one of these:

  • sudo nixos-rebuild -v --upgrade --show-trace boot
    

or

  • sudo nix-channel --update nixpkgs
    sudo nixos-rebuild -v --show-trace boot
    

Of course making sure that you do the upgrade as root, if you do the build as root. Which isn’t necessarily a given. :no_good_man:.

coughing that sounds like someone saying “flakes”. :snowflake: :white_check_mark:

2 Likes

Ok, forgive me :see_no_evil:, I looked up channel commands, so I have to say two more nice things about flakes.

  1. In this case you would have known from (1) source history for flake.lock, and (2) manual inspection, both that (1) you weren’t updating, (2) the exact revision of nixpkgs and source you were on.
  2. While nix-channel has --rollback, I don’t know how it handles multiple rollbacks. And I don’t really want to, when I know how to use git log flake.lock or whatnot.
1 Like

Oh thanks, though I use the --upgrade normally, and did for all initial attempts at this build. I just removed it in case it was the culprit, and then posted the results without it here in anticipation someone would suggest running the build without it :).

I think I’m just going to take this as a sign that it’s time to convert to flakes and get that done now :slight_smile:

Whelp, I flake-ified my system with a simple flake.nix that imports configuration.nix, and some minor changes to configuration.nix to make it compatible. Still getting the same error with that python crypto library though:

$> sudo nixos-rebuild boot -v --show-trace --update --flake /persist/etc/nixos/flake.nix

$ nix --extra-experimental-features nix-command flakes build --out-link /tmp/nixos-rebuild.ck8mlL/nixos-rebuild /persist/etc/nixos/flake.nix#nixosConfigurations."z10pe-d8".config.system.build.nixos-rebuild -v --show-trace
path '/persist/etc/nixos/flake.nix' does not contain a 'flake.nix', searching up
$ exec /nix/store/02bcny6zbi9a2sl93v7dcm4snnar43px-nixos-rebuild/bin/nixos-rebuild -v --show-trace boot --upgrade --flake /persist/etc/nixos/flake.nix
building the system configuration...
Building in flake mode.
$ nix --extra-experimental-features nix-command flakes build /persist/etc/nixos/flake.nix#nixosConfigurations."z10pe-d8".config.system.build.toplevel -v --show-trace --out-link /tmp/nixos-rebuild.wripvE/result
path '/persist/etc/nixos/flake.nix' does not contain a 'flake.nix', searching up
trace: warning: Enabling both boot.enableContainers & virtualisation.containers on system.stateVersion < 22.05 is unsupported.

these 109 derivations will be built:
  /nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv
  /nix/store/jprrsyvwsil8jhwy1is8j1n6wfnmps9q-python3.10-dnspython-2.4.2.drv

...

building '/nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv'...
building '/nix/store/rvp98r564nixcn18aiarilmkgbxfs2fk-cuda_12.2.2_535.104.05_linux.run.drv'...
error: builder for '/nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: patchPhase
       > applying patch /nix/store/46rxbbvl2l3mrxb50y9rzy7ahgx0lraj-d741901dddd731895346636c0d3556c6fa51fbe6.patch
       > patching file tests/hazmat/primitives/test_aead.py
       > Hunk #1 FAILED at 56.
       > Hunk #2 FAILED at 197.
       > Hunk #3 FAILED at 378.
       > Hunk #4 FAILED at 525.
       > Hunk #5 FAILED at 700.
       > Hunk #6 FAILED at 844.
       > 6 out of 6 hunks FAILED -- saving rejects to file tests/hazmat/primitives/test_aead.py.rej
       For full logs, run 'nix log /nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv'.
error: 1 dependencies of derivation '/nix/store/n07pa6agb3ccwvv3hgw3h77mlckniky5-python3-3.10.13-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/da0wg3d74m9dy48j32lhsvcaihw77slb-ceph-18.2.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/26r98hhkf2hwdmyp7d7grzbn1yhycsby-samba-4.19.4.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-protontricks-1.11.0.drv-0/pytest-of-nixbld/pytest-0': Directory not empty
error: 1 dependencies of derivation '/nix/store/29rk6zkgbdbw4i5yj61dis5yvndycmf2-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hal4185gxmsdkd8kbvd0j4sm8bd7k0qm-unit-samba-nmbd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/24i0smb4fkbfc9zrn0al0ajrhb5q325b-unit-samba-smbd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x8hbczxnksa8rf68y7h1pcga46513cxc-unit-samba-winbindd.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/y0lpm65jglr41vfgnp53a5sbk6sk46qm-nixos-system-z10pe-d8-24.05.20240211.f9d39fb.drv' failed to build
$> nix log /nix/store/pqh7hfnqbrs9812j8ripl1081rarvvgz-python3.10-cryptography-40.0.1.drv

Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pypa-build-hook
Using pypaBuildPhase
Sourcing python-runtime-deps-check-hook
Using pythonRuntimeDepsCheckHook
Sourcing pypa-install-hook
Using pypaInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing setuptools-rust-hook
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/99sqf8x328vb51r0syd0b5l02w8p1wvq-cryptography-40.0.1.tar.gz
source root is cryptography-40.0.1
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/c2k2j9xrj9mmzbr6y84bawgx5723srp6-cryptography-40.0.1-vendor.tar.gz
Finished cargoSetupPostUnpackHook
setting SOURCE_DATE_EPOCH to timestamp 1679706793 of file cryptography-40.0.1/setup.cfg
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
applying patch /nix/store/46rxbbvl2l3mrxb50y9rzy7ahgx0lraj-d741901dddd731895346636c0d3556c6fa51fbe6.patch
patching file tests/hazmat/primitives/test_aead.py
Hunk #1 FAILED at 56.
Hunk #2 FAILED at 197.
Hunk #3 FAILED at 378.
Hunk #4 FAILED at 525.
Hunk #5 FAILED at 700.
Hunk #6 FAILED at 844.
6 out of 6 hunks FAILED -- saving rejects to file tests/hazmat/primitives/test_aead.py.rej

Disabling the tor-browser package, and services.samba and services.samba-wsdd solved the problem, system builds without those.