[Streams] YouTube streamalert raising Bad Request #2466

Closed
opened 2019-02-18 03:13:46 +01:00 by jonttm · 1 comment
jonttm commented 2019-02-18 03:13:46 +01:00 (Migrated from github.com)

What were you trying to do?

Set a stream alert for YouTube [p]streamalert youtube UCyd39rbwnC9LwYLfM0nHoNQ

What were you expecting to happen?

Nothing (the channel was offline).

What actually happened?

After about 10 minutes, the bot notified that the stream was online (without an embed):
@everyone Channel Name is now live!

I then tried to check the channel using [p]youtube UCyd39rbwnC9LwYLfM0nHoNQ and it gave an error:

Exception in command 'youtube'
Traceback (most recent call last):
File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "/home/jttm/red/lib/python3.7/site-packages/redbot/cogs/streams/streams.py", line 95, in youtube
await self.check_online(ctx, stream)
File "/home/jttm/red/lib/python3.7/site-packages/redbot/cogs/streams/streams.py", line 142, in check_online
await ctx.send(embed=embed)
File "/home/jttm/red/lib/python3.7/site-packages/redbot/core/commands/context.py", line 63, in send
return await super().send(content=content, **kwargs)
File "/home/jttm/red/lib/python3.7/site-packages/discord/abc.py", line 808, in send
channel.id, content, tts=tts, embed=embed, nonce=nonce
File "/home/jttm/red/lib/python3.7/site-packages/discord/http.py", line 227, in request
raise HTTPException(r, data)
discord.errors.HTTPException: BAD REQUEST (status code: 400): Cannot send an empty message

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 912, in invoke
await ctx.command.invoke(ctx)
File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/core.py", line 639, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/core.py", line 88, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: BAD REQUEST (status code: 400): Cannot send an empty message

When trying to reload the streams cog, the stream alert is sent again.

I verified that I had set up the YouTube API key correctly and it still happened.

How can we reproduce this issue?

  1. Setup a brand new Google API Project
  2. Enable YouTube Data API v3
  3. Add API Key Credentials
  4. Run [p]streamset youtubekey <token>
  5. Run [p]streamalert youtube UCyd39rbwnC9LwYLfM0nHoNQ
  6. Wait some time or reload streams cog
#### What were you trying to do? Set a stream alert for YouTube `[p]streamalert youtube UCyd39rbwnC9LwYLfM0nHoNQ` #### What were you expecting to happen? Nothing (the channel was offline). #### What actually happened? After about 10 minutes, the bot notified that the stream was online (without an embed): @everyone Channel Name is now live! I then tried to check the channel using `[p]youtube UCyd39rbwnC9LwYLfM0nHoNQ` and it gave an error: > Exception in command 'youtube' > Traceback (most recent call last): > File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped > ret = await coro(*args, **kwargs) > File "/home/jttm/red/lib/python3.7/site-packages/redbot/cogs/streams/streams.py", line 95, in youtube > await self.check_online(ctx, stream) > File "/home/jttm/red/lib/python3.7/site-packages/redbot/cogs/streams/streams.py", line 142, in check_online > await ctx.send(embed=embed) > File "/home/jttm/red/lib/python3.7/site-packages/redbot/core/commands/context.py", line 63, in send > return await super().send(content=content, **kwargs) > File "/home/jttm/red/lib/python3.7/site-packages/discord/abc.py", line 808, in send > channel.id, content, tts=tts, embed=embed, nonce=nonce > File "/home/jttm/red/lib/python3.7/site-packages/discord/http.py", line 227, in request > raise HTTPException(r, data) > discord.errors.HTTPException: BAD REQUEST (status code: 400): Cannot send an empty message > > The above exception was the direct cause of the following exception: > > Traceback (most recent call last): > File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 912, in invoke > await ctx.command.invoke(ctx) > File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/core.py", line 639, in invoke > await injected(*ctx.args, **ctx.kwargs) > File "/home/jttm/red/lib/python3.7/site-packages/discord/ext/commands/core.py", line 88, in wrapped > raise CommandInvokeError(exc) from exc > discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: BAD REQUEST (status code: 400): Cannot send an empty message When trying to reload the streams cog, the stream alert is sent again. I verified that I had set up the YouTube API key correctly and it still happened. #### How can we reproduce this issue? 1. Setup a brand new Google API Project 2. Enable YouTube Data API v3 3. Add API Key Credentials 4. Run `[p]streamset youtubekey <token>` 5. Run `[p]streamalert youtube UCyd39rbwnC9LwYLfM0nHoNQ` 6. Wait some time or reload streams cog
Jackenmen commented 2020-08-17 16:37:45 +02:00 (Migrated from github.com)

I can't reproduce this, is this still an issue? I'll be closing this issue in 7 days if nobody comments here that they still experience this issue.

I can't reproduce this, is this still an issue? I'll be closing this issue in 7 days if nobody comments here that they still experience this issue.
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#2466
No description provided.