Skip to content

Add improved logging around command failures#2351

Merged
palfrey merged 1 commit into
TraceMachina:mainfrom
palfrey:better-running-manager-logs
May 20, 2026
Merged

Add improved logging around command failures#2351
palfrey merged 1 commit into
TraceMachina:mainfrom
palfrey:better-running-manager-logs

Conversation

@palfrey
Copy link
Copy Markdown
Member

@palfrey palfrey commented May 20, 2026

Description

Split out from #2321, improving a couple of cases of command failure logging that I've seen while working on that.

Type of change

Please delete options that aren't relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

bazel test //..., various local LRE testing

Checklist

  • Updated documentation if needed
  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

exit_code = ?execution_result.exit_code,
stdout = ?stdout[..min(stdout.len(), 1000)],
stderr = ?stderr[..min(stderr.len(), 1000)],
command = ?command_proto.arguments,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error was just Command returned non-zero exit code, exit_code: 1, stdout: "", stderr: "bootstrap_process_wrapper: execvp: No such file or directory\n" or similar, now we get the full command which helps debugging a lot

let program = self.canonicalise_path(args[0], &command_proto.working_directory)?;
let program = self
.canonicalise_path(args[0], &command_proto.working_directory)
.err_tip(|| format!("Canonicalisation failure. Command={args:#?}"))?;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error executing action, err: Error { code: NotFound, messages: ["No such file or directory (os error 2)", "Could not canonicalize path for command root /bin/bash."] } isn't very useful without knowing what was trying to invoke bash


```sh
nix run create-local-image
create-local-image
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous command just got you error: cannot find flake 'flake:create-local-image' in the flake registries, new one actually works :)

@palfrey palfrey force-pushed the better-running-manager-logs branch from 132c0ff to c3daa29 Compare May 20, 2026 15:28
@palfrey palfrey marked this pull request as ready for review May 20, 2026 16:08
@palfrey palfrey merged commit 0cf6af7 into TraceMachina:main May 20, 2026
44 checks passed
@palfrey palfrey deleted the better-running-manager-logs branch May 20, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants