Bug 2124809

Summary: "fedpkg local" does not show rpmbuild output and does not report an rpmbuild error
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: fedpkgAssignee: Ondřej Nosek <onosek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cqi, jkeating, lsedlar, onosek, s
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fedpkg-1.43-2.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-18 01:13:08 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 Petr Pisar 2022-09-07 07:22:41 UTC
After upgrading fedpkg to 1.43-1.fc38, "fedpkg local" in a virtual machine with Fedora 38 does nothing:

$ fedpkg clone -a perl-Fedora-VSP
Cloning into 'perl-Fedora-VSP'...
remote: Enumerating objects: 107, done.
remote: Counting objects: 100% (107/107), done.
remote: Compressing objects: 100% (105/105), done.
remote: Total 107 (delta 42), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (107/107), 12.55 KiB | 3.14 MiB/s, done.
Resolving deltas: 100% (42/42), done.
$ cd perl-Fedora-VSP
$ fedpkg -v local
Creating repo object from /tmp/perl-Fedora-VSP
Downloading Fedora-VSP-0.001.tar.gz
Full url: b'https://src.fedoraproject.org/repo/pkgs/rpms/perl-Fedora-VSP/Fedora-VSP-0.001.tar.gz/sha512/270d549450671732958a31339478bf2bb01680008a5fd414787f18c0250fd2ed30130a472b1cf30416afb819d8ab0a0126a923573d21b01bf83315147663ddfb/Fedora-VSP-0.001.tar.gz'
######################################################################## 100.0%
Initiating a koji session to https://koji.fedoraproject.org/kojihub
$ echo $?
0

When I downgrade fedpkg back to 1.42-5.fc37, it fails like this:

$ fedpkg -v local
Creating repo object from /tmp/perl-Fedora-VSP
Not downloading already downloaded Fedora-VSP-0.001.tar.gz
Initiating a koji session to https://koji.fedoraproject.org/kojihub
Errors occoured while running following command to get N-V-R-E:
rpm --define '_sourcedir /tmp/perl-Fedora-VSP' --define '_specdir /tmp/perl-Fedora-VSP' --define '_builddir /tmp/perl-Fedora-VSP' --define '_srcrpmdir /tmp/perl-Fedora-VSP' --define '_rpmdir /tmp/perl-Fedora-VSP' --define '_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' --define 'dist %{?distprefix}.fc38' --define 'fedora 38' --eval '%undefine rhel' --define 'fc38 1' -q --qf ??%{NAME} %{EPOCH} %{VERSION} %{RELEASE}?? --specfile /tmp/perl-Fedora-VSP/perl-Fedora-VSP.spec
rpm: --define '_sourcedir /tmp/perl-Fedora-VSP': unknown option

Could not execute local: Could not get n-v-r-e from /tmp/perl-Fedora-VSP/perl-Fedora-VSP.spec
Traceback (most recent call last):
  File "/usr/bin/fedpkg", line 33, in <module>
    sys.exit(load_entry_point('fedpkg==1.42', 'console_scripts', 'fedpkg')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/fedpkg/__main__.py", line 89, in main
    sys.exit(client.args.command())
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyrpkg/cli.py", line 2354, in local
    self.cmd.local(localargs,
  File "/usr/lib/python3.11/site-packages/pyrpkg/__init__.py", line 2811, in local
    logfile = '.build-%s-%s.log' % (self.ver, self.rel)
                                    ^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyrpkg/__init__.py", line 1144, in ver
    self.load_nameverrel()
  File "/usr/lib/python3.11/site-packages/pyrpkg/__init__.py", line 762, in load_nameverrel
    raise rpkgError('Could not get n-v-r-e from %s'
pyrpkg.errors.rpkgError: Could not get n-v-r-e from /tmp/perl-Fedora-VSP/perl-Fedora-VSP.spec


I guess something has changed on Koji server, but fedpkg does not propagate the error properly.

Contrary, If do the same Fedora 35 with the old fedpkg, where I have all auhtentication credentials, it works. It looks that somebody forgot on an anonymous mode of operation.

Comment 1 Ondřej Nosek 2022-09-07 07:45:47 UTC
... when I downgrade fedpkg back to 1.42-5.fc37, it fails like this

I have to look what is happening, but need to say that if you reverted to fedpkg 1.42-x, you also have to revert rpkg to 1.64-x.
Fedpkg-1.43 should cooperate only with rpkg-1.65.

Comment 2 Petr Pisar 2022-09-07 08:42:21 UTC
Thanks. Indeed downgrading rpkg together with fedpkg restores the functionality.

Just a clarification: You don't need to clone anonymously. "fedpkg local" does not work regardless what git remote URL is in the repository.

Comment 3 Ondřej Nosek 2022-09-07 09:04:17 UTC
It looks like after refactoring the nearby code I don't properly return back an exit code.
You can still look at the result by checking the log file: ".build-xxxx". On my system, it says there are missing dependencies.

Comment 4 Petr Pisar 2022-09-07 10:13:59 UTC
Do you mean build-time dependencies for the package. That shouldn't be the cause. I've already installed them.
I cleaned up the git tree and retried it to inspect the .build-* log. To my surprise the package was built.
Now it seems that "fedpkg clone" works. It only does not echo the rpmbuild output.

Would it be possible to return logging to stdout, or at least print that rpmbuild has been exected?

Comment 5 Ondřej Nosek 2022-09-07 10:19:02 UTC
I am already trying to get the "show output" functionality back while keeping the security (this was the original purpose - to avoid shell=True). But I am on the good way I would say.

Comment 6 Fedora Update System 2022-09-07 19:06:38 UTC
FEDORA-2022-8c1cd50d13 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8c1cd50d13

Comment 7 Fedora Update System 2022-09-08 12:09:00 UTC
FEDORA-2022-8c1cd50d13 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-8c1cd50d13`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-8c1cd50d13

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

Comment 8 Fedora Update System 2022-09-09 11:55:15 UTC
FEDORA-2022-8c1cd50d13 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-8c1cd50d13`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-8c1cd50d13

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

Comment 9 Fedora Update System 2022-09-10 19:43:44 UTC
FEDORA-2022-8c1cd50d13 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-8c1cd50d13`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-8c1cd50d13

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

Comment 10 Fedora Update System 2022-09-18 01:13:08 UTC
FEDORA-2022-8c1cd50d13 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2023-02-21 20:57:05 UTC
FEDORA-2023-9fb301a544 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-9fb301a544

Comment 12 Fedora Update System 2023-02-21 20:58:47 UTC
FEDORA-2023-9fb301a544 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.