Skip to content

[build-image] Refresh apt index and fail the build if kernel packages are missing - #7563

Merged
hanwen-cluster merged 1 commit into
aws:release-3.16from
hanwen-cluster:release-3.16
Aug 14, 2026
Merged

[build-image] Refresh apt index and fail the build if kernel packages are missing#7563
hanwen-cluster merged 1 commit into
aws:release-3.16from
hanwen-cluster:release-3.16

Conversation

@hanwen-cluster

Copy link
Copy Markdown
Contributor

Description of changes

PinVersion installs linux-headers/linux-modules-extra for the running kernel but ignored the exit code of apt-get.

The apt index could be outdated:

  E: Failed to fetch .../wireless-regdb_2025.10.07-0ubuntu1~24.04.1_all.deb
     404  Not Found
  E: Unable to fetch some archives, maybe run apt-get update or try with
     --fix-missing?
  CmdExecution: ExitCode 0

apt aborted the transaction, so linux-modules-extra was never installed, the step reported success.

Changes, limited to Ubuntu:

  • run apt-get update before the install
  • check the install exit code and abort the build with a clear message

Tests

  • Not done yet

References

  • Link to impacted open issues.
  • Link to related PRs in other packages (i.e. cookbook, node).
  • Link to documentation useful to understand the changes.

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

Please review the guidelines for contributing and Pull Request Instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

… are missing

PinVersion installs linux-headers/linux-modules-extra for the running kernel
but ignored the exit code of apt-get.

The apt index could be outdated:
```
  E: Failed to fetch .../wireless-regdb_2025.10.07-0ubuntu1~24.04.1_all.deb
     404  Not Found
  E: Unable to fetch some archives, maybe run apt-get update or try with
     --fix-missing?
  CmdExecution: ExitCode 0
```
`apt` aborted the transaction, so linux-modules-extra was never installed, the
step reported success.

Changes, limited to Ubuntu:
- run `apt-get update` before the install
- check the install exit code and abort the build with a clear message
@hanwen-cluster
hanwen-cluster requested review from a team as code owners August 14, 2026 17:47
apt-get -y install linux-headers-$(uname -r) linux-modules-extra-$(uname -r)
# Refresh the package index first: the index inherited from the base AMI can still
# reference package versions already rotated out of the pool, which fails the fetch.
apt-get -y update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are refreshing the cache for ubuntu. can we do the same for any other OS to prevent similar failures?

@hanwen-cluster hanwen-cluster added the skip-changelog-update Disables the check that enforces changelog updates in PRs label Aug 14, 2026
@hanwen-cluster
hanwen-cluster merged commit 81a1b6f into aws:release-3.16 Aug 14, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog-update Disables the check that enforces changelog updates in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants