Invalid package attribute path `nextcloud19`

Trying to build my system after a channel update of nixos-20.03-small yields an error: Invalid package attribute path nextcloud19 with the trace:

$ sudo nixos-rebuild build --show-trace
building Nix...
building the system configuration...
error: while evaluating the attribute 'activationScript' of the derivation 'nixos-system-perscitia-20.03.2680.c9f5211b769' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:103:5:
while evaluating the attribute 'system.activationScripts.script' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:68:9:
while evaluating 'textClosureMap' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings-with-deps.nix:70:35, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:89:18:
while evaluating 'id' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:14:5, called from undefined position:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:9:5:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings-with-deps.nix:77:38:
while evaluating the attribute 'sources' of the derivation 'etc' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:12:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute 'source' at undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:84:45, called from undefined position:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:379:9:
while evaluating the option `environment.etc.dbus-1.source':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:411:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:413:22, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:413:9:
while evaluating 'check' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:251:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:414:14:
while evaluating the attribute 'serviceDirectories' of the derivation 'dbus-1' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:263:14, called from undefined position:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:425:27:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:413:22, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:413:9:
while evaluating 'check' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:251:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:414:14:
while evaluating the attribute 'passAsFile' of the derivation 'system-path' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'buildCommand' of the derivation 'nixos-manpages' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'buildCommand' of the derivation 'manual-olinkdb' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'buildCommand' of the derivation 'nixos-manual-combined' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'buildCommand' of the derivation 'generated-docbook' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'buildCommand' of the derivation 'options-docbook.xml' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating 'genRelatedPackages' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/nixos/lib/make-options-doc/default.nix:51:24, called from
/nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/nixos/lib/make-options-doc/default.nix:39:99:
while evaluating anonymous function at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/nixos/lib/make-options-doc/default.nix:70:57, called from undefined position:
while evaluating 'describe' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/nixos/lib/make-options-doc/default.nix:56:18, called from /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/nixos/lib/make-options-doc/default.nix:70:60:
while evaluating 'attrByPath' at /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/lib/attrsets.nix:24:35, called from /nix/store/dldz9i859k6yx6p4klakns6kh64d097l-source/nixos/lib/make-options-doc/default.nix:61:38:
Invalid package attribute path `nextcloud19'

which I’m having trouble deciphering. A previous channel version does not yield this error; if the reason for this error isn’t apparent I’ll dig the hash up. The configuration I’m trying to build is available at https://github.com/tmplt/nixos-config/blob/c22795e590f2581e19701b5fa31c660a545018d4/systems/laptop.nix, but nowhere do I refer to a nextcloud19 attribute, nor does the home-manager revision I’m pulling in.

Is something up with the channel or must I fix something locally? Cheers.

ping @Ma27 who can share details. I believe if you look at the release notes in unstable that may help as well.

Hmm this is fairly weird, sorry for the inconvenience! Will investigate tomorrow.

Hi @Tmplt,

unfortunately I cannot reproduce this, not even with your config (and -I nixpkgs=channel:nixos-20.03-small). Can you please tell me which rev is in use (and if you have any overlays)?

Ideally, I’d like to have a VM-expression that is buildable using nixos-build-vms(8) with a given <nixpkgs>.

Thanks!

nix-info reports channels(root): "nixos-20.03.2680.c9f5211b769"; but I don’t know if this is the rev of my current working derivation or HEAD of my local channel I’m trying to build with. I don’t have any overlays (unless home-manager counts); everything I use should be defined in the linked configuration.

Nice, I’m finally able to reproduce it with the following command:

$ nixops deploy -d tmp --build-only --show-trace --include perscitia

Will try to track down the error today :slight_smile:

@Tmplt I found the problem: you need to bump the nixpkgs checkouts in nixpkgs-pin.nix as those don’t provide pkgs.nextcloud19, however the nextcloud-module uses the relatedPackages-option for the manual which expects pkgs.nextcloud19 to exist.

If you don’t want to upgrade your pkgs-revs, you can disable the nextcloud-module entirely like this:

{ disabledModules = [ "services/web-apps/nextcloud.nix" ]; }
1 Like

Thanks for figuring it out. But Nix is lazy; if I don’t use nextcloud-module, why does it evaluate? Is it the workings of relatedPackages? Am I using a module that relates to nextcloud and so pkgs.nextcloud19 is expected?

You’re absolutely right, Nix (and the module system) are lazy by design. Also, after taking a brief look at your config I don’t see anything related to the Nextcloud server-module.

However generating a manual which contains documentation for all options available isn’t as lazy and expects all option definitions (not the option’s values though) to be valid. In fact, whenever you build your system configuration, a version of the NixOS manual is built by default as well for man configuration.nix and nixos-help (if you want to skip the manual build, you can declare documentation.enable = false;).

In order to understand why the module (to be precise, the option services.nextcloud.package) broke your evaluation, you may want to take a look at the option’s definition (which needs to be valid for the manual build):

As you can see, the option expects a package which contains the Nextcloud server. The relatedPackages option specifies a list of possible values (i.e. the currently packaged major versions of Nextcloud that are supported by this module).

The manual-builder links the packages to the options in the end and thus expects those to exist.

Does this explain the issue to you?

@Tmplt I acknowledge though that tracking this down can be fairly hard. To make sure people will find this faster in the future, I filed a PR which improves the error-message: nixos/manual: improve error message for invalid values in `relatedPackages' by Ma27 · Pull Request #94611 · NixOS/nixpkgs · GitHub

Yes, it does. Thanks.