Bug 967571

Summary: Crash if there is no %install section in the spec
Product: [Fedora] Fedora Reporter: Jaroslav Škarvada <jskarvad>
Component: fedora-reviewAssignee: Stanislav Ochotnicky <sochotni>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gbailey, leamas.alec, pingou, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fedora-review-0.4.1-2.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-11 09:05:01 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 Jaroslav Škarvada 2013-05-27 13:28:41 UTC
Description of problem:
Crash if there is no %install section in the spec

Version-Release number of selected component (if applicable):
fedora-review-0.4.1-1

How reproducible:
Always

Steps to Reproduce:
1. Create spec without %install section, or use e.g. https://bugzilla.redhat.com/attachment.cgi?id=747878
2. fedora-review -n laptop-mode-tools (or YOUR_PACKAGE)

Actual results:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 196, in run
    self._do_run()
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 187, in _do_run
    self.__do_report()
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 83, in __do_report
    self.__run_checks(self.bug.spec_file, self.bug.srpm_file)
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 102, in __run_checks
    writedown=not Settings.no_report)
  File "/usr/lib/python2.7/site-packages/FedoraReview/checks.py", line 350, in run_checks
    run_check(name)
  File "/usr/lib/python2.7/site-packages/FedoraReview/checks.py", line 332, in run_check
    check.run()
  File "/usr/lib/python2.7/site-packages/FedoraReview/plugins/generic.py", line 236, in run
    self.log.debug('install_sec: ' + install_sec)
TypeError: cannot concatenate 'str' and 'NoneType' objects

Expected results:
Error message like "there is no %install section" or similar and no crash.

Additional info:

Comment 1 Greg Bailey 2013-05-29 19:26:01 UTC
I experienced similar crash, except in my case the .spec file I was reviewing had no %build section.

fedora-review -b 968339

gave me:

INFO: Processing bugzilla bug: 968339
INFO: Getting .spec and .srpm Urls from : 968339
INFO:   --> SRPM url: http://jcapik.fedorapeople.org/files/ps_mem/ps_mem-3.1-1.fc20.src.rpm
INFO:   --> Spec url: http://jcapik.fedorapeople.org/files/ps_mem/ps_mem.spec
INFO: Using review directory: /home/gbailey/968339-ps_mem
INFO: Downloading .spec and .srpm files
INFO: Downloading (Source0): https://raw.github.com/pixelb/scripts/961ff24c805a474080520403409872b04e18f4d9/scripts/ps_mem.py
INFO: Downloading (Source1): http://www.gnu.org/licenses/lgpl-2.1.txt
INFO: Running checks and generating report

INFO: Results and/or logs in: /home/gbailey/968339-ps_mem/results
INFO: WARNING: Probably non-rawhide buildroot used. Rawhide should be used for most package reviews
INFO: Build completed
INFO: Installing built package(s)
ERROR: Exception down the road...(logs in /home/gbailey/.cache/fedora-review.log)

The .cache/fedora-review.log file contained (at the bottom):

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 196, in run
    self._do_run()
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 187, in _do_run
    self.__do_report()
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 83, in __do_report
    self.__run_checks(self.bug.spec_file, self.bug.srpm_file)
  File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 102, in __run_checks
    writedown=not Settings.no_report)
  File "/usr/lib/python2.7/site-packages/FedoraReview/checks.py", line 350, in run_checks
    run_check(name)
  File "/usr/lib/python2.7/site-packages/FedoraReview/checks.py", line 332, in run_check
    check.run()
  File "/usr/lib/python2.7/site-packages/FedoraReview/plugins/java.py", line 393, in run
    if (skip_regex.search(build_section) or
TypeError: expected string or buffer

Comment 2 Stanislav Ochotnicky 2013-05-30 08:57:32 UTC
I've fixed this upstream (commit a775357f). I'll be backporting this later

Comment 3 Fedora Update System 2013-05-30 12:34:36 UTC
fedora-review-0.4.1-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/fedora-review-0.4.1-2.fc18

Comment 4 Fedora Update System 2013-05-30 12:34:52 UTC
fedora-review-0.4.1-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/fedora-review-0.4.1-2.el6

Comment 5 Fedora Update System 2013-05-30 12:35:02 UTC
fedora-review-0.4.1-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/fedora-review-0.4.1-2.fc19

Comment 6 Fedora Update System 2013-05-30 12:35:16 UTC
fedora-review-0.4.1-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/fedora-review-0.4.1-2.fc17

Comment 7 Fedora Update System 2013-05-30 17:54:40 UTC
Package fedora-review-0.4.1-2.fc19:
* should fix your issue,
* was pushed to the Fedora 19 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.4.1-2.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-9673/fedora-review-0.4.1-2.fc19
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-06-11 09:05:01 UTC
fedora-review-0.4.1-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2013-06-11 09:12:16 UTC
fedora-review-0.4.1-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2013-06-12 03:35:48 UTC
fedora-review-0.4.1-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.