[Streams] Errors After Update Fix (3.4.5) #4695

Closed
opened 2020-12-25 13:26:58 +01:00 by Menteroth · 3 comments
Menteroth commented 2020-12-25 13:26:58 +01:00 (Migrated from github.com)

Getting this for Streams now instead after fix. It's every 5-6 minutes. So whenever it checks for live streams I guess.

https://hastebin.com/evitafozuj.sql

Getting this for Streams now instead after fix. It's every 5-6 minutes. So whenever it checks for live streams I guess. https://hastebin.com/evitafozuj.sql
Injabie3 commented 2020-12-25 18:35:58 +01:00 (Migrated from github.com)

+1, haven't looked into this one yet. I've seen this happen a few times in my instance but embeds still get posted.

I don't see the above paste anymore, so editing this with a recent snippet (please ignore the extra pprint import for debugging):

[11:35:40] ERROR    An error has occured with Streams. Please report it.                                                                                                                                                 [red.core.cogs.Streams]
                    ╭─────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────────╮
                    │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streams.py:737 in check_streams                                                       │
                    │                                                                                                                                                                                                  │
                    │   734 │   │   │   │   │   │   embed, is_rerun = await stream.is_online()                                                                                                                         │
                    │   735 │   │   │   │   │                                                                                                                                                                          │
                    │   736 │   │   │   │   │   elif stream.__class__.__name__ == "YoutubeStream":                                                                                                                     │
                    │ ❱ 737 │   │   │   │   │   │   embed, is_schedule = await stream.is_online()                                                                                                                      │
                    │   738 │   │   │   │   │                                                                                                                                                                          │
                    │   739 │   │   │   │   │   else:                                                                                                                                                                  │
                    │   740 │   │   │   │   │   │   embed = await stream.is_online()                                                                                                                                   │
                    │                                                                                                                                                                                                  │
                    │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py:167 in is_online                                                       │
                    │                                                                                                                                                                                                  │
                    │   164 │   │   │   async with aiohttp.ClientSession() as session:                                                                                                                                 │
                    │   165 │   │   │   │   async with session.get(YOUTUBE_VIDEOS_ENDPOINT, params=params) as r:                                                                                                       │
                    │   166 │   │   │   │   │   data = await r.json()                                                                                                                                                  │
                    │ ❱ 167 │   │   │   return await self.make_embed(data)                                                                                                                                             │
                    │   168 │   │   raise OfflineStream()                                                                                                                                                              │
                    │   169 │                                                                                                                                                                                          │
                    │   170 │   async def make_embed(self, data):              '                                                                                                                                       │
                    │                                                                                                                                                                                                  │
                    │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py:173 in make_embed                                                      │
                    │                                                                                                                                                                                                  │
                    │   170 │   async def make_embed(self, data):                                                                                                                                                      │
                    │   171 │   │   from pprint import pprint                                                                                                                                                          │
                    │   172 │   │   pprint(data["items"])                                                                                                                                                              │
                    │ ❱ 173 │   │   vid_data = data["items"][0]                                                                                                                                                        │
                    │   174 │   │   video_url = "https://youtube.com/watch?v={}".format(vid_data["id"])                                                                                                                │
                    │   175 │   │   title = vid_data["snippet"]["title"]                                                                                                                                               │
                    │   176 │   │   thumbnail = vid_data["snippet"]["thumbnails"]["medium"]["url"]                                                                                                                     │
                    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
                    IndexError: list index out of range
+1, haven't looked into this one yet. I've seen this happen a few times in my instance but embeds still get posted. I don't see the above paste anymore, so editing this with a recent snippet (please ignore the extra pprint import for debugging): ``` [11:35:40] ERROR An error has occured with Streams. Please report it. [red.core.cogs.Streams] ╭─────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────────╮ │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streams.py:737 in check_streams │ │ │ │ 734 │ │ │ │ │ │ embed, is_rerun = await stream.is_online() │ │ 735 │ │ │ │ │ │ │ 736 │ │ │ │ │ elif stream.__class__.__name__ == "YoutubeStream": │ │ ❱ 737 │ │ │ │ │ │ embed, is_schedule = await stream.is_online() │ │ 738 │ │ │ │ │ │ │ 739 │ │ │ │ │ else: │ │ 740 │ │ │ │ │ │ embed = await stream.is_online() │ │ │ │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py:167 in is_online │ │ │ │ 164 │ │ │ async with aiohttp.ClientSession() as session: │ │ 165 │ │ │ │ async with session.get(YOUTUBE_VIDEOS_ENDPOINT, params=params) as r: │ │ 166 │ │ │ │ │ data = await r.json() │ │ ❱ 167 │ │ │ return await self.make_embed(data) │ │ 168 │ │ raise OfflineStream() │ │ 169 │ │ │ 170 │ async def make_embed(self, data): ' │ │ │ │ /home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py:173 in make_embed │ │ │ │ 170 │ async def make_embed(self, data): │ │ 171 │ │ from pprint import pprint │ │ 172 │ │ pprint(data["items"]) │ │ ❱ 173 │ │ vid_data = data["items"][0] │ │ 174 │ │ video_url = "https://youtube.com/watch?v={}".format(vid_data["id"]) │ │ 175 │ │ title = vid_data["snippet"]["title"] │ │ 176 │ │ thumbnail = vid_data["snippet"]["thumbnails"]["medium"]["url"] │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ IndexError: list index out of range ```
Injabie3 commented 2021-01-19 06:00:43 +01:00 (Migrated from github.com)

This is a hard to reproduce issue. I sprinkled in a print on the params before we use it for a YT request. It appears this issue arises when the stream goes offline and is privated afterwards.

Attaching some logs with my API key scrubbed. The livestream in question was https://www.youtube.com/watch?v=8AenYrsL8_M

Edit: And some time between me posting this update and me editing this, this stream has been unprivated.

image

[2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Cleaning unmute tasks
[2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Checking server unmutes
[2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Checking channel unmutes
{'id': '3gpkqxvtppM',
 'key': 'xxxx',
 'part': 'snippet,liveStreamingDetails'}
{'id': '8AenYrsL8_M',
 'key': 'xxxx',
 'part': 'snippet,liveStreamingDetails'}
[2021-01-18 20:50:02] [ERROR] red.core.cogs.Streams: An error has occured with Streams. Please report it.
Traceback (most recent call last):
  File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streams.py", line 737, in check_streams
    embed, is_schedule = await stream.is_online()
  File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py", line 169, in is_online
    return await self.make_embed(data)
  File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py", line 175, in make_embed
    vid_data = data["items"][0]
IndexError: list index out of range
{'id': 'lueGJGxj1ws',
 'key': 'xxxx',
 'part': 'snippet,liveStreamingDetails'}
[2021-01-18 20:50:04] [DEBUG] red.core.lavalink: [NODE] | Received Payload:: <{"op":"playerUpdate","state":{"position":589800,"time":1611031804647},"guildId":"xxx"}>
This is a hard to reproduce issue. I sprinkled in a print on the params before we use it for a YT request. It appears this issue arises when the stream goes offline **and is privated** afterwards. Attaching some logs with my API key scrubbed. The livestream in question was https://www.youtube.com/watch?v=8AenYrsL8_M Edit: And some time between me posting this update and me editing this, this stream has been unprivated. ![image](https://user-images.githubusercontent.com/6710854/104989787-082a6d80-59d0-11eb-89c4-9dc4ff380549.png) ``` [2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Cleaning unmute tasks [2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Checking server unmutes [2021-01-18 20:50:01] [DEBUG] red.cogs.mutes: Checking channel unmutes {'id': '3gpkqxvtppM', 'key': 'xxxx', 'part': 'snippet,liveStreamingDetails'} {'id': '8AenYrsL8_M', 'key': 'xxxx', 'part': 'snippet,liveStreamingDetails'} [2021-01-18 20:50:02] [ERROR] red.core.cogs.Streams: An error has occured with Streams. Please report it. Traceback (most recent call last): File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streams.py", line 737, in check_streams embed, is_schedule = await stream.is_online() File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py", line 169, in is_online return await self.make_embed(data) File "/home/ubuntu/github/renchan/lib/python3.8/site-packages/Red_DiscordBot-3.4.5-py3.8.egg/redbot/cogs/streams/streamtypes.py", line 175, in make_embed vid_data = data["items"][0] IndexError: list index out of range {'id': 'lueGJGxj1ws', 'key': 'xxxx', 'part': 'snippet,liveStreamingDetails'} [2021-01-18 20:50:04] [DEBUG] red.core.lavalink: [NODE] | Received Payload:: <{"op":"playerUpdate","state":{"position":589800,"time":1611031804647},"guildId":"xxx"}> ```
Owner

Alte Fehlermeldung, die sich mit dem heutigen Code-Stand (discord.py 2.7, Python 3.11+, aktuelles Lavalink/Red-Lavalink) nicht mehr nachvollziehen lässt bzw. auf längst geänderten Code verweist. Ich schließe das Issue; falls der Fehler mit dem aktuellen Stand noch auftritt, bitte mit neuen Logs wieder öffnen.


Generated by Claude Code

Alte Fehlermeldung, die sich mit dem heutigen Code-Stand (discord.py 2.7, Python 3.11+, aktuelles Lavalink/Red-Lavalink) nicht mehr nachvollziehen lässt bzw. auf längst geänderten Code verweist. Ich schließe das Issue; falls der Fehler mit dem aktuellen Stand noch auftritt, bitte mit neuen Logs wieder öffnen. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#4695
No description provided.