pclipse / beammp-webgui

BeamMP Server Manager WebGUI
0 stars 1 forks source link

Limit to bulk activation of mods #3

Open Mentorius opened 1 month ago

Mentorius commented 1 month ago

Looks like activating a bunch of mods at once breaks the script. The limit seems to be about 15.

Following error will occur during a bulk activation of at least 15 mods: Traceback (most recent call last): File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1498, in __call__ return self.wsgi_app(environ, start_response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1476, in wsgi_app response = self.handle_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_login\utils.py", line 290, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\BeamMP\WebGUI\app.py", line 165, in move_mod mods_origin = load_mods_origin() ^^^^^^^^^^^^^^^^^^ File "D:\BeamMP\WebGUI\app.py", line 78, in load_mods_origin return json.load(f) ^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 293, in load return loads(fp.read(), ^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

After doing this once, every subsequent activation or deactivation will no longer work and instead outputs following error even for a single mod: Traceback (most recent call last): File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1498, in __call__ return self.wsgi_app(environ, start_response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1476, in wsgi_app response = self.handle_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 1473, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_login\utils.py", line 290, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\BeamMP\WebGUI\app.py", line 165, in move_mod mods_origin = load_mods_origin() ^^^^^^^^^^^^^^^^^^ File "D:\BeamMP\WebGUI\app.py", line 78, in load_mods_origin return json.load(f) ^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 293, in load return loads(fp.read(), ^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Lau\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 372 (char 371)

The only way to fix this seems to be to replace mods_origin.json by a fresh copy.

Activating the same 15+ mods one at a time works fine.

pclipse commented 1 month ago

Cheers, thanks man. When you say to replace mods_origin.json by a fresh copy, you mean a subsequent copy of it, or just delete the original?

Mentorius commented 1 month ago

What I meant to say is delete the file and then extract a fresh copy from the project zip.

So seems to me like activating too many mods in one go causes an error and leaves the mods_origin file in a “broken” state which in turn causes more errors.

pclipse commented 1 month ago

Ah okay, gotcha. Okay well that's good to know, thanks for finding that out. So I suppose you could have more than 15 mods enabled however you can't able them all at once. Just less than 15 at a time.

On Fri, Jul 19, 2024, 16:05 Mentorius @.***> wrote:

What I meant to say is delete the file and then extract a fresh copy from the project zip.

So seems to me like activating too many mods in one go causes an error and leaves the mods_origin file in a “broken” state which in turn causes more errors.

— Reply to this email directly, view it on GitHub https://github.com/pclipse/beammp-webgui/issues/3#issuecomment-2240331311, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6WJ7MOHHNIQQUFX6KFP63TZNGEUDAVCNFSM6AAAAABLFEI7T2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBQGMZTCMZRGE . You are receiving this because you commented.Message ID: @.***>