Bug 836772

Summary: crash if no %build section is present
Product: [Fedora] Fedora Reporter: Ken Dreyer <ktdreyer>
Component: fedora-reviewAssignee: Stanislav Ochotnicky <sochotni>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: pingou, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:fba3d1584e34ace8a5a8f076dd9db293fe684311
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-18 01:27:10 UTC Type: ---
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
minimal crasher testcase none

Description Ken Dreyer 2012-07-01 06:50:25 UTC
libreport version: 2.0.10
abrt_version:   2.0.10
cmdline:        /usr/bin/python -tt /usr/bin/fedora-review -n mythweb
comment:        I was checking a .spec file that did not contain a "%build" line. fedora-review crashed with the attached backtrace. After I added a simple "%build" line to the .spec file, fedora-review did not crash.
executable:     /usr/bin/fedora-review
kernel:         3.4.4-3.fc17.i686.PAE
time:           Sun 01 Jul 2012 12:35:03 AM MDT
uid:            1000
username:       ktdreyer

backtrace:
:java.py:364:__init__:KeyError: '%build'
:
:Traceback (most recent call last):
:  File "/usr/bin/fedora-review", line 203, in <module>
:    review.run()
:  File "/usr/bin/fedora-review", line 199, in run
:    self.__do_report_local(self.args.workdir)
:  File "/usr/bin/fedora-review", line 120, in __do_report_local
:    self.__run_checks(files_spec[0], files_srpm[0])
:  File "/usr/bin/fedora-review", line 154, in __run_checks
:    mock_config=self.args.mock_config)
:  File "/usr/lib/python2.7/site-packages/FedoraReview/misc.py", line 61, in __init__
:    self.add_check_classes()
:  File "/usr/lib/python2.7/site-packages/FedoraReview/misc.py", line 74, in add_check_classes
:    self.add(obj)
:  File "/usr/lib/python2.7/site-packages/FedoraReview/misc.py", line 91, in add
:    cls = class_name(self)
:  File "/usr/lib/python2.7/site-packages/FedoraReview/checks/java.py", line 364, in __init__
:    self.build_sec = self.spec.get_section('%build')['%build']
:KeyError: '%build'
:
:Local variables in innermost frame:
:self: <FedoraReview.checks.java.CheckLocalDepmap object at 0xb638c1ec>
:base: <FedoraReview.misc.Checks object at 0xb63e03ac>

Comment 1 Pierre-YvesChibon 2012-07-01 18:08:57 UTC
Could you provide information on how to reproduce this bug ? Or maybe the review request you were trying to do when you encountered it ?

Thanks for reporting :)

Comment 2 Ken Dreyer 2012-07-01 19:02:46 UTC
Created attachment 595556 [details]
minimal crasher testcase

Thanks for the quick response. Here is a minimal crasher test case.

1. Download this file
2. Run "touch test.src.rpm" so fedora-review also sees a source RPM
3. Run "fedora-review -n  test"

The problem is that there is no %build section in the .spec file, so checks/java.py crashes.

Comment 3 Fedora Update System 2012-08-09 10:05:58 UTC
fedora-review-0.2.2-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/fedora-review-0.2.2-1.fc16

Comment 4 Fedora Update System 2012-08-09 10:06:14 UTC
fedora-review-0.2.2-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/fedora-review-0.2.2-1.fc17

Comment 5 Fedora Update System 2012-08-09 22:56:29 UTC
Package fedora-review-0.2.2-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing fedora-review-0.2.2-1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-11573/fedora-review-0.2.2-1.fc16
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-08-18 01:27:10 UTC
fedora-review-0.2.2-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2012-08-18 01:30:18 UTC
fedora-review-0.2.2-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.