DragonMinded / bemaniutils

A collection of utilities which together make up a hobby game services network and associated utilities for historic games in the BEMANI series.
The Unlicense
224 stars 67 forks source link

Jubeat Prop: TypeError: object of type 'NoneType' has no len() #90

Open ivan3612 opened 1 month ago

ivan3612 commented 1 month ago

After New Card registered, services provided such error in response of get_mdata

192.168.0.90 - - [16/Sep/2024 16:35:25] "POST /?model=L44:J:C:A:2016031700&module=gametop&method=get_mdata HTTP/1.1" 200 - Received request:

0 31074902 2 false

Traceback (most recent call last): File "E:\Jubeat\bemaniutils-trunk\bemani\utils\services.py", line 65, in receive_request resp = dispatch.handle(req) ^^^^^^^^^^^^^^^^^^^^ File "E:\Jubeat\bemaniutils-trunk\bemani\backend\dispatch.py", line 150, in handle response = handler(request) ^^^^^^^^^^^^^^^^ File "E:\Jubeat\bemaniutils-trunk\bemani\backend\jubeat\prop.py", line 612, in handle_gametop_get_mdata_request root = self.get_scores_by_extid(extid, mdata_ver, 3) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Jubeat\bemaniutils-trunk\bemani\backend\jubeat\base.py", line 182, in get_scores_by_extid if len(scores) < 50: ^^^^^^^^^^^ TypeError: object of type 'NoneType' has no len() Screenshot 2024-09-16 165111

DragonMinded commented 1 month ago

Oh, interesting, I see what's going on here. I can attempt to fix this tonight but I might forget.

ivan3612 commented 1 month ago

Thank you I should also mention that the database is newly built and without any data inside

DragonMinded commented 1 month ago

On further inspection, this seems like it shouldn't be a problem, because we always set the cache properly on first iteration. Is your instance perhaps not configured for memcached OR a file cache? I think in that case, flask would just do an in-memory instance and I have no idea what happens between loops.

I can still patch so it doesn't crash, but I think your setup might be a bit wonky.

DragonMinded commented 1 month ago

Alternatively, it could be more than 60 seconds between requests, which is the lifetime of the cache. Unlikely, but a possibility.

DragonMinded commented 1 month ago

Give 253dd52b679fdd017067835e931b6052b6c467ab a try. It should at least stop crashes, but I still suspect something is up with your setup.