Skip to content

Include output of failed exec in graphql errors #3025

Closed

Description

@sipsma

Right now if an exec fails the graphql error just says that it exited non-zero. This makes it hard to debug unless you go look at the buildkit progress output.

We should instead include the output of the execop in the graphql error to help debugging. The implementation is not incredibly straightforward. Buildkit has the ability to obtain the FS of a failed exec op (including changes made during the command): https://github.com/moby/buildkit/blob/c9a0f4d2de095591e742d7f411d9ed36a03a1c4e/client/build_test.go#L1278-L1310

We will probably need to use that to obtain the output as written to the output files by the shim.

We should also make sure to limit the size of the output included so if there's a failure during a command with many megabytes of output (e.g. compiling a large project) we don't try to transfer all of that in the error. Instead, we can just return the last N bytes.

Activity

  1. added this to the Cloak GA milestone on Sep 16, 2022
  2. transferred this issue fromdagger/cloakon Sep 16, 2022
  3. dolanor commented on Dec 2, 2022

    @dolanor
    Contributor

    I helped somebody that got hit by that today.
    They used container.Stderr(ctx) and got nothing in it, even though they saw the build failed.
    The only way to diagnose was to set the LogOutput to something they could see after the fact. Not great.

  4. added
    area/engine
    and removed on Dec 5, 2022
  5. sipsma commented on Dec 9, 2022

    @sipsma
    ContributorAuthor

    Buildkit v0.11 is adding a way of retrieving execution logs after a build finishes, so hopefully that will make it somewhat easier to implement this relative to the huge song+dance required to get the FS of a failed exec op.

  6. shykes commented on Jan 5, 2023

    @shykes
    Contributor

    @sipsma I'm talking to a developer that is hitting this issue, which is confusing because the issue seems fixed? Do you know which release this fix was part of? Perhaps they just need to upgrade.

  7. sipsma commented on Jan 5, 2023

    @sipsma
    ContributorAuthor

    @shykes it has not been released yet, there's a few more issues that we need to close before we do the next release: https://github.com/dagger/dagger/milestone/16

    Most of those PRs have approval as of this morning, so we can do the release perhaps as early as tomorrow (or monday if we want to avoid the dreaded friday release)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/engine

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions