Skip to content
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

Hash sum mismatch during packages module run if primary APT source was changed by apt module #5921

Open
MattKobayashi opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working correctly incomplete Action required by submitter

Comments

@MattKobayashi
Copy link

Bug report

If the apt module of cloud-init is used to modify the primary APT source URI, and the packages module is configured to install packages, a series of errors can be seen, such as Hash sum mismatch and Unexpected file size. This is caused by package_update defaulting to false, meaning that the local APT state contains package lists from a mirror other than the one being queried. If these mirrors aren't perfectly synchronised, errors such as these will appear, and packages will fail to install.

Steps to reproduce the problem

Boot the minimal Ubuntu 24.04 image using the following cloud-config example (results may vary depending on the sync state of the alternate chosen mirror):

#cloud-config
apt:
  primary:
    - arches: [default]
      uri: http://some.other.mirror/ubuntu
packages:
  - ca-certificates
  - curl
  - sudo

This is in contrast to the following cloud-config, which works perfectly every time:

#cloud-config
apt:
  primary:
    - arches: [default]
      uri: http://some.other.mirror/ubuntu
package_update: true
packages:
  - ca-certificates
  - curl
  - sudo

Environment details

  • Cloud-init version: 24.3.1-0ubuntu0~24.04.2
  • Operating System Distribution: Ubuntu 24.04
  • Cloud provider, platform or installer type: NoCloud

cloud-init logs

@MattKobayashi MattKobayashi added bug Something isn't working correctly new An issue that still needs triage labels Dec 10, 2024
@holmanb
Copy link
Member

holmanb commented Dec 10, 2024

@MattKobayashi This bug report is incomplete. You need to collect logs for the report. Please do that so we can help resolve this issue.

@holmanb holmanb added incomplete Action required by submitter and removed new An issue that still needs triage labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly incomplete Action required by submitter
Projects
None yet
Development

No branches or pull requests

2 participants