Jira (PUP-9999) Puppet::Type.type('yumrepo') wrongly reports enabled repo

0 views
Skip to first unread message

Anthony Chevalet (JIRA)

unread,
Sep 5, 2019, 10:59:04 AM9/5/19
to puppe...@googlegroups.com
Anthony Chevalet created an issue
 
Puppet / Bug PUP-9999
Puppet::Type.type('yumrepo') wrongly reports enabled repo
Issue Type: Bug Bug
Affects Versions: PUP 4.10.12
Assignee: Unassigned
Components: Types and Providers
Created: 2019/09/05 7:58 AM
Priority: Normal Normal
Reporter: Anthony Chevalet

Puppet Version: 4.10.12
Puppet Server Version: 2.8.1
OS Name/Version: CentOS Linux release 7.6.1810

I have weird behavior which occurs randomly where Puppet::Type.type('yumrepo') reports that a yum repo is enabled despite it is not.

I'm using this fact

 

require 'puppet'def to_boolean(value)
  %w[absent yes true 1].include?(value.downcase)
endFacter.add('enabled_repos') do
  setcode do
    repos = []
    Puppet::Type.type('yumrepo').instances.find_all do |repo|
      repo_value = repo.retrieve
      repos << repo.name if to_boolean(repo_value[repo.property(:enabled)].to_s.strip)
    end
    repos.sort
  end
end

I have a repo defined with enbled=0, ex: myrepo

 

I run this loop to reproduce:

 

( date; while :; do facter -p enabled_repos | grep -i myrepo && date && break; sleep 1; done ; yum repolist ) >enabled-repo.tmp 2>&1 &

After few days I get:

 

 

Mon Sep  2 03:48:12 UTC 2019
  "myrepo",
Thu Sep  5 16:09:28 UTC 2019
Loaded plugins: enabled_repos_upload, fastestmirror, langpacks, package_upload, product-id, search-
              : disabled-repos, subscription-manager, tracer_upload, versionlock
Loading mirror speeds from cached hostfile
repo id                                              repo name                                 status
!Centos_Centos_7_Base                             Centos_7 Base                             10,019
!Centos_Centos_7_Extras                           Centos 7 Extras                              435
!Centos_Centos_7_Opstools                         Centos 7 Opstools                            896
!Centos_Centos_7_Updates                          Centos 7 Updates                           4,067
!Centos_Centos_7_kvm-common                       Centos 7 kvm-common                           79
!Centos_Centos_7_ovirt                            Centos 7 ovirt                               744
!Centos_Centos_sclo                               Centos sclo                                  786
!Centos_Centos_sclo-rh                            Centos sclo-rh                             8,444
repolist: 25,470
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, langpacks, product-id, subscription-manager,
              : versionlock

myrepo is included in the fact enabled_repos but it is not enabled on the system.

 

Desired Behavior:

myrepo is not included in the fact enabled_repos. Only repos with enable=1 should be included.

Actual Behavior:

myrepo is included in the fact enabled_repos but it is not enabled on the system.

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Anthony Chevalet (JIRA)

unread,
Sep 5, 2019, 11:01:03 AM9/5/19
to puppe...@googlegroups.com
Anthony Chevalet updated an issue
Change By: Anthony Chevalet
*Puppet Version: 4.10.12*
*Puppet Server Version: 2.8.1*
*OS Name/Version: CentOS Linux release 7.6.1810*


I have weird behavior which occurs randomly where Puppet::Type.type('yumrepo') reports that a yum repo is enabled despite it is not.
I'm using this fact

 
{noformat}
require 'puppet'def to_boolean(value)
  %w[absent yes true 1].include?(value.downcase)
endFacter.add('enabled_repos') do
  setcode do
    repos = []
    Puppet::Type.type('yumrepo').instances.find_all do |repo|
      repo_value = repo.retrieve
      repos << repo.name if to_boolean(repo_value[repo.property(:enabled)].to_s.strip)
    end
    repos.sort
  end
end{noformat}

I have a repo defined with enbled=0, ex: myrepo

 

I run this loop to reproduce:

 
{noformat}
( date; while :; do facter -p enabled_repos | grep -i myrepo && date && break; sleep 1; done ; yum repolist ) >enabled-repo.tmp 2>&1 &{noformat}

