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

twitch redemptions cycling authentication #748

Open
aw-was-here opened this issue Mar 30, 2023 · 1 comment
Open

twitch redemptions cycling authentication #748

aw-was-here opened this issue Mar 30, 2023 · 1 comment
Labels
4.x.x bug Something isn't working

Comments

@aw-was-here
Copy link
Collaborator

aw-was-here commented Mar 30, 2023

Twitch auth may get caught in a loop with the following stack trace:

2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot pubsub:start:137 DEBUG pubsub started up!
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot twitch:__api_get_request:490 DEBUG making GET request to https://api.twitch.tv/helix/users?login=USER
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot pubsub:__send_listen:212 DEBUG sending listen for topics
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot pubsub:__send_message:230 DEBUG sending message
2023-03-28T14:08:02-0700 16552 twitchbot/Thread-5 (__run_socket) pubsub:__task_receive:305 DEBUG received message {"type":"RESPONSE","error":"ERR_BADAUTH","nonce":"42637f13-652d-4653-acc8-0a53903af95f"}
2023-03-28T14:08:02-0700 16552 twitchbot/Thread-5 (__run_socket) pubsub:__handle_response:343 DEBUG got response for nonce 42637f13-652d-4653-acc8-0a53903af95f: PubSubResponseError.BAD_AUTH
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot redemptions:run_redemptions:159 DEBUG Traceback (most recent call last):
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot redemptions:run_redemptions:159 DEBUG   File "nowplaying\twitch\redemptions.py", line 154, in run_redemptions
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot redemptions:run_redemptions:159 DEBUG   File "twitchAPI\pubsub.py", line 473, in listen_channel_points
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot redemptions:run_redemptions:159 DEBUG   File "twitchAPI\pubsub.py", line 263, in __generic_listen
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot redemptions:run_redemptions:159 DEBUG   File "twitchAPI\pubsub.py", line 224, in __send_listen
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot redemptions:run_redemptions:159 DEBUG twitchAPI.types.TwitchAuthorizationException
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot redemptions:run_redemptions:160 ERROR pubsub listen_channel_points failed
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot twitch:refresh_used_token:363 DEBUG refreshing user token
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot utils:save_refreshed_tokens:140 DEBUG Twitch tokens refreshed and saved
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot utils:api_logout:152 DEBUG TWITCH shutdown
2023-03-28T14:08:02-0700 16552 twitchbot/TwitchBot utils:cache_token_del:167 DEBUG Broken twitch config. Removing any cached API tokens.

... and then it tries again, which fails in the exact same way and on and on. I suspect the cached tokens actually aren't getting removed and/or pyTwitchAPI isn't actually getting new tokens.

@aw-was-here aw-was-here added bug Something isn't working 4.x.x labels Mar 30, 2023
@aw-was-here
Copy link
Collaborator Author

We figured out that this situation occurs when the bot user is trying to access the wrong stream. (e.g., browser is logged into wrong user).

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

No branches or pull requests

1 participant