Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinerException: GQL error: [{'message': 'service error', 'path': ['channel', 'viewerDropCampaigns']}] #435

Closed
woctezuma opened this issue Feb 10, 2024 · 8 comments
Labels
Bug Something isn't working

Comments

@woctezuma
Copy link

woctezuma commented Feb 10, 2024

Starting today, I have encountered a fatal error.

23:07:30: Fatal error encountered:
23:07:30: 
23:07:30: Traceback (most recent call last):
23:07:30:   File "C:\TwitchDropsMiner\main.py", line 158, in main
23:07:30:     await client.run()
23:07:30:   File "C:\TwitchDropsMiner\twitch.py", line 764, in run
23:07:30:     await self._run()
23:07:30:   File "C:\TwitchDropsMiner\twitch.py", line 908, in _run
23:07:30:     await asyncio.gather(
23:07:30:   File "C:\TwitchDropsMiner\channel.py", line 277, in update_stream
23:07:30:     self._stream = await self.get_stream()
23:07:30:                    ^^^^^^^^^^^^^^^^^^^^^^^
23:07:30:   File "C:\TwitchDropsMiner\channel.py", line 259, in get_stream
23:07:30:     available_drops: JsonType = await self._twitch.gql_request(
23:07:30:                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:07:30:   File "C:\TwitchDropsMiner\twitch.py", line 1566, in gql_request
23:07:30:     raise MinerException(f"GQL error: {response_json['errors']}")
23:07:30: exceptions.MinerException: GQL error: [{'message': 'service error', 'path': ['channel', 'viewerDropCampaigns']}]
23:07:30: Exiting...
23:07:30: Cannot connect to Twitch, retrying in 2 seconds...
23:07:30: Application Terminated.
23:07:30: Close the window to exit the application.
23:07:39: Cannot connect to Twitch, retrying in 2 seconds...
23:07:40: Cannot connect to Twitch, retrying in 2 seconds...
23:07:41: Cannot connect to Twitch, retrying in 2 seconds...

Maybe related:

@jaredcat
Copy link

jaredcat commented Feb 11, 2024

I've been getting this too for about 3 days now.
Im assuming that there's nothing can be done though based on other similar issues

The issues you linked aren't related but these are:

Update: mine just started working again within the last hour 🎉

Another edit: if you find this, try turning on "priority only" and messing with the games in that list. it might be associated with only one of those games.

@DevilXD
Copy link
Owner

DevilXD commented Feb 11, 2024

Correct, there isn't anything that can be done on your side, as "service error" is just the Twitch website crashing and generally having internal issues. On my side, handling this in a better way is tracked by #417.

I feel there's a need to create a better logging system, because this issue is caused by a single channel, and there might be something specific about it that's causing the crash, just like what happened with the drop claiming time limit: #347 (comment)

@woctezuma
Copy link
Author

Thank you for your replies! My client works again, as Twitch's side has been fixed, I guess.

@DevilXD DevilXD added the Bug Something isn't working label Feb 11, 2024
Repository owner deleted a comment from zelda0079 Feb 13, 2024
@jaredcat
Copy link

jaredcat commented Feb 16, 2024

because this issue is caused by a single channel, and there might be something specific about it that's causing the crash

@DevilXD I was playing around with my priority list and does seem like it's linked to either a single channel or single game. Got any ideas for an easy way to figure out which channel/game is causing this? I rather just remove it for now so i can at least mine other drops instead of this killing the entire service.
Maybe a few lines of code I can manually update?

@DevilXD
Copy link
Owner

DevilXD commented Feb 17, 2024

Try it with this latest commit: a536dde

@jaredcat
Copy link

jaredcat commented Feb 17, 2024

Try it with this latest commit: a536dde

Doesn't seem to work. The error for this viewerDropCampaigns service error is being thrown here: https://github.com/DevilXD/TwitchDropsMiner/blob/master/twitch.py#L1570 from this call https://github.com/DevilXD/TwitchDropsMiner/blob/master/channel.py#L262-L264

I changed it to

        try:
            available_drops: JsonType = await self._twitch.gql_request(
                GQL_OPERATIONS["AvailableDrops"].with_variables({"channelID": str(self.id)})
            )
        except MinerException as exc:
            logger.info("Channel caused an error. Skipping channel: {self._login}")
            return None

and it threw out bassjiggaming playing Ravendawn (Campaign: February Celebrations - Week 2)

I have my fix in place for now so everything is great again.
Thanks for your help @DevilXD!

@woctezuma
Copy link
Author

woctezuma commented Feb 17, 2024

Try it with this latest commit: a536dde

I still encounter the error despite this commit.

I have my fix in place for now so everything is great again.

Maybe you could suggest the fix as a pull request. Edit: I did it for a try in:

I will tell you if I encounter the error again with this commit.

@DevilXD
Copy link
Owner

DevilXD commented Feb 18, 2024

I still encounter the error despite this commit.

@woctezuma The commit was never supposed to resolve any issues, only add context information. This isn't a fix by any means.

Doesn't seem to work.

@jaredkotoff That's my bad. The exception handler was added in the place where a "service error" did occur in the past, but it was actually a couple lines lower that was crashing in your case. This place can actually salvage the crash, because the stream information exists already, and just the "drops_enabled" flag is updated when necessary. Please try this latest one: 5dea41a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants