gbtami / pychess-variants

Chess variant server
https://www.pychess.org
GNU Affero General Public License v3.0
229 stars 112 forks source link

Daily puzzle links to 500 Internal Server Error #1446

Closed randompearl-stack closed 2 months ago

randompearl-stack commented 2 months ago

https://github.com/gbtami/pychess-variants/assets/126312812/c4bf4160-2086-4ec8-bacc-6e9e96bc1de0

gbtami commented 2 months ago

I find this in the logs:

2024-05-06T06:57:25.948293+00:00 app[web.1]: +0000 2024-05-06 06:57:25.946 [ERROR] aiohttp.server:421 Error handling request
2024-05-06T06:57:25.948296+00:00 app[web.1]: Traceback (most recent call last):
2024-05-06T06:57:25.948297+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
2024-05-06T06:57:25.948297+00:00 app[web.1]: resp = await request_handler(request)
2024-05-06T06:57:25.948297+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-06T06:57:25.948298+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
2024-05-06T06:57:25.948298+00:00 app[web.1]: resp = await handler(request)
2024-05-06T06:57:25.948298+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^
2024-05-06T06:57:25.948299+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
2024-05-06T06:57:25.948299+00:00 app[web.1]: return await handler(request)
2024-05-06T06:57:25.948299+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^
2024-05-06T06:57:25.948300+00:00 app[web.1]: File "/app/server/server.py", line 94, in redirect_to_https
2024-05-06T06:57:25.948301+00:00 app[web.1]: return await handler(request)
2024-05-06T06:57:25.948301+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^
2024-05-06T06:57:25.948301+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.12/site-packages/aiohttp_session/__init__.py", line 199, in factory
2024-05-06T06:57:25.948301+00:00 app[web.1]: response = await handler(request)
2024-05-06T06:57:25.948302+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^
2024-05-06T06:57:25.948302+00:00 app[web.1]: File "/app/server/server.py", line 57, in handle_404
2024-05-06T06:57:25.948302+00:00 app[web.1]: return await handler(request)
2024-05-06T06:57:25.948303+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^
2024-05-06T06:57:25.948303+00:00 app[web.1]: File "/app/server/index.py", line 552, in index
2024-05-06T06:57:25.948303+00:00 app[web.1]: dafault_perf = default_puzzle_perf(puzzle["eval"])
2024-05-06T06:57:25.948304+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-06T06:57:25.948304+00:00 app[web.1]: File "/app/server/puzzle.py", line 242, in default_puzzle_perf
2024-05-06T06:57:25.948304+00:00 app[web.1]: perf["gl"]["r"] = MU + 200 * (int(puzzle_eval[1:]) - 2)
2024-05-06T06:57:25.948304+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^

2024-05-06T06:57:25.948305+00:00 app[web.1]: ValueError: invalid literal for int() with base 10: ''
2024-05-06T06:57:25.948589+00:00 app[web.1]: +0000 2024-05-06 06:57:25.948 [INFO] aiohttp.access:211 10.1.35.228 [06/May/2024:06:57:25 +0000] "GET /puzzle/daily HTTP/1.1" 500 420 "https://www.pychess.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0"
gbtami commented 2 months ago

Caused by this puzzle: {"_id":"kqRmS","eval":"#","fen":"10/6P3/10/p5p1p1/5p1prb/5Ppprp/P5pAka/6Kbcq w - - 0 1","gameId":"akBIp4iK","moves":"h2g4,a5a4,g7g8c","review":true,"type":"defensive","uploadedBy":"nello726","variant":"capablanca","played":28,"perf":{"gl":{"r":1609.9893938884056,"d":105.2438706618987,"v":0.06002958799057697},"la":{"$date":"2023-07-21T03:08:12.833Z"},"nb":19},"up":1,"down":1}