Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pe_patch fact generation listing duplicates causing fatal puppet errors

Aperta
#108 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
shell
Ambito
devops

Direzione di ricerca

Inizia con pe_patch_fact_generation.sh e riproduci la generazione dei fact su un nodo in cui lo stesso pacchetto è disponibile da due repository abilitati. Controlla l'output generato di pe_patch::package_updates e le dichiarazioni delle risorse Puppet risultanti; il lavoro è completato quando le voci di pacchetto duplicate non causano più la dichiarazione duplicata fatale segnalata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Affected Puppet, Ruby, OS and module versions/distributions

Puppet: 7.34.0 and 8.13.1
Running in PE v2023.8.4
OS: RHEL 8

How to reproduce (e.g Puppet code you use)

Have a package update available in two different simultaneously enabled repos available to yum/dnf. Allow pe_patch_fact_generation.sh to run on the node. Attempt to run puppet with the patching modules that use the fact generated by the above script.

What are you seeing

The generated puppet fact pe_patch::package_updates will list the available updates twice as they appear in two repos as the above script does not attempt any deduplication of data. This causes a duplicate resource declaration in puppet as it appears the PE modules which consumes pe_patch::package_updates, which then causes a fatal error preventing any puppet configuration from being applied. Included that needed to clean up the duplicate repos...

What behaviour did you expect instead

Obviously, having repos with duplicate packages in is not ideal, so this can be fixed by rationalising the repo config on the affected hosts. However, I would hope that this could be accounted for by deduplicating the list of available updates, or at worst handling this 'error' condition in a non-fatal way. Yum will quite happily update a package which appears in two separate repos by syntactically sorting the repos and using the first. But in this situation this duplication of package names in the pe_patch fact completely breaks puppet until the updates are manually applied, then the patching module works - but only because there are no longer any updates. Any new updates added to both repos will then break puppet again preventing the update.

Output log

# puppet facts pe_patch
{
  "pe_patch": { ...
    "package_updates": [
      "fping.x86_64",
      "fping.x86_64",
      "haveged.x86_64",
      "haveged.x86_64",
      "libbsd.x86_64",
      "libbsd.x86_64",
       ....

On a node, this causes the patching module in puppet to fatally error with:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Package[fping.x86_64] is already declared at (file: /etc/puppetlabs/puppetserver/code/environments/.../modules/patching/manifests/patch.pp, line: 21); cannot redeclare (file: /etc/puppetlabs/puppetserver/code/environments/.../modules/patching/manifests/patch.pp, line: 21) 

Any additional information you'd like to impart

I'd quite happily accept that this isn't exactly a bug in the fact generation script so could be better described as a feature request to resolve a fatal error condition caused by non-optimal repo creation. Not trying to point fingers, but if it's known the output of a fact is being consumed directly to generate identically named puppet resources, and we know that such resources have to be unique, it may be reasonable to ensure the list cannot contain duplicates.

Lingua principale
Ruby
Stelle
4
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di puppetlabs/pe_patch

Tutte le issue di puppetlabs/pe_patch

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.