pe_patch fact generation listing duplicates causing fatal puppet errors
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với pe_patch_fact_generation.sh và tái hiện việc tạo fact trên một node mà cùng một package khả dụng từ hai repository đã bật. Kiểm tra output pe_patch::package_updates được tạo ra và các khai báo resource Puppet tương ứng; hoàn tất khi các mục package trùng lặp không còn gây ra khai báo trùng lặp nghiêm trọng đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Ruby
- Star
- 4
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của puppetlabs/pe_patch
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 50/100
puppetlabs/pe_patch#98 ·
-
Allow disabling single checksĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
puppetlabs/pe_patch#97 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
puppetlabs/pe_patch#93 ·
Tất cả issue của puppetlabs/pe_patch
Issue tương tự
-
Concept round-trip: serialized "id" parses as #id, #uuid then lazily derives a different UUIDĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
glossarist/glossarist-ruby#247 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
voxpupuli/puppet-corosync#589 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 bug 🧑💼 conseillers
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
betagouv/conseillers-entreprises#4768 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`github-events` aborts the repository scan when a closed pull's API payload has a null `head`Có thể đã có người làm @renyamamoto2026-cmyk đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zerocracy/judges-action#2823 ·
Maintainer thường phản hồi trong vòng 1 ngày