[WIP] Fix failing GitHub Actions job for PR #20290 - #20767
Closed
nicholasdille with Copilot wants to merge 1 commit into
Closed
[WIP] Fix failing GitHub Actions job for PR #20290#20767nicholasdille with Copilot wants to merge 1 commit into
nicholasdille with Copilot wants to merge 1 commit into
Conversation
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.
tools/nvidia-container-toolkit/Dockerfile.template(lines 11-18)Acquire::Retries=5to apt-get update and install--mount=type=cache(source of stale archive corruption)tools/libnvidia-container/Dockerfile.templatefor the same pattern and apply the same fixOriginal prompt
Create a PR in
uniget-org/toolsto fix the failing GitHub Actions job for PR #20290 (run 23890532674, job 69662895711).Failure context:
.github/workflows/check.ymlmake ${{ matrix.tool }}--pushwhile building a Docker image.dpkg: error: cannot access archive '/var/cache/apt/archives/libpython3.12-minimal_3.12.3-1ubuntu0.12_amd64.deb': No such file or directoryE: Sub-process /usr/bin/dpkg returned an error code (2)apt-get updateapt-get -y install --no-install-recommends dh-make fakeroot devscripts lsb-releaseGoal:
Required changes:
apt-get install --no-install-recommends dh-make fakeroot devscripts lsb-releasestep (likely in a shared base or a specific tool’stools/<name>/Dockerfile.template).Suggested replacement snippet:
RUN set -eux; \ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /var/cache/apt/archives/partial/*; \ apt-get -o Acquire::Retries=5 update; \ apt-get -o Acquire::Retries=5 install -y --no-install-recommends \ dh-make \ fakeroot \ devscripts \ lsb-release; \ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*Acceptance criteria:
set -eux) and line continuations are correct for the target Dockerfile.References:
bd7e96d5de97541657b2681d815e995630566f0aThe following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The job is failing during the Docker image build step (triggered by
make ${{ matrix.tool }}--pushin.github/workflows/check.ymlatbd7e96d5de97541657b2681d815e995630566f0a), specifically while runningapt-get -y installin one of the Docker build stages.What’s failing (root cause)
From the job log:
This is a known class of failure with container builds using BuildKit/buildx where
apt-getexpects.debfiles to be present in/var/cache/apt/archives/but they are missing (often due to cache corruption/inconsistency, concurrent/partial downloads, or layered cache reuse). In other words:aptthinks it downloaded packages, but the archive file isn’t there whendpkggoes to install it.The most effective fix: make the Dockerfile’s apt step resilient
In the Dockerfile stage where you install:
dh-makefakerootdevscriptslsb-releasechange the install sequence to:
Suggested Dockerfile snippet
Replace the current step:
RUN apt-get update \ && apt-get -y install --no-install-recommends \ dh-make \ fakeroot \ devscripts \ lsb-releasewith:
RUN set -eux; \ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /var/cache/apt/archives/partial/*; \ apt-get -o Acquire::Retries=5 update; \ apt-get -o Acquire::Retries=5 install -y --no-install-recommends \ dh-make \ fakeroot \ devscripts \ lsb-release; \ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*Why this works:
/var/cache/apt/archivesavoids dpkg referencing stale or missing cached artifacts.Acquire::Retriesmitigates transient mirror/network hiccups.If you control the base image: also consider pinning stability
The log shows Ubuntu
noblerepositories. If the base image tracks:latestof something that recently shifted to a newer Noble snapshot, the build can become more prone to transient apt is...This pull request was created from Copilot chat.