#1786 AttributeError when package elasticsearch.rpm (no any src.rpm)
Closed: Fixed by lsedlar. Opened by kurokuo.

Hi, we found a none reference exception when we try to found "elasticsearch-6.8.22-1.noarch.rpm" to package set. This rpm is from official elasticsearch website and the official does not provide any src.rpm. Is there any possible way to ignore/jump out the src.rpm check?

Traceback:

2024-09-08 12:51:24 [DEBUG   ] Added package elasticsearch-6.8.22-1.noarch
Traceback (most recent call last):
  File "/usr/local/bin/pungi-gather", line 33, in <module>
    sys.exit(load_entry_point('pungi==4.7.0', 'console_scripts', 'pungi-gather')())
  File "/usr/local/lib/python3.9/site-packages/pungi-4.7.0-py3.9.egg/pungi/scripts/pungi_gather.py", line 236, in cli_main
    main(ns, persistdir, cachedir)
  File "/usr/local/lib/python3.9/site-packages/pungi-4.7.0-py3.9.egg/pungi/scripts/pungi_gather.py", line 185, in main
    g.gather(packages, conditional_packages)
  File "/usr/local/lib/python3.9/site-packages/pungi-4.7.0-py3.9.egg/pungi/profiler.py", line 66, in decorated
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pungi-4.7.0-py3.9.egg/pungi/gather_dnf.py", line 1025, in gather
    self._add_packages(added)
  File "/usr/local/lib/python3.9/site-packages/pungi-4.7.0-py3.9.egg/pungi/gather_dnf.py", line 392, in _add_packages
    if i.sourcerpm.rsplit("-", 2)[0] in self.opts.fulltree_excludes:
AttributeError: 'NoneType' object has no attribute 'rsplit'

Best


This looks like a bug. The code has an expectation that any non-SRPM package will have the sourcerpm attribute. But it doesn't seem to be the case here.

PR #1787 might fix this by not parsing the sourcerpm NVR directly but instead using the name provided by DNF.

Commit 225f04cf fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/pungi/pungi/issues/1786

Please continue any further discussion there.

Metadata