# Start Commercial - Error 500

**URL:** <https://discuss.dev.twitch.com/t/start-commercial-error-500/24171>\
**Category:** API\
**Created:** [February 19, 2020, 1:37pm UTC](https://discuss.dev.twitch.com/t/start-commercial-error-500/24171 "2020-02-19T13:37:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thormug](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/thormug/32/1515_2.png) [@thormug](https://discuss.dev.twitch.com/u/thormug)\
**Post date:** [February 19, 2020, 1:37pm UTC](https://discuss.dev.twitch.com/t/start-commercial-error-500/24171/1 "2020-02-19T13:37:54Z")

</div>

When doing a request on this endpoint :  
[https://api.twitch.tv/kraken/channels/00000000/commercial](https://api.twitch.tv/kraken/channels/00000000/commercial)  
you are supposed to received a 422 Unprocessable Entity if you entered an invalid length, if you launch 2 ads in the restrictive 8 minutes windows, if your channel is offline etc …  
But instead, you receive a 500 Internal Server Error.

It makes debugging really annoying.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [February 19, 2020, 1:54pm UTC](https://discuss.dev.twitch.com/t/start-commercial-error-500/24171/2 "2020-02-19T13:54:17Z")

</div>

This is documented on the Github and ticketed by Twitch. Expect a fix soon ™

> <https://github.com/twitchdev/issues/issues/7>
>
> \*\*Brief description\*\*
> The Star Channel Commercial returns incorrect error respo…nses, as well as sending a 'success' response in a situation it should fail.
> 
> \*\*How to reproduce\*\*
> Use the https://dev.twitch.tv/docs/v5/reference/channels#start-channel-commercial endpoint.
> If the channel is offline a 500 error is returned.
> If the channel is live and hasn't run an ad recently, a 'success' message is returned \`{ Message: 'Starting commercial break. Keep in mind you are still live and not all viewers will receive a commercial.', Length: 30, RetryAfter: 480 }\` which is correct for Affiliates/Partners, but a normal user should not be receiving this as no ads can actually be run.
> If the channel is live and has run an ad recently (within the 'retry after' window) a 500 error is returned.
> 
> \*\*Expected behavior\*\*
> The documentation specifically states that running an ad too quickly, as well as attempting to run for a non partner/affiliate, there should be a 422 Unprocessable Entity,
> There's no documented behaviour for an offline stream, but it should respond with either a 422, or follow the behaviour of other endpoints which require a stream to be live such as the Create Channel Marker endpoint and return a 404.
> 
> None of these errors should be 500's.
> 
> \*\*Additional context or questions\*\*
> No equivalent Helix endpoint exists for this, so while this is a deprecated endpoint it is something we need to rely on so correct responses is important.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [March 20, 2020, 1:54pm UTC](https://discuss.dev.twitch.com/t/start-commercial-error-500/24171/3 "2020-03-20T13:54:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
