Bug 1866297

Summary: Import of SRPM fails if it contains an empty directory in payload
Product: [Fedora] Fedora Reporter: Roman Melnikov <roman.melnikov>
Component: rpkgAssignee: Ondřej Nosek <onosek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: cqi, dennis, jkeating, lsedlar, onosek, praiskup, s
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpkg-1.61-1.fc32 rpkg-1.61-1.fc31 rpkg-1.61-1.el7 rpkg-1.61-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-12 16:34:18 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:
Embargoed:

Description Roman Melnikov 2020-08-05 10:35:57 UTC
Description of problem:
Build for uploaded '.src.rpm' fails without any details.
https://copr.fedorainfracloud.org/coprs/rvem/tezos-test/build/1593075/

How reproducible:
Failure reproduces when re-uploading the same source package or similar to it.

Steps to Reproduce:
Upload and build '.src.rpm' like https://copr-be.cloud.fedoraproject.org/results/rvem/tezos-test/srpm-builds/01593075/tezos-client-7.2-1.src.rpm

Actual results:
Build fails.

Expected results:
Build succeeds.

Comment 1 Pavel Raiskup 2020-08-05 12:02:39 UTC
Thanks for the report.  This is an import problem:

...
No local branch found, creating a new one
Popen(['git', 'checkout', '-b', 'f31', '--track', 'origin/f31'], cwd=/tmp/tmpfu9ebssw, universal_newlines=False, shell=None, istream=None)
Branch 'f31' set up to track remote branch 'f31' from 'origin'.
Popen(['git', 'diff', '--cached', '--abbrev=40', '--full-index', '--raw'], cwd=/tmp/tmpfu9ebssw, universal_newlines=False, shell=None, istream=None)
Popen(['git', 'diff', '--abbrev=40', '--full-index', '--raw'], cwd=/tmp/tmpfu9ebssw, universal_newlines=False, shell=None, istream=None)
Extracting srpm '/tmp/tmpjqqtot8y/tezos-client-7.2-1.src.rpm', destination '/tmp/rpkg6cfc24ctextract-srpm'
Error during source uploading, merge, or commit.
Traceback (most recent call last):
  File "/usr/share/copr/dist_git/package_import.py", line 220, in import_package
    upload_files = commands.import_srpm(srpm_path)
  File "/usr/lib/python3.7/site-packages/pyrpkg/__init__.py", line 1837, in import_srpm
    name, files, uploadfiles = self._srpmdetails(srpm)
  File "/usr/lib/python3.7/site-packages/pyrpkg/__init__.py", line 1371, in _srpmdetails
    if is_lookaside_eligible_file(file, target_dir):
  File "/usr/lib/python3.7/site-packages/pyrpkg/utils.py", line 275, in is_lookaside_eligible_file
    raise IOError("Input file doesn't exist: {0}".format(file_path))
OSError: Input file doesn't exist: /tmp/rpkg6cfc24ctextract-srpm/SOURCES
sending a response for task {'build_id': 1593075, 'branch_commits': {}, 'reponame': 'rvem/tezos-test/tezos-client'}
Sending back: 
{"build_id": 1593075, "branch_commits": {}, "reponame": "rvem/tezos-test/tezos-client"}
...

So it seems like the directory named SOURCES makes some weird problems inside
python-rpkg library.

Can you please re-create the source.rpm so it doesn't contain the SOURCES
directory and re-try?

Comment 2 Pavel Raiskup 2020-08-05 12:18:54 UTC
I tried `fedpkg import` on that src.rpm, and it failed as well:

$ fedpkg import tezos-client-7.2-1.src.rpm 
Could not execute import_srpm: Input file doesn't exist: /tmp/rpkg75_pmwv0extract-srpm/SOURCES

We should probably just ignore the empty directory in rpkg, and finish
the import (that's what we'd expect in Copr).  Or we should at least
provide a helpful error message.

Switching against the rpkg component.

Comment 3 Fedora Update System 2020-09-09 02:18:41 UTC
FEDORA-EPEL-2020-3b36e3cee4 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-3b36e3cee4

Comment 4 Fedora Update System 2020-09-09 02:20:17 UTC
FEDORA-EPEL-2020-d4790c9c7f has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-d4790c9c7f

Comment 5 Fedora Update System 2020-09-09 02:27:21 UTC
FEDORA-2020-1d768cb488 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-1d768cb488

Comment 6 Fedora Update System 2020-09-09 14:14:01 UTC
FEDORA-2020-1d768cb488 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-1d768cb488`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-1d768cb488

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2020-09-09 14:42:57 UTC
FEDORA-EPEL-2020-3b36e3cee4 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-3b36e3cee4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2020-09-09 14:43:28 UTC
FEDORA-EPEL-2020-d4790c9c7f has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-d4790c9c7f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2020-09-09 14:50:21 UTC
FEDORA-2020-e41cfba160 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-e41cfba160

Comment 10 Fedora Update System 2020-09-10 18:28:59 UTC
FEDORA-2020-e41cfba160 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-e41cfba160`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-e41cfba160

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-09-12 16:34:18 UTC
FEDORA-2020-1d768cb488 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2020-09-18 17:16:35 UTC
FEDORA-2020-e41cfba160 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2020-09-23 16:35:11 UTC
FEDORA-EPEL-2020-3b36e3cee4 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2020-09-23 16:55:54 UTC
FEDORA-EPEL-2020-d4790c9c7f has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.