Skip to content

ephemeral context canceled errors #7699

Closed

Description

@sipsma

This context canceled error has been reported by users and seen occasionally in CI. Most recent occurrence I saw was here https://github.com/dagger/dagger/actions/runs/9551005799/job/26324343803

That passed on many re-runs and also tried running SDK tests again in commits around it without it happening again.

I've been trying to repro what happens in that elixir SDK check failure locally since yesterday but have not replicated it.

  • To be clear, I don't think this has anything to do with the elixir SDK, the error in that occurrence was just on trying to load the dagger ci module (happens implicitly when echo {version} | dagger -s query runs in the dir with our CI module).

Interestingly, whenever I've seen this happening in our CI it has been during module initialization calls. Things that stick out about that are:

  • It's cached, unlike other function calls.
  • It potentially gets run in parallel fairly often
  • Both of those may impact edge merge behavior, which is an eternal suspect in generally weird issues like this

Since I've had no luck in repro'ing so far, I may try locally enabling caching of all function calls and see if I can hit this, just on the hunch this may have something to do with the caching/edge-merging.

Activity

  1. added
    kind/bug
    area/engine
    on Jun 18, 2024
  2. self-assigned this
    on Jun 18, 2024
  3. sipsma commented on Sep 26, 2024

    @sipsma
    ContributorAuthor

    Fixed a problem with the debug logs around this issue and made a change that should result in user-facing errors having more information required to debug this: #8553

    Still quite rare and have not hit it locally or in my deflaking PR, so continuing to rely on those logs+error messages to make progress atm

  4. sipsma commented on Sep 30, 2024

    @sipsma
    ContributorAuthor

    Caught this with the updated logs here:

    failed to compute cache key: context canceled: github.com/moby/buildkit/solver.(*edge).createInputRequests.(*edge).createInputRequests.func1.func2
    

    Need to follow up with investigation into that code in buildkit, but finally have a new breadcrumb to work with here

    EDIT: nevermind, I think this is just pointing to https://github.com/sipsma/buildkit/blob/e15601a00fbef2805db1ed87be7bb88628ae926b/solver/edge.go#L910-L910

    which is the place the failed to compute cache key error comes from, so something in the stack trace parsing is off.

  5. sipsma commented on Oct 10, 2024

    @sipsma
    ContributorAuthor

    I looked at the most recent occurrence mentioned in previous comment again, this time I through shenanigans managed to get the nested engine logs out of the traces (without my browser crashing). Full output here: https://gist.github.com/sipsma/cbe519dbc25b02b5e882b9d6f08a4457

    Relevant lines that reveal more of the stack trace embedded in the error:

    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=0 dest_vertex_digest="sha256:9b7d97b5b7b9089ca17db62be4eef3251322c581fe783a403f2175cce89d5f32" dest_vertex_name="copy / /src" source_edge_index=0 source_edge_vertex_digest="sha256:165d6c256294be63362a4e72d1fbcbe01d555976e007c233bbc4047e2625632e" source_edge_vertex_name="copy / /src"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=0 dest_vertex_digest="sha256:50479913df904a18d67e4d824b44264b16ea203e3bdd0610b5fc3ef6e40277aa" dest_vertex_name="[internal] merge" source_edge_index=0 source_edge_vertex_digest="sha256:90fed5c51e39c329acc93549bbd2922b643f186950b9e5c4dde6c931bb80d2d6" source_edge_vertex_name="[internal] merge"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=0 dest_vertex_digest="sha256:d10791df523eda103a40333a7fdc0e4ee778103cd56951a95f38408705f343d3" dest_vertex_name="[internal] merge" source_edge_index=0 source_edge_vertex_digest="sha256:6209f24fe5a4899fb589143fe1225f1571ee9cfe138fa05eb637eb8a2b0ea362" source_edge_vertex_name="[internal] merge"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=0 dest_vertex_digest="sha256:ab0fa60c72d62aa1a48071f01f137e6507b51c92ef2a161ee7f729fba423c424" dest_vertex_name="[internal] exec tsx /opt/module/bin/__tsconfig.updator.ts" source_edge_index=0 source_edge_vertex_digest="sha256:968b8e600189d1b24e475cb025c94677fdf19e7de50b3cd308b340d2fe0668e6" source_edge_vertex_name="[internal] exec tsx /opt/module/bin/__tsconfig.updator.ts"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=2 dest_vertex_digest="sha256:ab0fa60c72d62aa1a48071f01f137e6507b51c92ef2a161ee7f729fba423c424" dest_vertex_name="[internal] exec tsx /opt/module/bin/__tsconfig.updator.ts" source_edge_index=2 source_edge_vertex_digest="sha256:968b8e600189d1b24e475cb025c94677fdf19e7de50b3cd308b340d2fe0668e6" source_edge_vertex_name="[internal] exec tsx /opt/module/bin/__tsconfig.updator.ts"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=2 dest_vertex_digest="sha256:f125e916c2f20f1cbfb341976f48f049c8f37d510fdf8537f9a7fcb5ccfc67e7" dest_vertex_name="[internal] exec npm pkg set type=module" source_edge_index=2 source_edge_vertex_digest="sha256:bfa9a825eaa334cd71c2ff3a19f8e3e7252fc935fa028d7266412b7cd1f22645" source_edge_vertex_name="[internal] exec npm pkg set type=module"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=0 dest_vertex_digest="sha256:f125e916c2f20f1cbfb341976f48f049c8f37d510fdf8537f9a7fcb5ccfc67e7" dest_vertex_name="[internal] exec npm pkg set type=module" source_edge_index=0 source_edge_vertex_digest="sha256:bfa9a825eaa334cd71c2ff3a19f8e3e7252fc935fa028d7266412b7cd1f22645" source_edge_vertex_name="[internal] exec npm pkg set type=module"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=0 dest_vertex_digest="sha256:c88ca6b93220b6929c67d59fd8c371144d88c274de6bc36712a3a4ee0512e6f8" dest_vertex_name="[internal] exec npm pkg set dependencies[@dagger.io/dagger]=./sdk" source_edge_index=0 source_edge_vertex_digest="sha256:7393a1a6d259f61c76989c776b3ba6343d96af454964c28949c1808e152bbe78" source_edge_vertex_name="[internal] exec npm pkg set dependencies[@dagger.io/dagger]=./sdk"
    
    time="2024-09-29T05:03:27Z" level=debug msg="merging edges" dest_index=2 dest_vertex_digest="sha256:c88ca6b93220b6929c67d59fd8c371144d88c274de6bc36712a3a4ee0512e6f8" dest_vertex_name="[internal] exec npm pkg set dependencies[@dagger.io/dagger]=./sdk" source_edge_index=2 source_edge_vertex_digest="sha256:7393a1a6d259f61c76989c776b3ba6343d96af454964c28949c1808e152bbe78" source_edge_vertex_name="[internal] exec npm pkg set dependencies[@dagger.io/dagger]=./sdk"
    
    time="2024-09-29T05:03:27Z" level=error msg="ref evaluate error: context canceled\nfailed to compute cache key\ngithub.com/moby/buildkit/solver.(*edge).createInputRequests.(*edge).createInputRequests.func1.func2\n\t/go/pkg/mod/github.com/moby/[email protected]/solver/edge.go:912\ngithub.com/moby/buildkit/solver/internal/pipe.NewWithFunction.func2\n\t/go/pkg/mod/github.com/moby/[email protected]/solver/internal/pipe/pipe.go:82\nruntime.goexit\n\t/usr/lib/go/src/runtime/asm_amd64.s:1700" client_hostname=buildkitsandbox client_id=yagg71x4tfiif26pgm1itb5qj session_id=yeski1f7u29j160iqyy6le3xp spanID=995e7b387b088431 traceID=eaf8be8f50c029ffe37def2ce8a1b2cd
    

    FWICT it's just saying that the context created here got cancelled due to an op becoming completed while it's in the middle of doing the slow cache key compute??

    • If this is on the right track this smells a bit more like a buildkit solver bug, but hard to say for sure still

    The chunk of edge merges that happen right before are suspicious too.

    Also quite interesting, I saw a few occurrences of other unexpected solver behavior a little bit before the error happened:

    time="2024-09-29T05:03:16Z" level=error msg="merged input vertex not found during addJobs" vertex_digest="sha256:fb008f6e1c0af6f1ffcfcf4bcd97dae2759fc7687cb5989a77f51964968dfef6"
    
    time="2024-09-29T05:03:16Z" level=error msg="merged input vertex not found during addJobs" vertex_digest="sha256:0f30bf962760494cd774f731be53204da494eacf105694398090db6c59c7b385"
    
    time="2024-09-29T05:03:16Z" level=error msg="merged input vertex not found during addJobs" vertex_digest="sha256:7d6e21df380b78bdfdacca0bc46b93359e5773e0e04e1ba6117666a2eb4717ad"
    

    Still needs more deep diving to figure out what's happening.

    cc @jedevc if interested

  6. added
    kind/flake
    on Oct 10, 2024
  7. sipsma commented on Jul 10, 2025

    @sipsma
    ContributorAuthor

    This has started popping up in CI a bit more again and has been reported by a user now too.

    Given our progress on dag-op we may not be super reliant on edge merging anymore. Given past debugging, I suspect that's related to the root cause here, so disabling edge merging everywhere is what I'll try to next to avoid this for the meantime while we're still moving off the solver fully.

  8. locked and limited conversation to collaborators on Mar 24, 2026
  9. converted this issue into a discussion #12311 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/enginekind/bugkind/flake

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions