Bug 1264198

Summary: rpm calls exit() if it receives SIGPIPE executing a scriptlet which kills the thing that was using rpm
Product: [Fedora] Fedora Reporter: David Shea <dshea>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: awilliam, dcantrell, jsilhan, jzeleny, kchamart, kevin, lkardos, lslebodn, mluscon, nforro, novyjindrich, packaging-team-maint, pbrobinson, pknirsch, pnemade, tim.lauridsen, vmukhame
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpm-4.13.0-0.rc1.6.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1269665 (view as bug list) Environment:
Last Closed: 2015-11-10 20:21: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:
Embargoed:
Attachments:
Description Flags
build.log
none
dnf.log
none
dnf.rpm.log
none
dnf.librepo.log
none
root.log
none
anaconda-24.3-0.1.20150918122117.fc24.src.rpm
none
make.log none

Description David Shea 2015-09-17 20:36:29 UTC
Description of problem:
When building anaconda in mock, the dnf builddep step exits with status after installing the packages and before verifying them, with no indication that anything actually went wrong.

Version-Release number of selected component (if applicable):
dnf-1.1.1-2.fc24.noarch

How reproducible:
This has been difficult to pin down. This problem always occurs in anaconda's jenkins jobs, but attempts to run mock outside of jenkins using the same host do not hit the error. I have a rawhide VM that hits the error most of the time, but every in a while succeeds, and I'm not sure what changed.


Additional info:
Attaching logs.

Comment 1 David Shea 2015-09-17 20:37:37 UTC
Created attachment 1074579 [details]
build.log

build.log from mock

Comment 2 David Shea 2015-09-17 20:38:12 UTC
Created attachment 1074580 [details]
dnf.log

/var/log/dnf.log from the mock buildroot

Comment 3 David Shea 2015-09-17 20:38:36 UTC
Created attachment 1074581 [details]
dnf.rpm.log

/var/log/dnf.rpm.log from the mock buildroot

Comment 4 David Shea 2015-09-17 20:39:07 UTC
Created attachment 1074582 [details]
dnf.librepo.log

/var/log/dnf.librepo.log from the mock buildroot

Comment 5 David Shea 2015-09-17 20:40:16 UTC
If there is anything else I can do to provide information, please let me know. This has so far proven impossible to debug and it is preventing us building anaconda packages for rawhide.

Comment 6 Radek Holy 2015-09-17 20:50:15 UTC
I don't see any error in the logs, do you? I think that the root.log contains the output of the "builddep" usage. Can you share it please?

BTW, as a workaround, you should be able to use the Mock's --yum switch (or the corresponding config option).

Comment 7 David Shea 2015-09-17 20:53:41 UTC
Created attachment 1074584 [details]
root.log

root.log from mock that I meant to attach the first time around

Too many logs and I got them confused, I guess. There's a bunch of warnings about desktop schema stuff, and then it sits for a few seconds, and then it exits with status 1. I don't think the warnings are fatal, or at least they aren't supposed to be.

Comment 8 David Shea 2015-09-17 21:32:43 UTC
--yum works, thank you for that. It hadn't even occurred to me.

Comment 9 Radek Holy 2015-09-17 22:12:56 UTC
Right, I cannot reproduce it neither. Could you provide the SRPM as well please?

Comment 10 Radek Holy 2015-09-17 22:19:43 UTC
BTW, I think I can confirm that the warnings are not fatal since I got them as well but builddep have finished successfully.

Comment 11 David Shea 2015-09-18 12:36:34 UTC
Created attachment 1074854 [details]
anaconda-24.3-0.1.20150918122117.fc24.src.rpm

The error happens during anaconda's rc-release make target, which edits a new version into the spec file, runs make dist to generate the source tarball, and then runs:

mock -r fedora-rawhide-x86_64 --scrub all
mock -r fedora-rawhide-x86_64 --buildsrpm --spec ./anaconda.spec --sources . --resultdir .
mock -r fedora-rawhide-x86_64 --rebuild *src.rpm --resultdir .

Building the srpm seems to go fine, but the rpm fails. Attaching the srpm from the second mock command.

Comment 12 David Shea 2015-09-18 12:38:10 UTC
Created attachment 1074855 [details]
make.log

This is the output from 'make rc-release' in case there's something in there I missed.

Comment 13 David Shea 2015-10-07 20:36:34 UTC
I've narrowed the problem down somewhat. The exit is happening in rpm, in rpmdbCheckSignals. I still don't know why it's failing, but maybe don't call exit() in a library?

Comment 14 David Shea 2015-10-07 21:25:22 UTC
The signal is SIGPIPE, and the cause is the fwrite call in runExtScript, at line 376 of lib/rpmscript.c. It happens while executing "/usr/bin/mandb -q\n\n# update cache" as part of the trigger for man-db.

Comment 15 Ľuboš Kardoš 2015-10-30 14:28:56 UTC
It should be fixed in rpm-4.13.0-0.rc1.9.fc24

Comment 16 Lukas Slebodnik 2015-11-02 10:22:43 UTC
Thank you very much.
It works for me and finally I can use mock with dnf on rawhide.

Comment 17 Kevin Fenzi 2015-11-08 20:39:24 UTC
Could we get a build/update for f23 for this issue? 

We are trying to move the builders over to f23 and I think we are hitting this with some builds. 

See: 
http://koji.fedoraproject.org/koji/taskinfo?taskID=11749874
and
https://lists.fedoraproject.org/pipermail/devel/2015-November/216592.html

Comment 18 Ľuboš Kardoš 2015-11-09 08:53:11 UTC
I open the bug for f23.

Comment 19 Fedora Update System 2015-11-09 08:55:02 UTC
rpm-4.13.0-0.rc1.6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-5d1b3d3854

Comment 20 Kevin Fenzi 2015-11-09 19:25:31 UTC
Thanks!

Comment 21 Fedora Update System 2015-11-10 03:22:57 UTC
rpm-4.13.0-0.rc1.6.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update rpm'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-5d1b3d3854

Comment 22 Fedora Update System 2015-11-10 20:21:20 UTC
rpm-4.13.0-0.rc1.6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Richard W.M. Jones 2016-03-29 22:13:28 UTC
*** Bug 1317843 has been marked as a duplicate of this bug. ***

Comment 24 Adam Williamson 2016-03-31 00:01:22 UTC
So I tried turning image generation back on for openQA, and it looks like x86_64 images built OK, but i686 failed. Did you forget to refresh the i686 base image as well as the x86_64 one?

Comment 25 Adam Williamson 2016-03-31 00:02:26 UTC
yes...that seems to be the case:

[   ] fedora-23-aarch64-nvram.xz 12-Nov-2015 13:11   10K  
[   ] fedora-23-aarch64.xz       12-Nov-2015 13:09  206M  
[   ] fedora-23-armv7l.xz        02-Mar-2016 11:03  231M  
[   ] fedora-23-i686.xz          05-Dec-2015 18:30  247M  
[   ] fedora-23-ppc64.xz         19-Dec-2015 08:31  268M  
[   ] fedora-23-ppc64le.xz       19-Dec-2015 16:31  265M  
[   ] fedora-23.xz               30-Mar-2016 06:25  303M  

so 'fedora-23.xz' (presumably the x86_64 base image) was rebuilt today, but none of the other arches was.