Jira (PUP-11635) dnfmodule provider fails, preventing updating catalog

116 views
Skip to first unread message

Vadym Chepkov (Jira)

unread,
Sep 30, 2022, 11:18:04 AM9/30/22
to puppe...@googlegroups.com
Vadym Chepkov created an issue
 
Puppet / Bug PUP-11635
dnfmodule provider fails, preventing updating catalog
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2022/09/30 8:17 AM
Priority: Normal Normal
Reporter: Vadym Chepkov

Puppet Version: 6.28.0
Puppet Server Version: 6.20.0
OS Name/Version: AlmaLinux 8

dnfmodule provider doesn't handle exceptions properly, preventing puppet to apply catalog and fix the repository

I have encountered it when a yum repository was removed from original server and even though manifest has been updated, puppet failed before it was able to update it:

Error: Could not prefetch package provider 'dnfmodule': Execution of '/usr/bin/dnf module list -d 0 -e 1' returned 1: Error: Failed to download metadata for repo 'choria_release': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Error: Failed to apply catalog: Execution of '/usr/bin/dnf module list -d 0 -e 1' returned 1: Error: Failed to download metadata for repo 'choria_release': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
Oct 4, 2022, 4:19:02 PM10/4/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11635
 
Re: dnfmodule provider fails, preventing updating catalog

Vadym Chepkov could you provide a sample manifest to reproduce the issue and the output of puppet agent -td when the error occurs. Note if prefetch fails for a provider, then puppet will mark all resources associated with that provider and all downstream dependencies as failed.

Vadym Chepkov (Jira)

unread,
Oct 4, 2022, 5:01:02 PM10/4/22
to puppe...@googlegroups.com

Josh Cooper, All you need to do is to create un-accessible yum repository definition

# cat /etc/yum.repos.d/choria_release.repo
[choria_release]
name=Choria Orchestrator Releases
mirrorlist=https://packagecloud.io/choria/yum/release/el/$releasever/$basearch.txt
enabled=True
gpgcheck=False
 
# /usr/bin/dnf module list -d 0 -e 1
Error: Failed to download metadata for repo 'choria_release': Cannot prepare internal mirrorlist: Status code: 404 for https://packagecloud.io/choria/yum/release/el/8/x86_64.txt (IP: 52.8.166.117)
[root@puppet ~]# echo $?
1
 
Puppet will fail at prefetch stage. I will upload debug file shortly

Vadym Chepkov (Jira)

unread,
Oct 4, 2022, 5:05:02 PM10/4/22
to puppe...@googlegroups.com
Vadym Chepkov updated an issue
 
Change By: Vadym Chepkov
Attachment: puppet-debug.log

Josh Cooper (Jira)

unread,
Oct 4, 2022, 6:04:01 PM10/4/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11635
 
Re: dnfmodule provider fails, preventing updating catalog

This seems to work as expected for me. Resources that depend on the package resource will be marked skipped, while unrelated resources that come after should still be applied:

[root@petty-dramatist ~]# cat /etc/yum.repos.d/choria_release.repo 
[choria_release]
name=Choria Orchestrator Releases
mirrorlist=https://packagecloud.io/choria/yum/release/el/$releasever/$basearch.txt
enabled=True
gpgcheck=False
 
[root@petty-dramatist ~]# cat /etc/puppetlabs/code/environments/production/manifests/site.pp
package { 'virt':
  ensure => installed
}
notify { 'dependent':
  require => Package['virt']
}
notify { 'unrelated': }
[root@petty-dramatist ~]# puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for petty-dramatist.delivery.puppetlabs.net
Info: Applying configuration version '1664920918'
Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install virt' returned 1: Error: Unable to find a match
Error: /Stage[main]/Main/Package[virt]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install virt' returned 1: Error: Unable to find a match
Notice: /Stage[main]/Main/Notify[dependent]: Dependency Package[virt] has failures: true
Warning: /Stage[main]/Main/Notify[dependent]: Skipping because of failed dependencies
Notice: unrelated
Notice: /Stage[main]/Main/Notify[unrelated]/message: defined 'message' as 'unrelated'
Info: Class[Main]: Unscheduling all events on Class[Main]
Notice: Applied catalog in 4.32 seconds

Vadym Chepkov (Jira)

unread,
Oct 11, 2022, 1:33:03 PM10/11/22
to puppe...@googlegroups.com

I tested on puppet 7 and it works fine, I guess the problem is confined to puppet 6

Reply all
Reply to author
Forward
0 new messages