-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] builds fail with sending never-build-twice request: mismatched build ID for ...
#507
Comments
Hey! Thanks for reporting. It does look like your build ends up resulting in multiple different versions of the same packages (different build IDs). I expect this is not intended behavior; but since your builds succeeded with I have an idea for a small enough fix (basically removing this particular assumption), let me give this a shot. |
The never-build-twice feature assumed that it is not, ever, possible for a single build to result in multiple different builds of the same package with different build IDs. #507 suggest this might actually be a valid outcome (the exact details of why/how are not clear yet). This PR removes that assumption and keeps separate cache entries for each individual build ID in order to reduce the risk of breaking the build. Fixes #507
Alright, I have a candidate fix, would you be able to try with: $ go get github.com/DataDog/orchestrion@b50f449 And then let me know whether this fixes your builds? |
Yes sure @RomainMuller, let me try! |
I am trying your fix, but after 35 minutes, the build seems frozen, and nothing seems to be done (cpu is not doing anything). Maybe there is a deadlock or something ? I will update my message if it finishes, but normally with v1.0.2 it does not take so much time. |
Alright yeah I think you are probably correct... There is probably a deadlock and that might be related to how you ended up with multiple builds of the same package (just different build IDs)... It seems like my assumption that this is not "expected behavior" might actually have been correct. I suspect a child build somehow results in different build configuration being used in |
@RomainMuller |
Haha I managed to get a reproduction on my side about the same time. Yours is a little smaller than mine though 🫣 Thanks nonetheless! Alright so... this is a little surprising; but it would appear that the issue manifests itself ONLY if your What happens in this case, is that the I have a theory on why this causes an issue which I'm going to test out... |
Oh yes nice catch! Indeed the versions downloaded in the Dockerfile and the one in the |
Well I think there is an issue... Even though there is an "easy" workaround for you here. Here's the culprit if you're interested (beware, lots of information ahead):
I reckon this teaches us that we probably shouldn't do the version check + respawn... Maybe instead what we want to do is:
We might want to preserve the "auto restart" feature, but only when running in what we call "driver mode", which is when you do |
By the way (and I mean to document this somewhere), in your Dockerfile, I would recommend using the following commands instead (from your reproduction): FROM golang:1.23-bookworm AS base
# 🚮 Don't install a hard-coded orchestrion release...
# RUN go install github.com/DataDog/[email protected]
WORKDIR /bin
WORKDIR /go/src
COPY common ./common
ARG MODULE="bar"
COPY ${MODULE} ./${MODULE}
WORKDIR /go/src/${MODULE}
# Fetch dependencies.
RUN go vet && \
go get -v
# 🆕 Installs whatever version of orchestrion is in `go.mod`
RUN go install github.com/DataDog/orchestrion
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -toolexec="orchestrion toolexec" \
-ldflags='-w -s -extldflags "-static"' -a -o /bin/foo . && \
DD_TRACE_STARTUP_LOGS="false" go test -toolexec="orchestrion toolexec";
If you prefer to |
v1.0.3
builds fail with "sending never-build-twice request: mismatched build ID for ..."
v1.0.3
builds fail with "sending never-build-twice request: mismatched build ID for ..."v1.0.3
builds fail with sending never-build-twice request: mismatched build ID for ...
v1.0.3
builds fail with sending never-build-twice request: mismatched build ID for ...
sending never-build-twice request: mismatched build ID for ...
I've re-titled & pinned this issue as we need to make a decision on how exactly we permanently fix this situation. I believe this isn't specific to |
[like] Clement HUSSENOT-DESENONGES reacted to your message:
…________________________________
From: Romain Marcadier ***@***.***>
Sent: Friday, January 24, 2025 1:33:46 PM
To: DataDog/orchestrion ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [DataDog/orchestrion] [BUG] builds fail with `sending never-build-twice request: mismatched build ID for ...` (Issue #507)
I've re-titled & pinned this issue as we need to make a decision on how exactly we permanently fix this situation. I believe this isn't specific to v1.0.3 though (just it manifests in a different way on v1.0.3).
—
Reply to this email directly, view it on GitHub<#507 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BOHVBJLGMIZMOWKCB7MCE7L2MI6LVAVCNFSM6AAAAABVZL7KB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJSGU2DEOJSGQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
The automatic version check incurring a re-spawn of orchestrion with the `go.mod` version cannot happen in all situations, and this results in inconsistent build IDs being generated when manually specifying `-toolexec` (instead of using `orchestrion go ...`). Since we cannot always do the version check, we cannot re-spawn in all situations. For now, we decided to no longer re-spawn but instead produce specific error messages when the running version is not the one required by `go.mod`, instructing users what to do to fix that. Fixes #507
Important
Maintainer note:
If you are encountering this issue, and use
orchestrion
by specifying the-toolexec='orchestrion toolexec'
argument togo
(either via command line arguments, or throughGOFLAGS
), the issue is likely caused by:orchestrion
(go install github.com/DataDog/orchestrion@<some-version>
)go.mod
file lists another version oforchestrion
In this case, making sure both versions are identical should fix the issue (if not, please tell us in this issue!).
If you are facing the same problem, but your situation does not match the above description, please let us know by filing a separate issue.
Version of orchestrion
1.0.3
Describe what happened:
Since today, I cannot build some of our micro-services with orchestrion. Here is an extract of logs I get in the
go build
command:Describe what you expected:
Build success
Steps to reproduce the issue:
I don't have at hand a minimum reproducible example, sorry. But I know that it works for v1.0.2, it seems to be a regression with v1.0.3.
I can share though my build command and
go.mod
extract:main
go.mod
common
go.mod
:Additional environment details (Version of Go, Operating System, etc.):
Compiling in amd64, inside an official golang 1.23.5 Debian bookworm based docker image.
The text was updated successfully, but these errors were encountered: