Bug 967571 - Crash if there is no %install section in the spec
Crash if there is no %install section in the spec
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: fedora-review (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Stanislav Ochotnicky
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-27 09:28 EDT by Jaroslav Škarvada
Modified: 2013-06-11 23:35 EDT (History)
4 users (show)

See Also:
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 05:05:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jaroslav Škarvada 2013-05-27 09:28:41 EDT
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 15:26:01 EDT
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 04:57:32 EDT
I've fixed this upstream (commit a775357f). I'll be backporting this later
Comment 3 Fedora Update System 2013-05-30 08:34:36 EDT
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 08:34:52 EDT
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 08:35:02 EDT
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 08:35:16 EDT
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 13:54:40 EDT
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 05:05:01 EDT
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 05:12:16 EDT
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-11 23:35:48 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.