Repository navigation
Closed
Labels
Description
I saw this flake on main (Traces) and got very sad since it was in TestLegacy which should have been fixed.
But this flake appears to be distinct from the old one, even though part of the error message is the same:
- The mismatch in files occurs in
TestLegacyExportAbsolutePathand crucially is ininternal/dagger/dagger.gen.gorather than ingo.mod - Looking through the engine logs from that run, I can see that filesync cache refs are not being re-used between different client sessions, which was the important part of the root cause for the other flake
- I could repro the previous flake locally by running
TestLegacyin a loop for at most an hour (but usually closer to 20m). But I have been running that same loop on main for going on 3 hours now locally with it passing every time (takes about 45s per run).
The error this time looks like
Error Trace: /app/core/integration/legacy_test.go:62
Error: Received unexpected error:
input: container.from.withMountedFile.withWorkdir.withExec.withNewFile.withNewFile.withExec.stdout resolve: process "dagger --debug query" did not complete successfully: exit code: 1
Stderr:
Error: failed to serve module: input: module.withSource.initialize resolve: failed to initialize module: failed to call module "bare" to get functions: call constructor: process "go build -o /runtime ." did not complete successfully: exit code: 1
Stderr:
internal/dagger/dagger.gen.go:23:2: package dagger/test/internal/querybuilder is not in std (/usr/local/go/src/dagger/test/internal/querybuilder)
internal/dagger/dagger.gen.go:24:2: package dagger/test/internal/telemetry is not in std (/usr/local/go/src/dagger/test/internal/telemetry)
Test: TestLegacy/TestLegacyExportAbsolutePath
I spent a while pouring through the engine logs to find any clues, but everything checks out and looks expected from what I can see based on what we include there.
I don't have any strong hunches yet, but a couple things to note/investigate:
- Not clear yet how often this happens, just saw it this one time. Can't repro locally so will just have to see what happens in CI
- When running the test loop locally I checked the kernel logs at one point and saw that 10m earlier there was a single
[211550.735848] overlayfs: lowerdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.- No idea what to make of this yet, could be completely unrelated. But there must be some rare bug somewhere between buildkit+dagger that causes invalid mounts to be created, which could plausibly explain a situation like this
- I may go re-enable printing kernel logs in CI again since this is the exact type of situation where they could be extremely useful
- Possible places things could be going wrong (completely hypothetical at this point)
- Some deep bug in overlay mount setup (just based on that kernel log mentioned above)
- File export somehow getting confused and routing files to the wrong client/session (but just some files, not sure how that could happen)
Activity
jedevc commentedon Jul 31, 2024
Hmmmm, maybe this isn't the same, but I do occasionally see this one too: https://dagger.cloud/dagger/traces/8e10dd9a4a2016f2a739f4831b47879d?span=90b732664b3eb8a9#90b732664b3eb8a9:L12
This could potentially be occurring if we were getting the wrong
main.gofor a specific test? Maybe?sipsma commentedon Aug 30, 2024
I managed to repro this in CI with a sleep added so I could nsenter into the container and found what seems like it must be a bug in go's build caching?
fail to build due to an import not being found:
But when looking at the file it's erroring on, the lines it's complaining about don't match the error at all:
Then, rm -rf the whole go build cache and now it magically builds again!!
I don't really see how this could be anything but a bug in go.
It wouldn't shock me if it was something vaguely similar to the problem we had with filesync file comparisons that relied on comparing file size + timestamps rather than digesting all the contents: that would explain why go appears to be confusing
testandbareNext steps:
cc @jedevc you're gonna love this one 😄
[-](Another different) `TestLegacy` flake[/-][+]Test flake: package dagger/<modname>/internal/querybuilder is not in std [/+]sipsma commentedon Aug 30, 2024
Okay managed to repro in CI again, tar up the whole rootfs, upload to s3 to exfiltrate it out, and then turn into a docker image that reproduces the problem at
eriksipsma/corrupt-cache:latestin dockerhub (it's an amd64 image only since that's what our CI is).Build failure:
The errors do not correspond to the actual contents of the file:
Removing the go build cache first results in the errors going away and a successful build:
Gonna take that and open an issue on the Go repo now
sipsma commentedon Aug 30, 2024
Issue in go repo: golang/go#69179
sipsma commentedon Oct 10, 2024
This one is not causing a flake anymore after #8470 was merged. However, it's worth leaving open since it's fixed by disabling the go mod index in our test suite, which is really just a bandaid. Will rename to indicate it's tracking the upstream fix in Go and remove the flake label for now. Can close the issue once that bandaid is no longer needed.
[-]Test flake: package dagger/<modname>/internal/querybuilder is not in std [/-][+]Tests require disabling go mod index pending upstream bug fix[/+]sipsma commentedon Oct 30, 2024
We got a report of users hitting this now. We haven't noticed any downsides to disabling goindex in our CI so it's worth considering making this the default setting now. Also worth a double check on performance impact while doing so, especially since we have more metrics to make an informed decision.
daniel-naegele commentedon Jun 23, 2025
I am experiencing a variant of this issue and am able to reproduce this I think. With the recent fix of #10612 I am finally able to run our dagger pipeline on GitLab CI and am only experiencing this issue on GitLab CI (using docker in docker executor).
go.go:base.go:.gitlab-ci.ymlIf I execute either of those Dagger functions locally (also with the HEAD version), both work flawlessly. However, in the GitLab CI, the
stylejob succeeds, while thegolangbuildjob fails with the following log. If base.go actually contained erroneous code, thestylejob should fail as well, but it is only thegolangbuildjob only in the GitLab CI environment.Is there a workaround for this? As can be concluded from the code, no caching, for example for the go cache is used. Also using the latest go docker container does not fix that.