#159 Weird cache state after change in source data for fedora_releases
Opened 2 years ago by frantisekz. Modified 2 years ago

Sometime yesterday, fedfind was updated not to include Fedora 32 in current Fedora releases. Everything seemed okay, the release disappeared from the frontend and sync commands continued to operate normally, without trying to include Fedora 32.

However, /api/v1/package_versions/<package> endpoint started to crash on KeyError: 'Fedora 32'. That stopped after I manually refreshed CACHE for 'fedora_releases' handle which returned even the Fedora 32 on CACHE.get('fedora_releases') in debug console before refreshing it manually.

I should have checked the timestamp in db before refreshing it, forgot to do that :(

app          2021-06-04 12:51:33 ERROR   Exception on /api/v1/package_versions/postfix [GET]
Traceback (most recent call last):
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/app-root/lib/python3.6/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/app-root/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/app-root/src/oraculum/controllers/packager_dashboard.py", line 196, in route_package_versions
    return(jsonify(versions.get_package_versions(package)))
  File "/opt/app-root/src/oraculum/utils/versions.py", line 156, in get_package_versions
    if package in versions_cache[release_string]:
KeyError: 'Fedora 32'

Is this causing the data returned by the API to be old / incorrect? I'm starting to get bug reports about my packages being out of date because the version table on src.fedoraproject.org shows outdated information. For example, syncthing was updated to version 1.17.0 on all branches two weeks ago, but this is not reflected at all, the state for Fedora 33 seems to have been out of date for even longer, and the fact that the package is available on EPEL 8 is not reflected at all.

@decathorpe this should be fixed for about 2 hours by having deployed https://pagure.io/fedora-qa/oraculum/pull-request/164 (see https://pagure.io/fedora-infrastructure/issue/10066 for original report ).

I am really sorry for the mess this has caused, I'll try to find out if there is a more reliable way to get to repo metadata (repomd.xml to be exact in this case) files we need.

(This is a bit different issue than the issue described here.)

Indeed, this is fixed now, thanks!

Login to comment on this ticket.

Metadata