usgo / agagd

American Go Association Games Database (AGAGD)
https://agagd.usgo.org
MIT License
47 stars 30 forks source link

Searching for Player's Name Results Times Out and No Results #52

Closed michaelhiiva closed 5 years ago

michaelhiiva commented 5 years ago

Overview

Searching for a player's name does not return any results and page times out.

How to Reproduce

Error Log

[Mon May 20 12:41:10.957518 2019] [wsgi:error] [pid 30652] [remote 12.222.130.66:58999] failing game_id: 968122
[Mon May 20 12:41:11.272035 2019] [wsgi:error] [pid 30652] [remote 12.222.130.66:58999] failing game_id: 625662
[Mon May 20 12:41:11.856535 2019] [wsgi:error] [pid 30652] [remote 12.222.130.66:58999] failing game_id: 623202
[Mon May 20 13:10:39.564175 2019] [wsgi:error] [pid 30637] [remote 144.121.211.10:54640] failing game_id: 752882
[Mon May 20 18:14:38.264658 2019] [wsgi:error] [pid 32302] [client 144.121.211.10:54629] Timeout when reading response headers from daemon process 'agagd.usgo.org': /var/www/agagd.usgo.org/current/agagd/agagd/wsgi.py, referer: https://agagd.usgo.org/
[Mon May 20 18:16:08.671677 2019] [wsgi:error] [pid 32121] [client 128.8.206.40:57982] Timeout when reading response headers from daemon process 'agagd.usgo.org': /var/www/agagd.usgo.org/current/agagd/agagd/wsgi.py, referer: https://agagd.usgo.org/
[Mon May 20 18:22:25.316725 2019] [wsgi:error] [pid 32589] [client 174.6.100.55:42020] Truncated or oversized response headers received from daemon process 'agagd.usgo.org': /var/www/agagd.usgo.org/current/agagd/agagd/wsgi.py, referer: https://agagd.usgo.org/
hndrewaall commented 5 years ago

This is still the case :(

dfannius commented 5 years ago

I think this is correlated with the server upgrade mentioned in this post on May 15. I sent email to webmaster@usgo.org as directed but didn't get a response.

dfannius commented 5 years ago

In the meantime, if you want to search for a player's page, you can search by name https://www.usgo.org/search-ratings to look up their AGA ID, then go to https://agagd.usgo.org/player/AGA-ID/ directly (making the appropriate substitution).

dfannius commented 5 years ago

An acquaintance who knows Django (I don't) looked at this issue and is of the opinion that the problem is that there are no database indexes on full_name and family_name, causing the query to be extremely slow and eventually time out. Their proposed fix is to add db_index=True to the Charfield declarations for those two fields in the Member specification in https://github.com/usgo/agagd/blob/master/agagd/agagd_core/models.py, and then either run a database migration or manually add those two indexes to the database.

vash3g commented 5 years ago

@dfannius If your friend can send a PR we would love to see it. We'll check to see what we can change in the mean time.

dfannius commented 5 years ago

I've created a PR with the code part of the proposed changes as #54.