Windows200000 / TwitchDropsMiner-updated

An app that allows you to AFK mine timed Twitch drops, with automatic drop claiming and channel switching.
MIT License
353 stars 21 forks source link

Error that makes tdm unresponsive #173

Closed T4bletopG4mes closed 3 months ago

T4bletopG4mes commented 3 months ago

Description

TDM becomes unresponsive due to the log error below.

To Reproduce

Just open TDM, not sure what drop causes it, see screenshot provided for my active drops.

Expected behavior

Not to do that lol.

Observed behavior

TDM becomes unresponsive.

Screenshots

image

Logs

!!!required_minutes for "Support a Streamer Pack" is 0 This could be due to a subscription requirement, tracked in Issue #101!!! 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... 05:03:05: Cannot connect to Twitch, retrying in 2 seconds... (It keeps spamming that till I terminate it) 05:03:15: Fatal error encountered: 05:03:15: 05:03:15: Traceback (most recent call last): 05:03:15: File "channel.py", line 249, in get_stream 05:03:15: File "twitch.py", line 1543, in gql_request 05:03:15: File "contextlib.py", line 199, in aenter 05:03:15: File "twitch.py", line 1494, in request 05:03:15: exceptions.ExitRequest: Application was requested to exit 05:03:15: 05:03:15: The above exception was the direct cause of the following exception: 05:03:15: 05:03:15: Traceback (most recent call last): 05:03:15: File "main.py", line 160, in main 05:03:15: File "twitch.py", line 772, in run 05:03:15: File "twitch.py", line 915, in _run 05:03:15: File "channel.py", line 286, in update_stream 05:03:15: File "channel.py", line 253, in get_stream 05:03:15: exceptions.MinerException: Channel: blackghost_ttv 05:03:15: 05:03:15: Exiting... 05:03:15: 05:03:15: Application Terminated. 05:03:15: Close the window to exit the application.

OS

Windows 10 (64-bit)

Build

.exe

Version/Commit

v15.8.2

Additional context

No response

T4bletopG4mes commented 3 months ago

Pretty sure its Cult of the Lamb causing the error image

axi92 commented 3 months ago

I have the same issue on Ubuntu 20.04 with the AppImage when I start it it works fine but after like 3hours it's stuck and unresponsive

Logs Verbose Logs: ``` 2024-08-22 13:32:54.298: CALL: No drop update from the websocket received 2024-08-22 13:33:15.554: CALL: No drop update from the websocket received 2024-08-22 13:33:36.730: CALL: No drop update from the websocket received 2024-08-22 13:33:36.731: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 587/720) 2024-08-22 13:33:38.745: INFO: cmdrdrmrwolf goes ONLINE 2024-08-22 13:33:40.275: INFO: tuka__d goes OFFLINE 2024-08-22 13:33:41.354: CALL: Channel update from websocket: tuka__d 2024-08-22 13:33:46.636: CALL: Channel update from websocket: W0rldSp0wn 2024-08-22 13:33:57.732: CALL: No drop update from the websocket received 2024-08-22 13:34:00.937: CALL: wows_wg_pls_buff_colbert stays OFFLINE 2024-08-22 13:34:18.778: CALL: No drop update from the websocket received 2024-08-22 13:34:39.979: CALL: No drop update from the websocket received 2024-08-22 13:34:39.980: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 588/720) 2024-08-22 13:35:01.171: CALL: No drop update from the websocket received 2024-08-22 13:35:22.303: CALL: No drop update from the websocket received 2024-08-22 13:35:41.593: CALL: tuka__d stays OFFLINE 2024-08-22 13:35:43.561: CALL: No drop update from the websocket received 2024-08-22 13:35:43.562: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 589/720) 2024-08-22 13:35:46.890: CALL: W0rldSp0wn stays OFFLINE 2024-08-22 13:36:04.629: CALL: No drop update from the websocket received 2024-08-22 13:36:25.776: CALL: No drop update from the websocket received 2024-08-22 13:36:47.115: CALL: No drop update from the websocket received 2024-08-22 13:36:47.116: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 590/720) 2024-08-22 13:37:08.246: CALL: No drop update from the websocket received 2024-08-22 13:37:29.470: CALL: No drop update from the websocket received 2024-08-22 13:37:46.088: INFO: arturio_golubika goes OFFLINE 2024-08-22 13:37:47.145: CALL: Channel update from websocket: arturio_golubika 2024-08-22 13:37:55.572: CALL: No drop update from the websocket received 2024-08-22 13:37:55.574: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 591/720) 2024-08-22 13:38:16.774: CALL: No drop update from the websocket received 2024-08-22 13:38:37.969: CALL: No drop update from the websocket received 2024-08-22 13:38:59.197: CALL: No drop update from the websocket received 2024-08-22 13:38:59.198: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 592/720) 2024-08-22 13:39:11.944: CALL: Channel update from websocket: Momzzik 2024-08-22 13:39:20.387: CALL: No drop update from the websocket received 2024-08-22 13:39:41.574: CALL: No drop update from the websocket received 2024-08-22 13:39:47.557: CALL: arturio_golubika stays OFFLINE 2024-08-22 13:40:02.781: CALL: No drop update from the websocket received 2024-08-22 13:40:02.782: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 593/720) 2024-08-22 13:40:12.671: INFO: NiT_K goes OFFLINE 2024-08-22 13:40:13.817: CALL: Channel update from websocket: NiT_K 2024-08-22 13:40:19.920: CALL: Channel update from websocket: desmodromique 2024-08-22 13:40:23.950: CALL: No drop update from the websocket received 2024-08-22 13:40:42.204: CALL: Channel update from websocket: desmodromique 2024-08-22 13:40:45.280: CALL: No drop update from the websocket received 2024-08-22 13:41:06.445: CALL: No drop update from the websocket received 2024-08-22 13:41:06.446: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 594/720) 2024-08-22 13:41:11.035: INFO: styperek goes OFFLINE 2024-08-22 13:41:12.125: CALL: Channel update from websocket: styperek 2024-08-22 13:41:12.606: INFO: Momzzik status has been updated (🎁: βœ” -> βœ”) 2024-08-22 13:41:15.419: INFO: Valtagez goes OFFLINE 2024-08-22 13:41:16.524: CALL: Channel update from websocket: Valtagez 2024-08-22 13:41:26.071: CALL: Drop update from websocket: Freshly Brewed Victory Pose (Overwatch 2, 595/720) 2024-08-22 13:41:48.730: CALL: No drop update from the websocket received 2024-08-22 13:42:09.888: CALL: No drop update from the websocket received 2024-08-22 13:42:14.063: CALL: NiT_K stays OFFLINE 2024-08-22 13:42:20.568: INFO: desmodromique status has been updated (🎁: βœ” -> βœ”) 2024-08-22 13:42:21.911: CALL: Drop update from websocket: Freshly Brewed Victory Pose (Overwatch 2, 596/720) 2024-08-22 13:42:52.277: CALL: No drop update from the websocket received 2024-08-22 13:43:12.367: CALL: styperek stays OFFLINE 2024-08-22 13:43:13.438: CALL: No drop update from the websocket received 2024-08-22 13:43:16.769: CALL: Valtagez stays OFFLINE 2024-08-22 13:43:34.515: CALL: No drop update from the websocket received 2024-08-22 13:43:34.516: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 597/720) 2024-08-22 13:43:55.755: CALL: No drop update from the websocket received 2024-08-22 13:43:58.238: CALL: Channel update from websocket: sadicaz 2024-08-22 13:44:01.545: INFO: kvhundi goes OFFLINE 2024-08-22 13:44:02.643: CALL: Channel update from websocket: kvhundi 2024-08-22 13:44:04.833: CALL: Channel update from websocket: neuu 2024-08-22 13:44:17.018: CALL: No drop update from the websocket received 2024-08-22 13:44:38.282: CALL: No drop update from the websocket received 2024-08-22 13:44:38.283: CALL: Drop progress from active search: Freshly Brewed Victory Pose (Overwatch 2, 598/720) 2024-08-22 13:44:38.721: CALL: Drop update from websocket: Freshly Brewed Victory Pose (Overwatch 2, 598/720) 2024-08-22 13:44:59.508: CALL: No drop update from the websocket received 2024-08-22 13:45:20.724: CALL: No drop update from the websocket received 2024-08-22 13:45:22.229: CALL: Channel update from websocket: SHAREZA 2024-08-22 13:45:36.335: CALL: Drop update from websocket: Freshly Brewed Victory Pose (Overwatch 2, 599/720) 2024-08-22 13:45:58.719: INFO: sadicaz status has been updated (🎁: βœ” -> βœ”) 2024-08-22 13:46:02.885: CALL: kvhundi stays OFFLINE 2024-08-22 13:46:03.215: CALL: No drop update from the websocket received 2024-08-22 13:46:05.317: INFO: neuu status has been updated (🎁: βœ” -> βœ”) 2024-08-22 13:46:24.326: CALL: No drop update from the websocket received 2024-08-22 13:46:31.626: CALL: Maintenance task requests a reload ```

And I have seen the same issue with the Cannot connect to Twitch, retrying in 2 seconds... Spam.

T4bletopG4mes commented 3 months ago

Seems like it has trouble gathering channels and/or cant communicate with twitch.

zelda0079 commented 3 months ago

I have the same issue on Ubuntu 20.04 with the AppImage

Logs And I have seen the same issue with the Cannot connect to Twitch, retrying in 2 seconds... Spam.

Try to delete the cookies.jar.

AllanVester commented 3 months ago

I have gotten this problem a lot as well.

I believe I have found the culprit being that when gathering many ACL channels, like 100+ it tends to freeze. This gets even worse when there are like 500+ ACL channels. I have, in the worse case, seen TDM taking some 30 minutes just to complete gathering ACL channels. That's 30 minutes where TDM is not mining. TDM, in my experience, has never liked when there are too many ACL channels.

Take a look at these lines: https://github.com/Windows200000/TwitchDropsMiner-updated/blob/9b8427d436d24eb640570155eabb34d3b76ce519/twitch.py#L907-L908

If we change how many ACL channels are allowed per campaign, let's say, for example, 50, TDM will no longer freeze for long periods of time when gathering channels.

Here is my fix:

from itertools import chain, islice
...
if campaign.allowed_channels:
    # limit to 50 channels per campaign
    acl_channels.update(islice(campaign.allowed_channels, 50))

The only problem with this is that it will only get the first 50 in the "campaign.allowed_channels", meaning that some channels with higher view count or, even worse, all 50 ACL channels are offline and, therefore, might not be added to the list.

Maybe one could integrate an inputbox in the settings menu where one can enter how many ACL channels TDM is allowed to gather. If one enters 50, it only gathers the first 50 ACL channels per campaign, and if one enters 0 or nothing, it should gather all ACL channels per campaign, but that is just an idea.

T4bletopG4mes commented 3 months ago

Seems to have fixed itself for me, but Im sure there are some things that need to be changed still.

axi92 commented 3 months ago

I made a dirty little script that restarts TDP once per hour to keep it farming. I know its not clean but it does the trick, if somebody wants it:

Runs TDM in a xvfb (virtual framebuffer) no window visible, should work also in a docker container (not tested)

#!/bin/bash
while true
    do
        echo 'Starting programm.'
    xvfb-run -a ./Twitch.Drops.Miner-x86_64.AppImage --log &
    date
    echo 'Sleeping 1 hour'
    sleep 1h
    echo 'Killing process now!'
    kill -s 9 $(ps -ef | grep -v grep | grep Twitch | awk '{print $2}')
    sleep 3
    kill -s 9 $(ps -ef | grep -v grep | grep Twitch | awk '{print $2}')
    sleep 3
    echo 'Killing done'
    done
Windows200000 commented 3 months ago

Tracked in #172