NixOS / ofborg

@ofborg tooling automation https://monitoring.ofborg.org/dashboard/db/ofborg

Home Page:https://ofborg.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some PRs trigger: code: 2, kind: NotFound, message: "No such file or directory"

doronbehar opened this issue · comments

I see this error on several PRs with seemingly OK syntax:

Failed during the setup of executing nix-env: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Examples:

If the PRs themselves have something wrong with them, I think at least the error message could be better?

There's also this error coming out for me.

This is because ofborg currently propagates IO errors with little-to-no context. The problematic function could be one of these two:

fn place_nix(&self) -> Result<(), std::io::Error> {

fn remove_nix(&self) -> Result<(), std::io::Error> {

because any std::io::Error gets transformed to the local Error enum via this line:

Error::Io(e) => format!("Failed during the setup of executing nix-env: {:?}", e),

losing all context. I'm working on a PR for this that should give more context, like what operation actually failed (was it creating the file? Removing it? Writing to it?), but I don't know what other information would be helpful, or even if that other information could be displayed.


The internal error tag is when something goes really wrong inside ofborg. Currently, Graham manually removes these (in order to allow himself to investigate the cause, first). Assuming it evals + builds, I would say don't worry about it (unless someone else says otherwise).

The root cause appears to be: if the nix invocation fails (like when evaluating), the stats file won't be created (example log: https://gist.github.com/GrahamcOfBorg/9dfb034692a8b8397c6bdc476c6910ec). My follow-up PR at #449 demotes this to a logged warning, and should let it get to the point where ofborg reports an actual evaluation error.

EDIT: If this resurfaces, feel free to re-open or open a new issue and ping me. I'll look into it.