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

PersistedQueryNotFound GQL error #138

Open
Tracked by #234
matarife123 opened this issue Feb 16, 2023 · 64 comments
Open
Tracked by #234

PersistedQueryNotFound GQL error #138

matarife123 opened this issue Feb 16, 2023 · 64 comments
Labels
Bug Something isn't working Critical For critical issues that prevent the application from working Dev For interminent issues created during development between releases Solved for the next release This is already resolved in the next application release

Comments

@matarife123
Copy link

Sin título

@allanf181
Copy link

Same here

12:49:17: Fatal error encountered:
12:49:17: 
12:49:17: Traceback (most recent call last):
12:49:17:   File "main.py", line 175, in <module>
12:49:17:   File "asyncio\base_events.py", line 616, in run_until_complete
12:49:17:   File "twitch.py", line 759, in run
12:49:17:   File "twitch.py", line 801, in _run
12:49:17:   File "twitch.py", line 1594, in fetch_inventory
12:49:17:   File "twitch.py", line 1534, in gql_request
12:49:17: exceptions.MinerException: GQL error: [{'message': 'PersistedQueryNotFound'}]
12:49:17: 
12:49:17: Exiting...
12:49:18: 
12:49:18: Application Terminated.
12:49:18: Close the window to exit the application.

@notNSANE
Copy link

same here.

@DuoZock
Copy link

DuoZock commented Feb 17, 2023

got the same problem
image

@xeddmc
Copy link

xeddmc commented Feb 17, 2023

Same. I think twitch might have found a way to block the app. Could need an update

@Tristar7
Copy link

Randomly random GQL requests fail or Twitch sends garbage. The tool needs to be much more error resilient and not crash on the faintest of error.

@MingY00
Copy link

MingY00 commented Feb 18, 2023

same here

@allanf181
Copy link

Log with log level CALL

...
00:02:29: INFO: sure_ goes OFFLINE
00:02:30: CALL: Channel update from websocket: sure_
00:02:41: CALL: Drop update from websocket: Holy Flare (Halo Infinite, 59/60)
00:03:42: Earned points for watching:  10, total: 370
00:03:42: CALL: Drop update from websocket: Holy Flare (Halo Infinite, 60/60)
00:03:43: Claimed drop: Halo Infinite "Holy Flare" Charm (1/1)
00:03:43: Claimed bonus points: 50
00:03:43: Earned points for watching:  50, total: 420
00:03:53: CALL: Maintenance task waiting until: 00:33:53 (Points)
00:03:53: INFO: Websocket[7] stopped.
00:03:53: INFO: Websocket[6] stopped.
00:03:53: INFO: Websocket[5] stopped.
00:03:53: INFO: Websocket[4] stopped.
00:03:53: INFO: Websocket[3] stopped.
00:03:53: INFO: Websocket[2] stopped.
00:03:53: INFO: Websocket[1] stopped.
00:03:55: Fatal error encountered:
00:03:55: 
00:03:55: Traceback (most recent call last):
00:03:55:   File "main.py", line 175, in <module>
00:03:55:   File "asyncio\base_events.py", line 616, in run_until_complete
00:03:55:   File "twitch.py", line 759, in run
00:03:55:   File "twitch.py", line 908, in _run
00:03:55:   File "twitch.py", line 1677, in get_live_streams
00:03:55:   File "twitch.py", line 1534, in gql_request
00:03:55: exceptions.MinerException: GQL error: [{'message': 'PersistedQueryNotFound'}]
00:03:55: 
00:03:55: Exiting...
00:03:55: INFO: Websocket[0] stopped.
00:03:55: 
00:03:55: Application Terminated.
00:03:55: Close the window to exit the application.

@emaf94
Copy link

emaf94 commented Feb 18, 2023

Same problem

@Nana7mi12
Copy link

me too

@WrayOfSunshine
Copy link

Yup.

@kartax4
Copy link

kartax4 commented Feb 18, 2023

Same problem after reinstall
13:51:56: Fatal error encountered: 13:51:56: 13:51:56: Traceback (most recent call last): 13:51:56: File "main.py", line 175, in <module> 13:51:56: File "asyncio\base_events.py", line 616, in run_until_complete 13:51:56: File "twitch.py", line 759, in run 13:51:56: File "twitch.py", line 908, in _run 13:51:56: File "twitch.py", line 1677, in get_live_streams 13:51:56: File "twitch.py", line 1534, in gql_request 13:51:56: exceptions.MinerException: GQL error: [{'message': 'PersistedQueryNotFound'}] 13:51:56: 13:51:56: Exiting... 13:51:56: 13:51:56: Application Terminated. 13:51:56: Close the window to exit the application.

@hifocus
Copy link

hifocus commented Feb 18, 2023

Can reproduce

@lvg3618
Copy link

lvg3618 commented Feb 18, 2023

same

@Jokerverse
Copy link

Im facing the same problem here and temporarily fixing it by restarting the app after every claim

@DevilXD
Copy link
Owner

DevilXD commented Feb 19, 2023

Hi. Hmm, this just looks like the GQL queries the miner is using have became really old, so old that Twitch moved onto new ones in the mean time. This shouldn't be too hard to fix, assuming the new queries didn't remove crucial info I was using before.

@DevilXD
Copy link
Owner

DevilXD commented Feb 19, 2023

As I said, simply putting in new hashes worked: bfd3893

This is already fixed in dev, but it's gonna take a while to make it to official release. In the mean time, one can rebuild the application on their side by following the building process: https://github.com/DevilXD/TwitchDropsMiner/wiki/Setting-up-the-environment,-building-and-running

@DevilXD DevilXD added Bug Something isn't working Solved for the next release This is already resolved in the next application release Critical For critical issues that prevent the application from working Dev For interminent issues created during development between releases labels Feb 19, 2023
@DevilXD DevilXD changed the title error PersistedQueryNotFound GQL error Feb 19, 2023
@matarife123
Copy link
Author

thanks you for all :D

@aalbouy
Copy link

aalbouy commented Feb 19, 2023

Hi,

Thanks for the quick fix !
I just rebuild the project using new hashes, yet I face another error :

11:57:09: Fatal error encountered:
11:57:09: 
11:57:09: Traceback (most recent call last):
11:57:09:   File "E:\Documents\Documents\PythonScripts\TwitchDropMiner_main\main.py", line 175, in <module>
11:57:09:     loop.run_until_complete(client.run())
11:57:09:   File "C:\Users\adri8\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
11:57:09:     return future.result()
11:57:09:            ^^^^^^^^^^^^^^^
11:57:09:   File "E:\Documents\Documents\PythonScripts\TwitchDropMiner_main\twitch.py", line 759, in run
11:57:09:     await self._run()
11:57:09:   File "E:\Documents\Documents\PythonScripts\TwitchDropMiner_main\twitch.py", line 908, in _run
11:57:09:     new_channels.update(await self.get_live_streams(game))
11:57:09:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11:57:09:   File "E:\Documents\Documents\PythonScripts\TwitchDropMiner_main\twitch.py", line 1687, in get_live_streams
11:57:09:     return [
11:57:09:            ^
11:57:09:   File "E:\Documents\Documents\PythonScripts\TwitchDropMiner_main\twitch.py", line 1688, in <listcomp>
11:57:09:     Channel.from_directory(self, stream_channel_data["node"])
11:57:09:   File "E:\Documents\Documents\PythonScripts\TwitchDropMiner_main\channel.py", line 114, in from_directory
11:57:09:     self._stream = Stream.from_directory(self, data)
11:57:09:                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11:57:09:   File "E:\Documents\Documents\PythonScripts\TwitchDropMiner_main\channel.py", line 64, in from_directory
11:57:09:     tags=data["tags"],
11:57:09:          ~~~~^^^^^^^^
11:57:09: KeyError: 'tags'
11:57:09: 
11:57:09: Exiting...
11:57:09: 
11:57:09: Application Terminated.
11:57:09: Close the window to exit the application.

I tried deleting the cookies.jar just in case, same issue..

I'm not sure if it should be a new issue, let me know !

@DevilXD
Copy link
Owner

DevilXD commented Feb 19, 2023

Yeah, I worried that might be an issue - it's the result of Twitch updating their queries. Now there are only "freeFormTags" available on that data object there, meaning the miner can't determine if there is a drops tag available or not. I'll try searching for a solution, but that'll take longer than a simple hashes update like this.

@aalbouy
Copy link

aalbouy commented Feb 19, 2023

I hacked a thing using the "freeFormTags" and some translation of "DropsEnabled" value that I found, but I guess that's up to the streamer to add these tags ? So it's not perfect...

@DevilXD
Copy link
Owner

DevilXD commented Feb 19, 2023

The point isn't extracting the tag, but more about the tag's meaning. It doesn't look like that tag means what you think it does anymore, and the actual information telling others whether or not the drops are enabled on a channel or not, isn't available anymore. Streamers add these because that's how it used to function before, that others are used to seeing, for increased views.

EDIT: https://www.reddit.com/r/Twitch/comments/wqlwbz/new_tags_system_and_drops_enabled_streams/

@DevilXD
Copy link
Owner

DevilXD commented Feb 19, 2023

This is far from ideal, but it works: 793fb5c

@Walter-o
Copy link

Isn't it a good idea to generate the GQL hashes live inside the program so they can never expire?

@DevilXD
Copy link
Owner

DevilXD commented Feb 19, 2023

It's not that easy. Twitch does accept raw GQL queries with no hashes, but since none of the Twitch's official apps uses those, it'd be really easy to see someone doing custom queries on the system. One way I could think of is parsing the web client to extract hashes out of (since they're hardcoded there), but the GQL operations don't change that often (this is like the 2nd breaking change ever since this project started existing) so it was never smth to really worry about.

