Skip to content

Intermittent failed to get edge: inconsistent graph state errors #6234

Closed

Description

@jedevc

We occasionally see jobs fail with this nasty internal buildkit issue: moby/buildkit#2303 (creating this as a place to track and follow this, and also helping discoverability for users).

goroutine 197 [running]:
github.com/dagger/dagger/internal/mage/util.goSDKImageTarBall(0xc000b269c0, {0x8229b1, 0x5})
	/runner/_work/dagger/dagger/internal/mage/util/engine.go:365 +0x9d6
github.com/dagger/dagger/internal/mage/util.devEngineContainer(0xc00023a080?, {0x8229b1, 0x5}, {0x0, 0x0}, {0xc00047a9c0, 0x2, 0x2})
	/runner/_work/dagger/dagger/internal/mage/util/engine.go:240 +0x8d3
github.com/dagger/dagger/internal/mage/util.CIDevEngineContainer(0xc000b269c0, {0xc000235b78, 0x1, 0xc00047a900?})
	/runner/_work/dagger/dagger/internal/mage/util/engine.go:183 +0x1c8
github.com/dagger/dagger/internal/mage/util.CIDevEngineContainerAndEndpoint({0x8ca940, 0xc00045e140}, 0xa?, {0xc000235b78?, 0x0?, 0x0?})
	/runner/_work/dagger/dagger/internal/mage/util/engine.go:141 +0x38
github.com/dagger/dagger/internal/mage/sdk.Nodejs.Generate({}, {0x8ca940, 0xc00045e140})
	/runner/_work/dagger/dagger/internal/mage/sdk/nodejs.go:108 +0x1e5
github.com/dagger/dagger/internal/mage/sdk.Nodejs.Lint.func3.1()
	/runner/_work/dagger/dagger/internal/mage/sdk/nodejs.go:65 +0x1b
github.com/dagger/dagger/internal/mage/sdk.lintGeneratedCode(0xc000179f50, {0xc000c7ff40, 0x1, 0x1})
	/runner/_work/dagger/dagger/internal/mage/sdk/all.go:103 +0x245
github.com/dagger/dagger/internal/mage/sdk.Nodejs.Lint.func3()
	/runner/_work/dagger/dagger/internal/mage/sdk/nodejs.go:64 +0x70
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 6
	/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0x96
exit status 2

From https://github.com/dagger/dagger/actions/runs/7129797816/job/19414688893?pr=6221

This is similar in style to #6111, but probably got quite a different root cause.

At the time of writing, this was last observed on dagger v0.9.3 (using moby/buildkit@86e25b3, which does include the latest attempts to fix moby/buildkit#2303). This was the full config:

5.10.199-190.747.amzn2.x86_64
containerd://1.7.2
v1.26.10-eks
engine:v0.9.3

cc @sipsma

Activity

  1. vito commented on Jan 30, 2024

    @vito
    Contributor
  2. jedevc commented on Jan 30, 2024

    @jedevc
    ContributorAuthor

    This one is #6111

    These all happened within the same suite, so I wonder if there's a common element (load? race condition?).

    While I'm not sure about the same suite, I know that these all tend to occur "around the same time". I think this is a result of scheduling multiple jobs to the same dagger server in our kubernetes cluster - when one of them panics and dies, this causes a bunch of jobs to fail. I don't have a good way to confirm this though - I don't think we have the visibility to see what gets scheduled where and alongside what.

    Is there anyway we could grab logs for the engine that failed? cc @matipan

  3. gerhard commented on Jan 30, 2024

    @gerhard
    Contributor

    No, and this is what we really must do as soon as possible:

    This is the next item as soon as we finish the current in-flight.

  4. kjuulh commented on Feb 13, 2024

    @kjuulh
    Contributor

    I just want to pitch in and say that we're also beginning to see this issue. A restart of the shared runner solves the issue, again it seems to occur around a merge commit for some reason.

  5. levlaz commented on Mar 29, 2024

    @levlaz
    Contributor

    We are seeing this with a team that is doing a POC of dagger right now. Is there any way to retry a steps that fail this way?

    Or, is there any chance that we could automatically retry when this happens?

  6. sipsma commented on Apr 2, 2024

    @sipsma
    Contributor

    Spent a very long time trying to repro this bug locally and while I have a reasonable idea of what might trigger it and hit some suspicious code paths, have not managed to actually hit the error yet. So I think we just need to add more logging and wait for it to happen again; sent a PR upstream here with some more details on my progress so far in trying to repro: moby/buildkit#4818

    We are seeing this with a team that is doing a POC of dagger right now. Is there any way to retry a steps that fail this way?
    Or, is there any chance that we could automatically retry when this happens?

    I think we just need to figure it out and fix it; we haven't really looked intensively into it until now (afaik). Worst case scenario if it's somehow the world's greatest mystery and we can't figure it out, then sure we can try mitigations but I suspect with more logging we'll be able to finally figure it out.

  7. levlaz commented on Apr 2, 2024

    @levlaz
    Contributor
  8. kjuulh commented on Apr 5, 2024

    @kjuulh
    Contributor

    Let us know how we can help debug this. We run quite a few builds and see this intermittently (I'd guess around 300+ a day or so). At least once a day or so (we're not yet on dagger cloud org wise).

  9. sipsma commented on Apr 26, 2024

    @sipsma
    Contributor

    More details in #7128, but ended up being able to very consistently repro the #6111 error locally and figured out the bug upstream, fix there moby/buildkit#4887

    I never was able to repro the inconsistent graph state error specifically, but based on reading the buildkit scheduler code I suspect it has the same root cause, so hopefully this will be fixed once upstream gets picked up and do a release. Will leave this open for now.

  10. sipsma commented on Jun 5, 2024

    @sipsma
    Contributor

    There was hope that we'd fixed this alongside the fix for #6111 but, while the other one has disappeared, this error message did pop up again unfortunately: #7517 (comment)

    So seems to have a different root cause after all.

  11. added
    kind/flake
    on Oct 10, 2024
  12. jedevc commented on Oct 10, 2024

    @jedevc
    ContributorAuthor

    We haven't seen this one in a while - I wonder if we should close it?

  13. sipsma commented on Oct 10, 2024

    @sipsma
    Contributor

    We haven't seen this one in a while - I wonder if we should close it?

    Yeah it's been a very long time, will close until proven wrong 🙂

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

    kind/flake

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions