[V3 Streams] Youtube alerts added by ID have NoneType name #1999

Closed
opened 2018-08-10 22:49:36 +02:00 by JJW8071 · 6 comments
JJW8071 commented 2018-08-10 22:49:36 +02:00 (Migrated from github.com)

Command bugs

Red v3.0.0.b18

Command name

[p]streamalert youtube UC79_r-MK8-bmJCYmyzAkvPw

What cog is this command from?

Streams

What were you expecting to happen?

Add non-partner youtube channel ("Cade") to streamalert settings.
Add <id: channel-name>"Cade" name to streams settings in lieu of a Partner-Name.

What actually happened?

Streams cog is completely disabled

If the Youtube Channel ID is used <UC....xzy> instead of a Partner channel name AND if the youtube channel is not a Youtube Partner, then Streams sets the channel name as 'null'.

Exception during loading of cog
Traceback (most recent call last):
  File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\core\core_commands.py", line 87, in _load
    await bot.load_extension(spec)
  File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\core\bot.py", line 222, in load_extension
    await lib.setup(self)
  File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\__init__.py", line 6, in setup
    await cog.initialize()
  File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\streams.py", line 71, in initialize
    self.streams = await self.load_streams()
  File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\streams.py", line 618, in load_streams
    return [x for x in streams if not (x.name.lower() in seen or seen_add(x.name.lower()))]
  File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\streams.py", line 618, in <listcomp>
    return [x for x in streams if not (x.name.lower() in seen or seen_add(x.name.lower()))]
AttributeError: 'NoneType' object has no attribute 'lower'

How can we reproduce this issue?

[p]streamalert youtube UC79_r-MK8-bmJCYmyzAkvPw
[p]reload streams
[error]

# Command bugs Red v3.0.0.b18 #### Command name [p]streamalert youtube UC79_r-MK8-bmJCYmyzAkvPw #### What cog is this command from? Streams #### What were you expecting to happen? Add non-partner youtube channel ("Cade") to streamalert settings. Add <id: channel-name>"Cade"</channel-name> name to streams settings in lieu of a Partner-Name. #### What actually happened? **Streams cog is completely disabled** If the Youtube Channel ID is used <UC....xzy> instead of a Partner channel name AND if the youtube channel is *not* a Youtube Partner, then Streams sets the channel name as 'null'. ``` Exception during loading of cog Traceback (most recent call last): File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\core\core_commands.py", line 87, in _load await bot.load_extension(spec) File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\core\bot.py", line 222, in load_extension await lib.setup(self) File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\__init__.py", line 6, in setup await cog.initialize() File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\streams.py", line 71, in initialize self.streams = await self.load_streams() File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\streams.py", line 618, in load_streams return [x for x in streams if not (x.name.lower() in seen or seen_add(x.name.lower()))] File "C:\Users\jason\AppData\Local\Programs\Python\Python36\lib\site-packages\redbot\cogs\streams\streams.py", line 618, in <listcomp> return [x for x in streams if not (x.name.lower() in seen or seen_add(x.name.lower()))] AttributeError: 'NoneType' object has no attribute 'lower' ``` #### How can we reproduce this issue? [p]streamalert youtube UC79_r-MK8-bmJCYmyzAkvPw [p]reload streams [error]
mikeshardmind commented 2018-08-10 23:16:18 +02:00 (Migrated from github.com)

Can repro on both b18 and V3/dev This makes the cog completely inoperable.

This should be a reasonably easy fix on preventing the issue on load by making this NoneType safe.

More work will need to be done to figure out how/why we are storing a NoneType here to begin with though.

Can repro on both b18 and V3/dev This makes the cog completely inoperable. This should be a reasonably easy fix on preventing the issue on load by making this NoneType safe. More work will need to be done to figure out how/why we are storing a NoneType here to begin with though.
Tobotimus commented 2018-08-11 03:46:42 +02:00 (Migrated from github.com)

Surely the traceback is different on V3/develop though? Since #1994 has been merged

Surely the traceback is different on V3/develop though? Since #1994 has been merged
Tobotimus commented 2018-08-11 03:50:57 +02:00 (Migrated from github.com)

If this is an easy fix we'll try to fit it in beta 19, I'm willing to accept a PR for it after our cut-off at 23:59 EST Friday

If this is an easy fix we'll try to fit it in beta 19, I'm willing to accept a PR for it after our cut-off at 23:59 EST Friday
mikeshardmind commented 2018-08-11 18:24:41 +02:00 (Migrated from github.com)

@Tobotimus Not related to the token. This has to do with a failure to get stream info in another case. The "easy" fix is a NoneType filter, but that doesn't fix the root problem, and will cause stream alerts for those channels to fail silently. This is still better than breaking all stream alerts to accomplish this.

@Tobotimus Not related to the token. This has to do with a failure to get stream info in another case. The "easy" fix is a NoneType filter, but that doesn't fix the root problem, and will cause stream alerts for those channels to fail silently. This is still better than breaking all stream alerts to accomplish this.
Tobotimus commented 2018-08-12 04:33:56 +02:00 (Migrated from github.com)

This'll no longer be fatal to the Streams cog in beta 19 after the changes in #1994. However, the name for a youtube stream added by ID is still being set to None. This issue will remain open until that is fixed.

This'll no longer be fatal to the Streams cog in beta 19 after the changes in #1994. However, the name for a youtube stream added by ID is still being set to `None`. This issue will remain open until that is fixed.
Tobotimus commented 2018-08-26 15:54:13 +02:00 (Migrated from github.com)

Thanks for reporting this issue @JasonJW.

Resolved by #2047.

Thanks for reporting this issue @JasonJW. Resolved by #2047.
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
1 participant
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#1999
No description provided.