louking / rrwebapp

Race Results Web Application
0 stars 1 forks source link

_editparticipants bad gateway error with a lot of data #609

Open louking opened 5 months ago

louking commented 5 months ago

MD Grand Prix club, 2024-06-09 database for Belair Town Run

chrome_bjEboRPTsu

reproduced seeing 502 error (Bad Gateway) on the response after about 60 seconds-- is this a timeout or something?

I did see this exception email, but only once after repeating the problem multiple times. I think it isn't the root cause, and rather there's an timeout for the response internally.

Message type:       ERROR
Location:           /var/www/scoretility.com/venv/lib/python3.9/site-packages/flask/app.py:1741
Module:             app
Function:           log_exception
Time:               2024-06-08 18:56:07,860
User:               ********************************

Message:

Exception on /admin/_editparticipants/61500 [GET]

Traceback (most recent call last):
  File "/var/www/scoretility.com/venv/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/scoretility.com/venv/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/scoretility.com/venv/lib/python3.9/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/scoretility.com/venv/lib/python3.9/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/var/www/scoretility.com/venv/lib/python3.9/site-packages/flask_login/utils.py", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/var/www/scoretility.com/venv/lib/python3.9/site-packages/flask/views.py", line 107, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/var/www/scoretility.com/venv/lib/python3.9/site-packages/flask/views.py", line 188, in dispatch_request
    return current_app.ensure_sync(meth)(**kwargs)
  File "/var/www/scoretility.com/rrwebapp/rrwebapp/views/admin/results.py", line 319, in get
    tableselects[r.id] = getrunnerchoices(club_id, race, pool, r)
  File "/var/www/scoretility.com/rrwebapp/rrwebapp/resultsutils.py", line 147, in getrunnerchoices
    candidate = pool.findmember(thisname,result.age,race.date)
  File "/var/www/scoretility.com/rrwebapp/rrwebapp/clubmember.py", line 305, in findmember
    'ratio': getratio(name.strip().lower(),member['name'].strip().lower())})
  File "/var/www/scoretility.com/rrwebapp/rrwebapp/clubmember.py", line 93, in getratio
    return sm.ratio()
  File "/usr/local/lib/python3.9/difflib.py", line 619, in ratio
    matches = sum(triple[-1] for triple in self.get_matching_blocks())
  File "/usr/local/lib/python3.9/difflib.py", line 454, in get_matching_blocks
    i, j, k = x = self.find_longest_match(alo, ahi, blo, bhi)
  File "/usr/local/lib/python3.9/difflib.py", line 379, in find_longest_match
    for j in b2j.get(a[i], nothing):
IndexError: string index out of range

4_BATR.zip