Skip to content

(TESTS-1340) Add class-level source_format default for apt::source - relates to issue #1268 - #1342

Closed
jst-cyr wants to merge 1 commit into
mainfrom
TESTS-1340
Closed

jst-cyr wants to merge 1 commit into
mainfrom
TESTS-1340

Conversation

@jst-cyr

@jst-cyr jst-cyr commented Nov 19, 2026

Copy link
Copy Markdown
Member

This PR is created to execute tests for the original PR (#1340)

🤖 Generated with Claude Code

…relates to issue #1268

Co-authored-by: Phil Friderici <phil.friderici@perforce.com>
@jst-cyr

jst-cyr commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

🛑 Acceptance Test Results: https://github.com/puppetlabs/puppetlabs-apt/actions/runs/44435400752?pr=1342

Most platforms are fine, but Debian 12 is failing for both Puppet Core 8 and Puppet Core 9 with the same issue in the new acceptance test. I pointed Claude Code at the errors and PR changes to get a first analysis of the failure and root cause:

From 🤖 Claude Code:

Failure

  • Both jobs fail on one test, spec/acceptance/apt_source_format_spec.rb:34, "applies idempotently". The other 48 examples pass.
  • The puppet apply exits with code 4 on all 10 retries. The two jobs differ only in Ruby and stack-trace paths.
  • The error is: Could not prefetch package provider 'apt': apt-mark showmanual returned 100: E: Conflicting values set for option Signed-By regarding source http://deb.debian.org/debian/ bookworm: /usr/share/keyrings/debian-archive-keyring.gpg != <empty>
  • Because of that error, apt can't read its sources at all, so Package[gnupg] is skipped.

Root cause

  • The test declares apt::source { 'format_default': location => 'http://deb.debian.org/debian', repos => 'contrib' } with the class default source_format => 'sources'.
  • That writes /etc/apt/sources.list.d/format_default.sources for http://deb.debian.org/debian and suite bookworm, with no Signed-By: line. The template only emits it when keyring is set (source.pp:360).
  • Debian 12 images already ship /etc/apt/sources.list.d/debian.sources for the same URI and suite, and it has Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg.
  • apt rejects two entries for the same URI and suite when their Signed-By values differ. I inferred the pre-existing debian.sources from the error message. I didn't check the CI image directly.
  • The 'format_override' source in the same test has the same URI and suite in .list format, so it likely has the same problem. I didn't confirm that.

Summary:

  • Both Debian 12 jobs fail on apt_source_format_spec.rb:34 for one reason: the test duplicates Debian's own deb.debian.org/debian bookworm source without a Signed-By, and apt refuses to read its sources.
  • The module code isn't shown to be wrong here. The deb822 output is valid, and the default stays list.
  • Suggested fixes, easiest first:
    • Use a repo that Debian doesn't already configure, such as a different location or suite.
    • Pass keyring => '/usr/share/keyrings/debian-archive-keyring.gpg' to both test sources on Debian.
    • Remove the pre-existing debian.sources in a before step. This is the most invasive option.
  • Other platforms may hit the same clash. Ubuntu 24.04 also ships a ubuntu.sources with Signed-By. I didn't check the other jobs' results.

@jst-cyr jst-cyr closed this Nov 19, 2026
@jst-cyr
jst-cyr deleted the TESTS-1340 branch November 19, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants