Fail the PSMDB image build when mgodatagen install fails - #1172
Open
claude[bot] wants to merge 1 commit into
Open
Fail the PSMDB image build when mgodatagen install fails#1172claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
The mgodatagen download was the last link of an && chain that ended in `dnf clean all;` -- the `;` made the RUN's exit status come from the trailing `mkdir -p /data/db`, so a failed download still produced a "successful" image with no /usr/bin/mgodatagen. The failure only surfaced minutes later, mid-setup, as "exec: mgodatagen: executable file not found in $PATH". Chain the whole RUN with && so the build fails at the download, retry transient GitHub release errors, and assert the binary is actually extracted in case a future tarball changes layout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CAENfrsinStoUceLT1FNG6 Signed-off-by: Claude <noreply@anthropic.com>
This was referenced Aug 12, 2026
Contributor
Author
|
Heads-up before this merges: the That already happened. The equivalent change in #1171 merged on Aug 13 and took out all 7 OL8 jobs of the next Since #1171 already landed the rest of this change, this PR is likely redundant now — but if any of it is still wanted, it needs rebasing onto #1183 rather than re-adding the flag. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failures fixed (investigator)
E2E / Backup Management MongoDB UI tests / e2e tests: @bm-mongoqa-integration/pmm_psmdb-pbm_setup/start-rs-only.sh/@bm-mongo— setup step,--database psmdb,SETUP_TYPE=pss,COMPOSE_PROFILES=extraWhat failed
The job never reached a test. It died in setup:
Root cause — the image build swallowed a failed download
4½ minutes earlier, in the same log, the
replica_member/localbuild had already lostmgodatagenand carried on regardless:The download was the last link of an
&&chain that ended indnf clean all;— a semicolon, so theRUN's exit status came from the trailingrm -rf … && mkdir -p /data/db, which always succeeds:curl -Lf -o /tmp/mgodatagen.tar.gz https://github.com/…/mgodatagen_0.11.2_Linux_x86_64.tar.gz && \ tar -xf /tmp/mgodatagen.tar.gz -C /usr/bin && \ dnf clean all; \ # <-- breaks the chain rm -rf /var/cache/dnf /var/cache/dnf /data/db && mkdir -p /data/db;So a transient GitHub blip produced a green build of a broken image, and the failure surfaced minutes later, in a different script, as a misleading "executable file not found". (Unlike the first
RUNin this file, this one has noset -eto save it.)The trigger itself was external and transient — GitHub release-asset delivery was degraded in that window. The other failed check in the same run,
Helm tests / helm-tests, is the same outage seen from a different angle and needs no pmm-qa change:That job failed loudly and correctly. This one didn't — that is what this PR fixes.
The fix
Chain the whole
RUNwith&&so the build stops at the download, retry transient GitHub errors instead of giving up on the first one, and assert the binary actually landed in case a future release tarball changes layout.Verified on a throwaway Linode VM (fresh, Ubuntu 24.04, real Docker)
The outage was simulated with
--add-host github.com:127.0.0.1— a flag, no file edits — so thecurlfails exactly where it failed in CI.main, 0a6fda9)curl: (7) …Connection refused→#8 DONE 18.2s→BUILD_EXIT=0BUILD_EXIT=1,did not complete successfully: exit code: 7mgodatagenls: cannot access '/usr/bin/mgodatagen': No such file→exec: "mgodatagen": executable file not found in $PATH— byte-identical to CIBUILD_EXIT=0,/usr/bin/mgodatagenpresent,mgodatagen 0.11.2Then the full FB setup, same server image and client tarball as the failed run (
perconalab/pmm-server-fb:PR-4518-984159a), same args (--database psmdb,SETUP_TYPE=pss,COMPOSE_PROFILES=extra):Setup completed with 0 errors; all six services registered (
rs101–rs103,rs201–rs203), andcommand -v mgodatagen→/usr/bin/mgodatagenin the live container.What this does not prove: the original 503/connection-death was external and transient, so it can't be re-triggered on demand — only simulated, as above. What the next real FB/nightly run confirms is that the normal path stays green; what this PR guarantees is that if the download fails again, the build fails there with a clear message instead of 4½ minutes later somewhere else.
Generated by Claude Code