After few days I get:

 

 
{noformat}
Mon Sep  2 03:48:12 UTC 2019
  "myrepo",
Thu Sep  5 16:09:28 UTC 2019
Loaded plugins: enabled_repos_upload, fastestmirror, langpacks, package_upload, product-id, search-
              : disabled-repos, subscription-manager, tracer_upload, versionlock
Loading mirror speeds from cached hostfile
repo id                     repo name                     status
!Centos_Centos_7_Base                     Centos_7 Base                     10,019
!Centos_Centos_7_Extras                     Centos 7 Extras                     435
!Centos_Centos_7_Opstools                     Centos 7 Opstools                     896
!Centos_Centos_7_Updates                     Centos 7 Updates                     4,067
!Centos_Centos_7_kvm-common                     Centos 7 kvm-common                     79
!Centos_Centos_7_ovirt                     Centos 7 ovirt                     744
!Centos_Centos_sclo                     Centos sclo                     786
!Centos_Centos_sclo-rh                     Centos sclo-rh                     8,444
repolist: 25,470
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, langpacks, product-id, subscription-manager,
              : versionlock
{noformat}

myrepo is included in the fact enabled_repos but it is not enabled on the system.

 

*Desired Behavior:*


myrepo is not included in the fact enabled_repos. Only repos with enable=1 should be included.

*Actual Behavior:*


myrepo is included in the fact enabled_repos but it is not enabled on the system.

I'm using foreman with katello plugin and yum subscriptions.

 

Anthony Chevalet (JIRA)

unread,
Sep 5, 2019, 11:03:03 AM9/5/19
to puppe...@googlegroups.com

Anthony Chevalet (JIRA)

unread,
Sep 5, 2019, 11:05:03 AM9/5/19
to puppe...@googlegroups.com
Anthony Chevalet updated an issue
*Puppet Version: 4.10.12*
*Puppet Server Version: 2.8.1*
*OS Name/Version: CentOS Linux release 7.6.1810*

I have weird behavior which occurs randomly where Puppet::Type.type('yumrepo') reports that a yum repo is enabled despite it is not.

I'm using this fact:
{noformat}

require 'puppet'
def to_boolean(value)
  %w[absent yes true 1].include?(value.downcase)
endFacter end
Facter
.add('enabled_repos') do

Jorie Tappa (JIRA)

unread,
Sep 9, 2019, 12:49:02 PM9/9/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Sep 16, 2019, 6:11:03 AM9/16/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Sep 17, 2019, 4:51:03 AM9/17/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2019-10-02

Gheorghe Popescu (JIRA)

unread,
Sep 18, 2019, 3:59:02 AM9/18/19
to puppe...@googlegroups.com

Dorin Pleava (JIRA)

unread,
Oct 2, 2019, 3:27:04 AM10/2/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Oct 2, 2019, 4:40:11 AM10/2/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2019-10-02 , NW - 2019-10-16

Dorin Pleava (JIRA)

unread,
Oct 2, 2019, 7:09:35 AM10/2/19
to puppe...@googlegroups.com
Dorin Pleava commented on Bug PUP-9999
 
Re: Puppet::Type.type('yumrepo') wrongly reports enabled repo

Hi Anthony Chevalet,

I just finished setting up a similar environment with agent 4.10.12, and now I wait to see if anything strange happens.

Can you try to reproduce the issue with puppet version 5.5.x? The version 4.10.12 is no longer supported, and it might be already fixed in future releases.

Thanks

Anthony Chevalet (JIRA)

unread,
Oct 14, 2019, 7:31:02 AM10/14/19
to puppe...@googlegroups.com

Well I'm still not able to reproduce in test environment even with 4.10.12.. I see it only in production environment (randomly)..

Mihai Buzgau (JIRA)

unread,
Oct 16, 2019, 4:24:10 AM10/16/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2019-10-02, NW - 2019-10-16 , NW - 2019-10-30

Anthony Chevalet (JIRA)

unread,
Oct 17, 2019, 8:43:03 AM10/17/19
to puppe...@googlegroups.com
 
Re: Puppet::Type.type('yumrepo') wrongly reports enabled repo

Yes sure. It looks to occur only on registered systems where rhsmcertd is running. I will try to reproduce with puppet 5 and reopen if needed. Thank you.

Reply all
Reply to author
Forward
0 new messages