@EffortlessFury
Copy link

@TeKno200 At the very bottom of the Readme (the main page of this project) is a link to the Wiki with instructions on how to setup the development environment. Hopefully that'll help.

@TeKno200
Copy link

TeKno200 commented Mar 4, 2023

I tried to do everything I could but I always get stuck here, I read requirements.txt and it makes everything even more confusing

Captura de pantalla_20230303_212623

I don't have the slightest idea of ​​what I have to do or how I have to do it, as I already said I don't have the slightest idea of ​​programming and at most I'm capable of editing a .txt

@DevilXD
Copy link
Owner

DevilXD commented Mar 4, 2023

@TeKno200 Please verify that the env folder is created properly after running that script, and then there's a scripts folder inside, with pip.exe file in there. If so, you should be getting no such errors. If not, the venv folder isn't getting created properly, and you'll most likely need to run it with administrative access, or consider temporarily disabling the AV in case it'd interfere with the venv creation.

@TeKno200
Copy link

TeKno200 commented Mar 4, 2023

@TeKno200 Please verify that the env folder is created properly after running that script, and then there's a scripts folder inside, with pip.exe file in there. If so, you should be getting no such errors. If not, the venv folder isn't getting created properly, and you'll most likely need to run it with administrative access, or consider temporarily disabling the AV in case it'd interfere with the venv creation.

I just reinstalled Python with the wiki guide and everything worked correctly, I think the wrong option was that the files didn't open with cmd.exe and so far the build works perfectly

@matarife123
Copy link
Author

@TeKno200 Please verify that the env folder is created properly after running that script, and then there's a scripts folder inside, with pip.exe file in there. If so, you should be getting no such errors. If not, the venv folder isn't getting created properly, and you'll most likely need to run it with administrative access, or consider temporarily disabling the AV in case it'd interfere with the venv creation.

I just reinstalled Python with the wiki guide and everything worked correctly, I think the wrong option was that the files didn't open with cmd.exe and so far the build works perfectly

send V16 xD

@matarife123
Copy link
Author

I tried to do everything I could but I always get stuck here, I read requirements.txt and it makes everything even more confusing

Captura de pantalla_20230303_212623

I don't have the slightest idea of ​​what I have to do or how I have to do it, as I already said I don't have the slightest idea of ​​programming and at most I'm capable of editing a .txt

