Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
srd424 opened this issue Jun 17, 2024 · 0 comments
Labels

Comments

@srd424
Copy link

srd424 commented Jun 17, 2024

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
@srd424 srd424 added the bug label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant