TwitchDropsMiner icon indicating copy to clipboard operation
TwitchDropsMiner copied to clipboard

Fatal Error - KeyError: 'channel'

Open Totesfleisch opened this issue 2 years ago • 12 comments

02:38:31: Fatal error encountered: 02:38:31: 02:38:31: Traceback (most recent call last): 02:38:31: File "C:\Users\night\OneDrive\Desktop\twitcher\TwitchDropsMiner\main.py", line 158, in main 02:38:31: await client.run() 02:38:31: File "C:\Users\night\OneDrive\Desktop\twitcher\TwitchDropsMiner\twitch.py", line 764, in run 02:38:31: await self._run() 02:38:31: File "C:\Users\night\OneDrive\Desktop\twitcher\TwitchDropsMiner\twitch.py", line 908, in _run 02:38:31: await asyncio.gather( 02:38:31: File "C:\Users\night\OneDrive\Desktop\twitcher\TwitchDropsMiner\channel.py", line 277, in update_stream 02:38:31: self._stream = await self.get_stream() 02:38:31: File "C:\Users\night\OneDrive\Desktop\twitcher\TwitchDropsMiner\channel.py", line 264, in get_stream 02:38:31: for c in (available_drops["data"]["channel"]["viewerDropCampaigns"] or []) 02:38:31: KeyError: 'channel' 02:38:31: 02:38:31: Exiting... 02:38:31: Cannot connect to Twitch, retrying in 2 seconds... 02:38:31: 02:38:31: Application Terminated. 02:38:31: Close the window to exit the application. 02:38:32: Cannot connect to Twitch, retrying in 2 seconds...

I was using an older version just fine and just decided to get the newest one, downloaded and built it, no errors etc, dragged back in the settings and cookies and then i get this. Thing is, it will give the same crash, even when dont use my old settings and cookies, i tried it without any priority list which ends in a crash, however, i tried Priority only, with Smite in the Prio list, and it works perfectly fine. I think its some Game crashing it again like a few Weeks ago?! but im not really sure, as i cant use my old prio list either, it will make the tool crash aswell.

Totesfleisch avatar Nov 20 '23 01:11 Totesfleisch

Hello o/ Thank you for the report.

i tried it without any priority list which ends in a crash, however, i tried Priority only,

The culprit here is a channel of a specific name, that causes the crash. It's associated with a game, that isn't on the priority list, while you have the "priority only" option toggled off - only then the conditions for this error can occur.

To solve this, I'd need the name of the affected channel or game. In order to determine which games are being considered as mining targets, you'll need to note down (or take a picture/screenshot of) the names of all games that appear in the Inventory tab of the miner, when you toggle the "priority only" option off, and this error is about to happen (right after launching the miner or pressing on reload). Without this list, I cannot do much about this issue.

DevilXD avatar Nov 20 '23 20:11 DevilXD

Okay so i just redownloaded the and rebuilt the newest version and the Bot works fine now, i tried both with my Prio List, only one Game in Prio List, and Prio only enabled/disabled with the same above criteria (empty list etc.) and i am not able to reproduce this crash anymore as i used to. I guess the Game in Question has been removed from the API at the Moment because its not active anymore, however, i cant really guess what Game it could have been either because i have quite a lot of Games on my Priority List.

It's probably not gonna be of any Use, but just incase im gonna put my Prio List here anyway for potential future Reference.

"priority": [
    "The Elder Scrolls Online",
    "HUMANKIND",
    "Warframe",
    "Halo Infinite",
    "For Honor",
    "Overwatch 2",
    "PUBG: BATTLEGROUNDS",
    "PAYDAY 2",
    "FIFA 23",
    "Apex Legends",
    "Halo: The Master Chief Collection",
    "The Crew: Motorfest",
    "Rocket League",
    "Vampire: The Masquerade - Bloodhunt",
    "Elite: Dangerous",
    "BattleBit Remastered",
    "New World",
    "Sea of Thieves",
    "Rust",
    "War Thunder",
    "Diablo IV",
    "World of Warcraft",
    "Conan Exiles",
    "Cyberpunk 2077",
    "Arena Breakout",
    "Crossfire",
    "Stream Raiders",
    "Starsiege: Deadzone",
    "World of Warships",
    "The First Descendant",
    "Dead Island 2",
    "EA Sports FC 24",
    "XERA: Survival",
    "SYNCED",
    "Riders Republic",
    "Assassin's Creed Mirage",
    "Pok\u00e9mon GO",
    "Veiled Experts",
    "Ghostbusters: Spirits Unleashed",
    "Warhaven",
    "Don't Starve Together",
    "Deceive Inc.",
    "STALCRAFT",
    "Assassin's Creed Valhalla",
    "Assassin's Creed Odyssey",
    "Party Animals",
    "Pok\u00e9mon Trading Card Game",
    "AK-xolotl",
    "Operation Valor",
    "Warhammer Age of Sigmar: Realms of Ruin",
    "THE FINALS",
    "Marvel Snap",
    "Gord",
    "UNITED 1944",
    "Disney Speedstorm",
    "My Hero Ultra Rumble",
    "DC Dual Force",
    "Infestation: The New Z",
    "Dysterra",
    "Coin Pusher World",
    "Guessr.tv",
    "Project: Arena",
    "Cult of the Lamb",
    "Hearthstone",
    "Project Winter",
    "Freestyle Football R",
    "From Space",
    "EVE Online",
    "BAPBAP",
    "Marbles on Stream",
    "Black Desert",
    "Hellcard",
    "Warhammer Online: Age of Reckoning",
    "Crossout",
    "Epic Seven",
    "KartRider: Drift",
    "Eternal Return",
    "Conqueror's Blade",
    "NARAKA: BLADEPOINT",
    "Lost Ark",
    "ArcheAge",
    "SMITE"
],

Totesfleisch avatar Nov 21 '23 08:11 Totesfleisch

Hi there o/

I can confirm that I'm having this same issue everytime I added Lost Ark to the priority list.

nicoacu avatar Nov 22 '23 18:11 nicoacu

The current master build of the miner was able to handle fetching the status of all 2258 channels, and from whatever ones were online at this time, none of them have caused any errors for me:

picture

Whichever channel (or lack thereof) causes this, is still to be determined, but it seems it'd have to be online for me to catch it. For now, please include the UTC/GMT hour / timestamp / descriptive timeframe (ex. "5 minutes ago, in regards to this comment") of whenever this issue happens for you, and report every occurrence.

DevilXD avatar Nov 22 '23 20:11 DevilXD

I get the same problem when my twitch account is linked to the lost ark, unlinking the lost ark brings it back to normal

wsaddede avatar Nov 26 '23 13:11 wsaddede

As a temporary solution, you can exclude "Lost Ark" via the excluded list, without having to unlink the account. I'm still trying to catch this one live.

I'm still waiting for anyone to report an approximate time of when one can run into this,

DevilXD avatar Nov 26 '23 20:11 DevilXD

It also happened in Neon Abyss: Infinity.

tjndxx avatar Dec 11 '23 08:12 tjndxx

It may happen on any campaign that has the affected channel - I'm still yet to experience this error myself, and without that I can't tell where the issue is, and thus fix it.

I shall reiterate what I've mentioned in the comment higher above:

please include the UTC/GMT hour / timestamp / descriptive timeframe (ex. "5 minutes ago, in regards to this comment") of whenever this issue happens for you, and report every occurrence (here).

DevilXD avatar Dec 11 '23 17:12 DevilXD

09:37:50: Fatal error encountered:
09:37:50: 
09:37:50: Traceback (most recent call last):
09:37:50:   File "main.py", line 158, in main
09:37:50:   File "twitch.py", line 764, in run
09:37:50:   File "twitch.py", line 908, in _run
09:37:50:   File "channel.py", line 277, in update_stream
09:37:50:   File "channel.py", line 264, in get_stream
09:37:50: KeyError: 'channel'
09:37:50: 
09:37:50: Exiting...
09:37:50: 
09:37:50: Application Terminated.
09:37:50: Close the window to exit the application.

Time is CET/GMT+1

Getting a similar error as OP. Activating priority list seems to fix it for me.

Priority list: Diablo VI, World of Warships, World of Warcraft, Elite: Dangerous

Games mined per inventory list (only linked and currently mineable): Skull and Bones, PUBG, Endless Dungeon, World of Warships, Dungeon Defenders 2, Lost Ark, New World, Elite: Dangerous.

Somehow my twitch drops site also shows RUST, although it is not connected and I haven't watched this game actively but still got progress.

I hope this info helps somehow and thanks for all your work!

knuthen avatar Dec 15 '23 08:12 knuthen

Okay. I think I have nailed it down for me. It seems to be Lost Ark. After playing around and adding titles one by one to the priority list it started crashing after adding Lost Ark. Putting Lost Ark on the "exclude list" seems to work for me even with disabled "priority only"

knuthen avatar Dec 17 '23 01:12 knuthen

This issue is caused by a channel, not a game. If the troublesome channel would stream a different game, adding that game would cause the crash.

Since I can't catch the channel being online myself, I think the best I can do, is provide a special debug build that'll tell us which channel is the troublemaker here. If anyone would encounter this bug again, please run this build from source (or build it, up to you): https://github.com/DevilXD/TwitchDropsMiner/tree/debug_channel

The exception will still occur, but this time it should display the name of the channel causing the problem to occur.

DevilXD avatar Dec 17 '23 15:12 DevilXD

Now I get it. Currently running the debug version. Let's see if we can find the culprit

knuthen avatar Dec 17 '23 16:12 knuthen

Since there hasn't been any more reports on this for a good while, I guess it can be closed now.

DevilXD avatar Jun 22 '24 16:06 DevilXD