fedora-infra / koschei

Continuous integration for Fedora packages
GNU General Public License v2.0
37 stars 15 forks source link

500 Internal Server Error when examining an impact of a renamed package #355

Open hroncok opened 1 year ago

hroncok commented 1 year ago

When I go for example to https://koschei.fedoraproject.org/package/PyYAML?collection=f39

screenshot

I click on the question mark near python3-cython + 3.0.0-1.fc39, it leads to:

https://koschei.fedoraproject.org/affected-by/python3-cython?epoch1=0&version1=&release1=&epoch2=0&version2=3.0.0&release2=1.fc39&collection=f39

That has:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Similarly, when I click to python3-Cython 0.29.35-2.fc39 - under show 166 more, it leads to the same error at https://koschei.fedoraproject.org/affected-by/python3-Cython?epoch1=0&version1=0.29.35&release1=2.fc39&epoch2=0&version2=&release2=&collection=f39

mizdebsk commented 1 year ago

Confirmed. This is a bug in Koschei code.

mizdebsk commented 1 year ago

Extracted stack trace from the logs:

Exception on /affected-by/python3-ply [GET]
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.10/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.10/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.10/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/share/koschei/koschei/frontend/views.py", line 905, in affected_by
    return render_template("affected-by.html", package_state=package_state,
  File "/usr/lib/python3.10/site-packages/flask/templating.py", line 147, in render_template
    return _render(
  File "/usr/lib/python3.10/site-packages/flask/templating.py", line 128, in _render
    rv = template.render(context)
  File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/usr/share/koschei/templates/affected-by.html", line 3, in <module>
    {% set change_type = 'upgrade' if evr1 <= evr2 else 'downgrade' %}
  File "/usr/share/koschei/koschei/db.py", line 288, in __le__
    return self._cmp(other) <= 0
  File "/usr/share/koschei/koschei/db.py", line 320, in _cmp
    return util.compare_evr(self.__composite_values__(), other.__composite_values__())
  File "/usr/share/koschei/koschei/util.py", line 116, in compare_evr
    return rpm.labelCompare(evr1, evr2)
ValueError: invalid version
hroncok commented 1 year ago

ValueError: invalid version happens with empty strings.