Skip to content

"attribute '%s' is %s, which is not supported" error silently discarded, leading to continuous retrying of evaluation #1390

Open
@srd424

Description

@srd424

Describe the bug
If the nix expression to be evaluated contains unexpected attributes, a TypeError is raised:

else state.error<TypeError>("attribute '%s' is %s, which is not supported", attrPath, showType(*v)).debugThrow();

However only EvalErrors are actually caught:

} catch (EvalError & e) {
auto msg = e.msg();
// Transmits the error we got from the previous evaluation
// in the JSON output.
reply["error"] = filterANSIEscapes(msg, true);
// Don't forget to print it into the STDERR log, this is
// what's shown in the Hydra UI.
printError(msg);

This seems to lead to (a) the error message being silently discarded (it does not end up in any logs), and (b) the evaluation is continuously retried, presumably because it is never marked as failed.

To Reproduce

I hit this trying to build https://git.auxolotl.org/auxolotl/labs/src/commit/8e9cb4fbe92205d0256bb9bc759f86c5d45ca487/tidepool/default.nix without realising I needed to select the packages attribute.

Expected behavior

The error message should be reported somewhere visible to the end-user (or at minimum, the administrator), and the evaluation should fail cleanly, not loop indefinitely.

Hydra Server:

Please fill out this data as well as you can, but don't worry if you can't -- just do your best.

  • OS and version: NixOS 23.11.7042.9a9960b98418
  • Version of Hydra: from nixpkgs .7042.9a9960b98418
  • Version of Nix Hydra is built against: n/a
  • Version of the Nix daemon: nix-daemon (Nix) 2.18.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions