Bug 1401532

Summary: dnf breaks on gpg* subdirectory in /var/lib/yum/repos/$releasever/*
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: yumAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED EOL QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: james.antill, mcepl, mcepl, packaging-team-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-12 10:54:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Matěj Cepl 2016-12-05 14:12:51 UTC
Description of problem:
matej@mitmanek: ~$ sudo debuginfo-install evolution
[sudo] password for matej: 

Yum-utils package has been deprecated, use dnf instead.
See 'man yum2dnf' for more information.


Loaded plugins: auto-update-debuginfo, langpacks
enabling livna-debuginfo
enabling fedora-debuginfo
enabling rpmfusion-free-debuginfo
enabling rpmfusion-nonfree-debuginfo
enabling fedora-cisco-openh264-debuginfo
enabling updates-testing-debuginfo
enabling rpmfusion-free-updates-debuginfo
enabling rpmfusion-nonfree-updates-debuginfo
enabling updates-debuginfo
fedora-cisco-openh264/25/x86_64/signature                                         |  543 B  00:00:00     
fedora-cisco-openh264/25/x86_64/signature                                         | 3.5 kB  00:00:00 !!! 
fedora-cisco-openh264-debuginfo/25/x86_64/signature                               |  543 B  00:00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-x86_64
Importing GPG key 0xFDB19C98:
 Userid     : "Fedora 25 Primary (25) <fedora-25-primary>"
 Fingerprint: c437 dccd 558a 66a3 7d6f 4372 4089 d8f2 fdb1 9c98
 Package    : fedora-repos-25-1.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-25-x86_64
Is this ok [y/N]: y
fedora-cisco-openh264-debuginfo/25/x86_64/signature                               | 3.0 kB  00:00:04 !!! 
Traceback (most recent call last):
  File "/bin/debuginfo-install", line 202, in <module>
    util = DebugInfoInstall()
  File "/bin/debuginfo-install", line 58, in __init__
    self.main()
  File "/bin/debuginfo-install", line 108, in main
    self.doUtilYumSetup()
  File "/usr/share/yum-cli/utils.py", line 365, in doUtilYumSetup
    self._getRepos(doSetup = True)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 742, in _getRepos
    self._repos.doSetup(thisrepo)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 157, in doSetup
    self.retrieveAllMD()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 88, in retrieveAllMD
    dl = repo._async and repo._commonLoadRepoXML(repo)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1460, in _commonLoadRepoXML
    result = self._getFileRepoXML(local, text)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1234, in _getFileRepoXML
    size=102400) # setting max size as 100K
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1022, in _getFile
    **kwargs
  File "/usr/lib/python2.7/site-packages/urlgrabber/mirror.py", line 448, in urlgrab
    return self._mirror_try(func, url, kw)
  File "/usr/lib/python2.7/site-packages/urlgrabber/mirror.py", line 425, in _mirror_try
    return func_ref( *(fullurl,), opts=opts, **kw )
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1172, in urlgrab
    return self._retry(opts, retryfunc, url, filename)
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1064, in _retry
    r = apply(func, (opts,) + args, {})
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1166, in retryfunc
    _run_callback(opts.checkfunc, obj)
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1032, in _run_callback
    return cb(obj, *arg, **karg)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1705, in _checkRepoXML
    self.gpg_import_func(self, self.confirm_func)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 6382, in getKeyForRepo
    self._getAnyKeyForRepo(repo, repo.gpgdir, repo.gpgkey, is_cakey=False, callback=callback)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 6344, in _getAnyKeyForRepo
    result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir)
  File "/usr/lib/python2.7/site-packages/yum/misc.py", line 574, in import_key_to_pubring
    shutil.copy(f, ro_f)
  File "/usr/lib64/python2.7/shutil.py", line 119, in copy
    copyfile(src, dst)
  File "/usr/lib64/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 21] Is a directory: '/var/lib/yum/repos/x86_64/25/fedora-cisco-openh264-debuginfo/gpgdir/private-keys-v1.d'
matej@mitmanek: ~$ sudo -i
mitmanek:~# cd /var/lib/yum/repos/
mitmanek:repos# cd x86_64/
mitmanek:x86_64# cd 25/
mitmanek:25# 
mitmanek:25# ls
adobe-linux-x86_64               livna                     rpmfusion-free-updates-debuginfo
beaker-client                    livna-debuginfo           rpmfusion-nonfree
bluejeans                        mcepl-leafnode-2          rpmfusion-nonfree-debuginfo
covscan                          mcepl-vim8                rpmfusion-nonfree-updates
covscan-testing                  phracek-PyCharm           rpmfusion-nonfree-updates-debuginfo
fedora                           qa-tools                  updates
fedora-cisco-openh264            rcm-tools-fedora-rpms     updates-debuginfo
fedora-cisco-openh264-debuginfo  rpmfusion-free            updates-testing
fedora-debuginfo                 rpmfusion-free-debuginfo  updates-testing-debuginfo
jenkins                          rpmfusion-free-updates
mitmanek:25# ls fedora-cisco-openh264/gpgdir
gpg.conf  private-keys-v1.d  pubring.kbx  pubring.kbx~  S.gpg-agent  trustdb.gpg
mitmanek:25# ls fedora/gpgdir
ls: cannot access 'fedora/gpgdir': No such file or directory
mitmanek:25# ls fedora/
mitmanek:25# ls updates
mitmanek:25# ls */gpg*
fedora-cisco-openh264-debuginfo/gpgdir:
gpg.conf  private-keys-v1.d  pubring.kbx  pubring.kbx~  S.gpg-agent  trustdb.gpg

fedora-cisco-openh264-debuginfo/gpgdir-ro:
gpg.conf  pubring.kbx  pubring.kbx~  trustdb.gpg

fedora-cisco-openh264/gpgdir:
gpg.conf  private-keys-v1.d  pubring.kbx  pubring.kbx~  S.gpg-agent  trustdb.gpg

fedora-cisco-openh264/gpgdir-ro:
gpg.conf  pubring.kbx  pubring.kbx~  trustdb.gpg
mitmanek:25# 

Given that only fedora-cisco-openh264* repos have gpgdir* subdirectories, I would say that yum libraries are falsely not expecting such subdirectory.

Version-Release number of selected component (if applicable):
yum-metadata-parser-1.1.4-17.fc25.x86_64
yum-plugin-auto-update-debug-info-1.1.31-511.fc25.noarch
yum-utils-1.1.31-511.fc25.noarch
yum-langpacks-0.4.5-3.fc24.noarch
dnf-1.1.10-4.fc25.noarch
python2-dnf-1.1.10-4.fc25.noarch
yum-3.4.3-510.fc25.noarch
dnf-yum-1.1.10-4.fc25.noarch
python3-dnf-1.1.10-4.fc25.noarch
dnf-conf-1.1.10-4.fc25.noarch
python3-dnf-plugins-core-0.1.21-4.fc25.noarch
dnf-plugins-core-0.1.21-4.fc25.noarch


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Karel Srot 2017-01-03 13:30:22 UTC
Should this bug be rather filed for Fedora 25? Why is it opened for RHEL-7?

Comment 3 Matěj Cepl 2017-01-16 14:47:39 UTC
(In reply to Karel Srot from comment #2)
> Should this bug be rather filed for Fedora 25? Why is it opened for RHEL-7?

Right you are. Sorry.

Comment 4 Fedora End Of Life 2017-11-16 19:37:03 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2017-12-12 10:54:26 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.