botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

C# Operation returned an invalid status code '429', Microsoft.Rest.HttpOperationException

Open alokraj68 opened this issue 9 years ago • 10 comments

Hi, Whenever we try to send a message to a user using

await context.PostAsync("Hi");

The exception occurs like Microsoft.Rest.HttpOperationException , Operation returned an invalid status code '429'

we did a throw check and posted just a hi, but still, this issue persists. can anyone help us out?

It's more often for platform Kik and exist in telegram, FB and skype.

alokraj68 avatar Jan 17 '17 08:01 alokraj68

if i understand you correctly, it works from time to time? 429 means Too Many Requests So you should consider upgrading your App Service so it can handle more requests.

fingejo avatar Jan 17 '17 14:01 fingejo

Does it? I see so much if ram and memory left without use even now. So am confused of that. Is it not something with code? And why does it occur so often with kik and telegram and not so much if facebook?

On 17-Jan-2017 8:15 PM, "fingejo" [email protected] wrote:

if i understand you correctly, it works from time to time? 429 means Too Many Requests So you should consider upgrading your App Service so it can handle more requests.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/2048#issuecomment-273187207, or mute the thread https://github.com/notifications/unsubscribe-auth/AIyDm6mxMbDiCP-uA_Y9SZW8ZoY4WEqYks5rTNQNgaJpZM4LlVRx .

alokraj68 avatar Jan 17 '17 15:01 alokraj68

This happens because you are going through ngrok.io by default and ngrok.io is rate limiting your requests.

You can either slow down your conversation or you can disable ngrok.io for local debugging by: image

image

tomlm avatar Jan 18 '17 02:01 tomlm

@tomlm you understood the question wrong. I think you did not read the issue at all before replying. Am talking about bot in FB, Kik and telegram where ngrook is not present. Please don't close issues without resolving the issue.

alokraj68 avatar Jan 18 '17 04:01 alokraj68

hard to say without more information, but it seems to be a network/hardware problem to me, due to the error code.

fingejo avatar Jan 18 '17 08:01 fingejo

What infos will you need @fingejo

Thanks and Regards,

[image: Astro-Vision Future Tech] https://htmlsig.com/t/000001C1E7PD

Alok Rajasukumaran / Developer - Innovation Team [email protected] / 00919995607654

Astro-Vision Future Tech Kuthappadi, Thamannam, ErnakulamKerala, India - 682032 alokraj68.in

[image: Twitter] https://htmlsig.com/t/000001BVYZJE [image: Facebook] https://htmlsig.com/t/000001BX9HG8 [image: Google +] https://htmlsig.com/t/000001BV7H1J [image: LinkedIn] https://htmlsig.com/t/000001C065D9 [image: Youtube] https://htmlsig.com/t/000001C06RDJ [image: Github] https://htmlsig.com/t/000001BYKTTT [image: Soundcloud] https://htmlsig.com/t/000001BX996X [image: Stack Overflow] https://htmlsig.com/t/000001BVE8RR

On Wed, Jan 18, 2017 at 1:55 PM, fingejo [email protected] wrote:

hard to say without more information, but it seems to be a network/hardware problem to me, due to the error code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/2048#issuecomment-273412503, or mute the thread https://github.com/notifications/unsubscribe-auth/AIyDm9aQmlmyZelf2EhAvptm68i2_7OUks5rTcxdgaJpZM4LlVRx .

alokraj68 avatar Jan 18 '17 09:01 alokraj68

where is your bot hosted? Which app service do you use? How much requests do you recieve per second/minute? Does it appear in all channels or only in KiK? Where exactly is the exception thrown? to make sure it is not a code issue, you can remote-debug your bot if it is hosted in azure.

fingejo avatar Jan 18 '17 09:01 fingejo

@fingejo My bot I hosted in Azure with plan B1 Basic. Request rate is around 1: 4 at most. that is 4 request goes out for one incoming request. It appears a lot for KIK and somewhat for Telegram and really low for FB. In telegram and FB it will restart the bot. in KIK it just crashes with the exception. The exception is thrown when I try to post a message to the user using

await context.PostAsync("message");

How can I remote debug the bot?!

alokraj68 avatar Jan 18 '17 10:01 alokraj68

in visualstudio, you can open your azure account in the cloud explorer, then search for your bot app and right click: "attach debugger" It doesnt work all the times, sometimes you have to restart visualstudio and i would always deploy before attaching the debugger.

maybe kik and other channels have some kind of spam security and that is blocking your bot, that's the only solution i can imagine when it's not a ressource problem on your site.

fingejo avatar Jan 18 '17 11:01 fingejo

@alokraj68:

429 Too Many Requests Rate limit exceeded

4 messages sent for every message received will trip the rate limiter very quickly. Kik's rate limits are outlined here:

https://dev.kik.com/#/docs/messaging#rate-limits

You'll need to batch the messages together and reduce the number of messages sent out.

davidbistolas avatar Jan 18 '17 16:01 davidbistolas