Bug 1314369 - Exception raised when resubmitting Git&Tito build
Exception raised when resubmitting Git&Tito build
Product: Copr
Classification: Community
Component: frontend (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Suchý
Depends On:
  Show dependency treegraph
Reported: 2016-03-03 08:09 EST by clime
Modified: 2016-03-29 08:19 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-03-29 08:19:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description clime 2016-03-03 08:09:46 EST
File "/usr/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/share/copr/coprs_frontend/coprs/rest_api/__init__.py", line 44, in error_router
    return original_handler(e)
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/share/copr/coprs_frontend/coprs/views/misc.py", line 274, in decorated_function
    return f(*args, **kwargs)
  File "/usr/share/copr/coprs_frontend/coprs/views/misc.py", line 323, in wrapper
    return f(copr, **kwargs)
  File "/usr/share/copr/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py", line 499, in copr_new_build_rebuild
    return process_rebuild(copr, build_id, view=view, url_on_success=url_on_success)
  File "/usr/share/copr/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py", line 528, in process_rebuild
  File "/usr/share/copr/coprs_frontend/coprs/logic/builds_logic.py", line 281, in create_new_from_other_build
  File "/usr/share/copr/coprs_frontend/coprs/logic/builds_logic.py", line 522, in add
    if " " in pkgs or "\n" in pkgs or "\t" in pkgs or pkgs.strip() != pkgs:
TypeError: argument of type 'NoneType' is not iterable

Happens when resubmitting a Git&Tito build. Probly affects also MockSCM and PyPI builds where pkgs is NULL.
Comment 1 clime 2016-03-03 09:20:23 EST
Occurs on copr-fe-dev for builds that have NULL in pkgs field. Newly created builds have empty string as value if there are no input pkgs (as is the case for Git&Tito, Mock SCM, and PyPI builds). NULLs for the past builds must have got there by some db operations probly.

Anyway, I made commit b2112ab16e as a counter-measure. pkgs field, hopefully, will soon disappear.
Comment 2 Jakub Kadlčík 2016-03-15 04:51:06 EDT
Code with this fix is currently deployed on testing server.
You can test it before it will be deployed to production.
Please see: http://copr-fe-dev.cloud.fedoraproject.org
Comment 3 Jakub Kadlčík 2016-03-29 08:19:19 EDT
Copr production machines were upgraded to version containing a fix to this issue.
If you are not satisfied with provided solution, please feel free to reopen this.

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