Pull requests generating 500 error #13346

Open
opened 2026-05-14 16:54:38 +00:00 by orion · 9 comments

Description of request

I have two packit generated branches that generate 500 errors when I try to create a pull request form them. One is:

https://src.fedoraproject.org/fork/orion/rpms/libmamba/diff/rawhide..rawhide-update

the other is:

https://src.fedoraproject.org/fork/orion/rpms/python-conda-index/diff/rawhide..rawhide-update

### Description of request I have two packit generated branches that generate 500 errors when I try to create a pull request form them. One is: https://src.fedoraproject.org/fork/orion/rpms/libmamba/diff/rawhide..rawhide-update the other is: https://src.fedoraproject.org/fork/orion/rpms/python-conda-index/diff/rawhide..rawhide-update
Owner

There's a traceback that seems related to this:

[2026-05-14 16:59:19,493] ERROR in flask_app: Error while processing request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.6/site-packages/pagure/ui/fork.py", line 1830, in new_request_pull
    project_to=project_to,
  File "/usr/lib/python3.6/site-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/usr/lib/python3.6/site-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/usr/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.6/site-packages/pagure/templates/repo_new_pull_request.html", line 17, in top-level template code
    {% set tag = "home" %}
  File "/usr/lib/python3.6/site-packages/pagure/templates/repo_master.html", line 27, in top-level template code
    {% set tag = "home" %}
  File "/usr/lib/python3.6/site-packages/pagure/templates/master.html", line 170, in top-level template code
    {% block content %}{% endblock %}
  File "/usr/lib/python3.6/site-packages/pagure/templates/repo_master.html", line 289, in block "content"
    {% block repo %}
  File "/usr/lib/python3.6/site-packages/pagure/templates/repo_new_pull_request.html", line 319, in block "repo"
    {{repo_renderdiff(diff=diff,
  File "/usr/lib/python3.6/site-packages/jinja2/runtime.py", line 579, in _invoke
    rv = self._func(*arguments)
  File "/usr/lib/python3.6/site-packages/pagure/templates/_repo_renderdiff.html", line 162, in template
    {{ patch | patch_to_diff | format_loc(
  File "/usr/lib/python3.6/site-packages/pagure/ui/filters.py", line 147, in format_loc
    if hasattr(commit_hash, "hex"):
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'new_id'

There's a traceback that seems related to this: ``` [2026-05-14 16:59:19,493] ERROR in flask_app: Error while processing request Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise raise value File "/usr/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/lib/python3.6/site-packages/pagure/ui/fork.py", line 1830, in new_request_pull project_to=project_to, File "/usr/lib/python3.6/site-packages/flask/templating.py", line 134, in render_template context, ctx.app) File "/usr/lib/python3.6/site-packages/flask/templating.py", line 116, in _render rv = template.render(context) File "/usr/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/usr/lib/python3.6/site-packages/pagure/templates/repo_new_pull_request.html", line 17, in top-level template code {% set tag = "home" %} File "/usr/lib/python3.6/site-packages/pagure/templates/repo_master.html", line 27, in top-level template code {% set tag = "home" %} File "/usr/lib/python3.6/site-packages/pagure/templates/master.html", line 170, in top-level template code {% block content %}{% endblock %} File "/usr/lib/python3.6/site-packages/pagure/templates/repo_master.html", line 289, in block "content" {% block repo %} File "/usr/lib/python3.6/site-packages/pagure/templates/repo_new_pull_request.html", line 319, in block "repo" {{repo_renderdiff(diff=diff, File "/usr/lib/python3.6/site-packages/jinja2/runtime.py", line 579, in _invoke rv = self._func(*arguments) File "/usr/lib/python3.6/site-packages/pagure/templates/_repo_renderdiff.html", line 162, in template {{ patch | patch_to_diff | format_loc( File "/usr/lib/python3.6/site-packages/pagure/ui/filters.py", line 147, in format_loc if hasattr(commit_hash, "hex"): jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'new_id' ```
Member

So ... I technically fixed this by changing the code on disk from:

    commit_hash = commit
    if hasattr(commit_hash, "hex"):
        commit_hash = commit_hash.hex

...to:

    commit_hash = commit
    # This can traceback, so try
    try:
    # if hasattr(commit_hash, "hex"):
        commit_hash = commit_hash.hex
    except:
        commit_hash = commit

...and then restarting httpd/pagure so it reloaded that file.

Upstream is already slightly different, but that bit is the same:

https://pagure.io/pagure/blob/master/f/pagure/ui/filters.py#_150

I'll open a bug upstream, but at least it should work for a bit. Not sure if we want to keep this issue open, or close it now.

So ... I technically fixed this by changing the code on disk from: ``` commit_hash = commit if hasattr(commit_hash, "hex"): commit_hash = commit_hash.hex ``` ...to: ``` commit_hash = commit # This can traceback, so try try: # if hasattr(commit_hash, "hex"): commit_hash = commit_hash.hex except: commit_hash = commit ``` ...and then restarting httpd/pagure so it reloaded that file. Upstream is already slightly different, but that bit is the same: https://pagure.io/pagure/blob/master/f/pagure/ui/filters.py#_150 I'll open a bug upstream, but at least it should work for a bit. Not sure if we want to keep this issue open, or close it now.
Member
Upstream issue: https://pagure.io/pagure/issue/5552
james self-assigned this 2026-05-14 19:58:37 +00:00
Owner

Well, upstream is pretty much dead at this point.

I guess we should add a patch to the epel8 build and deploy it, or setup a hotfix in ansible that applies this if we think it's the right approach.

Well, upstream is pretty much dead at this point. I guess we should add a patch to the epel8 build and deploy it, or setup a hotfix in ansible that applies this if we think it's the right approach.
Member

I did a scratch build of an rpm with the fix: https://koji.fedoraproject.org/koji/taskinfo?taskID=145655907

@abompard I heard you had a couple of patches you wanted to get into a new build ... if you ping me on matrix with them or something, I can add them and do a real build in f44-infra tomorrow.

I did a scratch build of an rpm with the fix: https://koji.fedoraproject.org/koji/taskinfo?taskID=145655907 @abompard I heard you had a couple of patches you wanted to get into a new build ... if you ping me on matrix with them or something, I can add them and do a real build in f44-infra tomorrow.
Owner

@james Wouldn't it be better to add patches to ansible directly? There is even task file for that infra/ansible@0ea1c9f292/roles/distgit/pagure/tasks/patches.yml

@james Wouldn't it be better to add patches to ansible directly? There is even task file for that https://forge.fedoraproject.org/infra/ansible/src/commit/0ea1c9f2923b78980ed3222a7008ee41feb01402/roles/distgit/pagure/tasks/patches.yml
Owner

A few things to note: pagure01/pagure-stg01 are rhel8 hosts. ;) So we need epel8 builds.

The thought I think was to do actual epel8 builds so we update any people who are still using it on rhel8.

A few things to note: pagure01/pagure-stg01 are rhel8 hosts. ;) So we need epel8 builds. The thought I think was to do actual epel8 builds so we update any people who are still using it on rhel8.
Member

@abompard I heard you had a couple of patches you wanted to get into a new build ... if you ping me on matrix with them or something, I can add them and do a real build in f44-infra tomorrow.

Ah yeah, the patches that we currently deploy are in /srv/web/infra/bigfiles/hotfixes/pagure/ on batcave, could you try to add them too please? That would be great.

> @abompard I heard you had a couple of patches you wanted to get into a new build ... if you ping me on matrix with them or something, I can add them and do a real build in f44-infra tomorrow. Ah yeah, the patches that we currently deploy are in `/srv/web/infra/bigfiles/hotfixes/pagure/` on batcave, could you try to add them too please? That would be great.
Owner

Did this ever get added there? I don't see it off hand, but might be missing it..

Did this ever get added there? I don't see it off hand, but might be missing it..
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
infra/tickets#13346
No description provided.