how did you solve it? and installed python and the problem persists

@DevilXD DevilXD mentioned this issue Mar 10, 2023
@DevilXD
Copy link
Owner

DevilXD commented Mar 10, 2023

@matarife123 Make sure that you are following the guide closely. Every misstep like not checking a particular option, or not restarting your PC at the end, will result in that error. The guide should already cover everything needed for the building to work, so if you're getting a similar error, you didn't follow the guide properly.

Alternatively, you can try reaching out to me on Discord and I could try helping your directly.

@matarife123
Copy link
Author

matarife123 commented Mar 10, 2023

Sin título

@matarife123 Make sure that you are following the guide closely. Every misstep like not checking a particular option, or not restarting your PC at the end, will result in that error. The guide should already cover everything needed for the building to work, so if you're getting a similar error, you didn't follow the guide properly.

Alternatively, you can try reaching out to me on Discord and I could try helping your directly.

I do everything exactly as in the guide and it gives me an error when executing setup_env, I use python 3.11

@TeKno200
Copy link

Sin título

@matarife123 Make sure that you are following the guide closely. Every misstep like not checking a particular option, or not restarting your PC at the end, will result in that error. The guide should already cover everything needed for the building to work, so if you're getting a similar error, you didn't follow the guide properly.
Alternatively, you can try reaching out to me on Discord and I could try helping your directly.

I do everything exactly as in the guide and it gives me an error when executing setup_env, I use python 3.11

https://drive.google.com/file/d/1bMHz5e2OAy6IpvxQRHPvDaBKrkWkaXNx/view?usp=sharing
Here I leave the link of the application that I made. (I don't know if I can pass a link with an .exe any problem delete the link or notify)

@matarife123
Copy link
Author

Sin título

@matarife123 Make sure that you are following the guide closely. Every misstep like not checking a particular option, or not restarting your PC at the end, will result in that error. The guide should already cover everything needed for the building to work, so if you're getting a similar error, you didn't follow the guide properly.
Alternatively, you can try reaching out to me on Discord and I could try helping your directly.

I do everything exactly as in the guide and it gives me an error when executing setup_env, I use python 3.11

https://drive.google.com/file/d/1bMHz5e2OAy6IpvxQRHPvDaBKrkWkaXNx/view?usp=sharing Here I leave the link of the application that I made. (I don't know if I can pass a link with an .exe any problem delete the link or notify)

very thanks :D

@lls8475
Copy link

lls8475 commented Mar 11, 2023

i got it !
1、Git Installation
2、Python Installation
all done
run bat
1、setup_env.bat
2、build.bat
all done
open folder dist exe inside

@DevilXD
Copy link
Owner

DevilXD commented Mar 11, 2023

Yeah, I really don't know why some users can't get it to work, the guide already covers the entire process.

@zansbang

This comment was marked as off-topic.

@DevilXD
Copy link
Owner

DevilXD commented Mar 11, 2023

@zansbang A gentle reminder that you're supposed to search through existing issues first, before reporting anything: #80

@lls8475

This comment was marked as off-topic.

@notNSANE
Copy link

Sin título

@matarife123 Make sure that you are following the guide closely. Every misstep like not checking a particular option, or not restarting your PC at the end, will result in that error. The guide should already cover everything needed for the building to work, so if you're getting a similar error, you didn't follow the guide properly.
Alternatively, you can try reaching out to me on Discord and I could try helping your directly.

I do everything exactly as in the guide and it gives me an error when executing setup_env, I use python 3.11

https://drive.google.com/file/d/1bMHz5e2OAy6IpvxQRHPvDaBKrkWkaXNx/view?usp=sharing Here I leave the link of the application that I made. (I don't know if I can pass a link with an .exe any problem delete the link or notify)

just a heads up, crashes at start

@scarabhub
Copy link

image

@lls8475
Copy link

lls8475 commented Mar 26, 2023

image

this is BUG repaired
you need repackaging files to exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Critical For critical issues that prevent the application from working Dev For interminent issues created during development between releases Solved for the next release This is already resolved in the next application release
Projects
None yet
Development

No branches or pull requests