Windows200000 / TwitchDropsMiner-updated

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

Random crash with GQL error "PersistedQueryNotFound" #126

Open SuspiciousActivity opened 3 weeks ago

SuspiciousActivity commented 3 weeks ago

Hi there,

I wanted to check on the miner after letting it run for a while in a docker container on my linux server, and saw that it has crashed. The error message is the following:

Fatal error encountered:

Traceback (most recent call last):
  File "/usr/src/app/twitch.py", line 1736, in get_live_streams
    response = await self.gql_request(
  File "/usr/src/app/twitch.py", line 1575, in gql_request
    raise MinerException(f"GQL error: {response_json['errors']}")
exceptions.MinerException: GQL error: [{'message': 'PersistedQueryNotFound'}]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "main.py", line 160, in main
    await client.run()
  File "/usr/src/app/twitch.py", line 772, in run
    await self._run()
  File "/usr/src/app/twitch.py", line 923, in _run
    new_channels.update(await self.get_live_streams(game))
  File "/usr/src/app/twitch.py", line 1747, in get_live_streams
    raise MinerException(f"Game: {game.slug}") from exc
exceptions.MinerException: Game: assassins-creed-mirage

Exiting...

Application Terminated.
Close the window to exit the application.

Today it has been running for around 11 hours without problems, so it takes a while to crash.

Windows200000 commented 3 weeks ago

@SuspiciousActivity From README.md:

TDM is not intended for/as:

  • Mining channel points - again, it's about the drops: only. The current points you're getting are a byproduct of getting the drops, not the main goal of it.
  • Mining anything else besides Twitch drops - no, I won't be adding support for a random 3rd party site that also happens to rely on watching Twitch streams.
  • Unattended operation: worst case scenario, it'll stop working and you'll hopefully notice that at some point. Hopefully.
  • 100% uptime application, due to the underlying nature of it, expect fatal errors to happen every so often.
  • Being hosted on a remote server as a 24/7 miner.
  • Being used with more than one managed account.
  • Mining campaigns the managed account isn't linked to.

This does, however, look like it might be unrelated. What's weird, is that the error would suggest the hash is wrong, but "DirectoryPage_Game" is a request that happens at startup/reload, or whenever the miner has to search for channels for a specific game - apparently successfully.

If more people get this, or you find a way to reproduce it outside of docker, I'll look into it.

Keiran-brooks commented 2 weeks ago

Just got this issue: 18:22:09: Traceback (most recent call last): 18:22:09: File "main.py", line 160, in main 18:22:09: File "twitch.py", line 772, in run 18:22:09: File "twitch.py", line 817, in _run 18:22:09: File "twitch.py", line 1670, in fetch_inventory 18:22:09: File "asyncio\tasks.py", line 571, in _wait_for_one 18:22:09: File "twitch.py", line 1608, in fetch_campaigns 18:22:09: File "twitch.py", line 1575, in gql_request 18:22:09: exceptions.MinerException: GQL error: [{'message': 'PersistedQueryNotFound'}]