joaorb64 / TournamentStreamHelper

101 stars 38 forks source link

4.641: Froze and crash #153

Closed shadowdragon2007 closed 1 year ago

shadowdragon2007 commented 2 years ago

I was in the middle of my weekly tournament stream. Went to load the next match and I got this error:

Traceback (most recent call last): File "main.py", line 4, in import src File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "src__init.py", line 1, in from .TournamentStreamHelper import * File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "src\TournamentStreamHelper.py", line 7, in from src.TSHAboutWidget import TSHAboutWidget File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "src\TSHAboutWidget.py", line 7, in from .StateManager import StateManager File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "src\StateManager.py", line 183, in StateManager.LoadState() File "src\StateManager.py", line 23, in LoadState StateManager.state = json.load(file) File "json\init.py", line 293, in load File "json\init__.py", line 357, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

ZombieHDGaming commented 2 years ago

Huh, I've seen that a few times before with my own local, I just figured my team had accidentally caused something to happen due to how I added the swap teams endpoint.

Just to help grab more info, can you explain a bit more of what you were doing leading up to that error? I also want to track it down

shadowdragon2007 commented 2 years ago

I was using the twitch auto load to pre load the information into the overlay. My TO either had mistaken the second stream name as our main stream. Or I was trying to mark the next stream match and while it was looking for the actual stream match, it found it while I was actually marking it. All I know is that it happen while I trying to preload the next stream match into into the program.

shadowdragon2007 commented 2 years ago

And when I try to re download and re install the program, this error popped up: Traceback (most recent call last): File "main.py", line 4, in import src File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "src__init.py", line 1, in from .TournamentStreamHelper import * File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "src\TournamentStreamHelper.py", line 782, in window = Window() File "src\TournamentStreamHelper.py", line 147, in init self.scoreboard = TSHScoreboardWidget() File "src\TSHScoreboardWidget.py", line 63, in init self.tabStage.layout().addWidget(TSHScoreboardStageWidget(scoreboard=self)) File "src\TSHScoreboardStageWidget.py", line 119, in init__ self.signals.rulesets_changed.connect(self.LoadRulesets) RuntimeError: wrapped C/C++ object of type TSHScoreboardStageWidgetSignals has been deleted

ZombieHDGaming commented 2 years ago

I don't think it was so much an issue from what you or your TO were doing, I think TSH might've accidentally caused an issue somewhere and data got slightly messed up, because my team has run into a similar thing (luckily not this week).

As a short term fix if it does happen, clear out everything except for the layout and userdata folders and add everything else around it from either the zip file or a redownload and launch it back up, that fixed it for me last time.

shadowdragon2007 commented 2 years ago

I literally had to go back a few versions of TSH to find one that will run. I tried the 4.6x files and hit a dead end. And then I had to find a file that was sent to me earlier to fix an issue I had earlier with one of the player's profile and then update that file.

shadowdragon2007 commented 2 years ago

So I did the delete all but those two files. It worked up until I try to load load a match. Went to the match select list. Clicked on one of the matches, and then there is an auto update countdown on the bottom of the program and then it froze and then it crashed.

joaorb64 commented 2 years ago

From the description, maybe this is related to some network issue (Either internet dropped for a moment, or startgg itself was overloaded... or even some random unexpected value coming from the API. Either way we need to ensure all calls in the tournament data provider class are using try/except to prevent crashes, and all things that update the UI from other threads are using signals.

shadowdragon2007 commented 2 years ago

The strange thing is that my second stream had no issues and it is running current version as well.

shadowdragon2007 commented 2 years ago

Also, whenever I have to change something, like characters or swap with player position, like it will also freeze up for a moment and then the program crashes after.

ZombieHDGaming commented 2 years ago

Just got around to reading this from last night, my team has also reported the same thing with swapping players. I think it might be something in TSH passing something wrong to the StateManager and causing these issues.

shadowdragon2007 commented 2 years ago

I remember it working perfectly fine when I was using it last week. And there was no major hiccup when I was running both my streams. Granted, I was remotely running the second stream PC through my main one. I won’t know till next week to see if it was API or internet that cause my program to go the way it did. Or is it because I ran one too many programs.

joaorb64 commented 2 years ago

I've added a commit to avoid the crash reported on the opening post, where after a crash the program wouldn't even open. I'll perform some internet drop tests here (this also validates cases where startgg itself fails).

SevenThomsen commented 2 years ago

Also had this issue yesterday after I updated my locals overlay to use 4.641. Would randomly close (mainly when selecting sets to autofill from the event it felt like) and at one point, it wouldn't open again without the error above. I had to emergency delete the overlay folder and paste the original back again which fixed the issue long enough for the tournament to end.

SevenThomsen commented 2 years ago

It's also worth noting that OBS showed a much higher than normal amount of dropped frames during the event. I was dropping around 0.5% on the network side, while that's usually around 0.1% for this venue.

shadowdragon2007 commented 2 years ago

So last night, everything was running smoothly up until we got to losers finals. While using the load set to get the losers finals info, the program closes out while trying to load the player information. The program started up successfully but then crash after trying to load the set. Got the error, reinstalled the program again, Thought I could enter the tags manually, but it crashed as soon as I load up the first tag. Then it started working again after trying to use load set. When it was time for grands, the program froze up again and then crashed. Got an error on startup, but strange enough, the program was still was able to run. Finally got the names in, had to swap, then the program crashed again. Took at least another two attempts before the program was able to stay on after the set was loaded and player names swapped.

Wolfy76700 commented 2 years ago

I've had a few JSON loading errors myself (Though not as often), which caused the program to crash on startup, and usually what I do to fix it is remove the out/program_state.json file

Granted we still need to try and find the core of the problem though, I'm guessing there must be some weird edge cases with data retrieval we're not catching

shadowdragon2007 commented 2 years ago

One thing I did notice last night, when I saw the program does it data retrieval, Like it start the countdown at 4 and freezes right there. It either leads to the program crashing or it retrieves the data and countdown timer jumps to 1 and it resumes as normal.

Wolfy76700 commented 1 year ago

Is this crash still a thing? Did we get to the root cause of it? (Maybe I should rename it to something more explicit)

SevenThomsen commented 1 year ago

I haven't had this issue in a while, it just sort of slowly started happening less and less with new versions. Now I just rarely get a crash when doing something like loading bracket or player lists

Wolfy76700 commented 1 year ago

OK, what I'm going to do then is close this specific bug for now if @shadowdragon2007 agrees. If you run into a crash again, please reopen a bug with a description of what you were doing, the tournament link as well as the following files: