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

Webchat # Directline APIs performance severely impacting user experience

Open sharmadine opened this issue 8 years ago • 20 comments

Bot Info

  • SDK Platform: Node.js
  • SDK Version: 3.14.1
  • Active Channels: Direct Line
  • Deployment Environment: Azure Bot Service

Issue Description

For last 5-6 hours today, the response times from WebChat initiated DirectLine APIs are crossing 5+ seconds severely impacting user experience.

A few observations:

  1. receiving frequent '403' errors GET https://directline.botframework.com/v3/directline/conversations/xxxxxx/activities?watermark=44 403 (Forbidden) botchat.js:20
  2. Receiving frequent '503' errors
  • Failed to load resource: the server responded with a status of 503 (Service Unavailable)
  • Failed to load https://directline.botframework.com/v3/directline/conversations/xxxxxxxx/activities?watermark=37: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://URL.com' is therefore not allowed access. The response had HTTP status code 503.

Code Example

Reproduction Steps

The bot / webchat is working perfectly in production for last few months. The behaviour is observed for last 4-6 hours.

Expected Behavior

Directline APIs should not fail and lead to 'Retry' message behaviour.

Actual Results

Direct Line API long-poll calls are failing leading to 'couldn't send, Retry' message to users. image

Please support to help us providing consistent and well performing user experience.

sharmadine avatar Jun 01 '18 11:06 sharmadine

Are you using the default state store or have you implemented a custom one?

JasonSowers avatar Jun 01 '18 22:06 JasonSowers

We have been using custom state since beginning of Production deployment i.e. 3-4 months.

sharmadine avatar Jun 01 '18 23:06 sharmadine

Sorry for the delay, Is this still happening?

JasonSowers avatar Jun 06 '18 16:06 JasonSowers

Not observed after that day but message deliveries were failing yesterday. No errors but messages were not getting delivered to connector and Webchat was too slow to interact. Looking at our bot service logs, we found that messages were not getting delivered to bot service.

Directline response times are not consistent, sometimes it gives error and sometimes it just goes silent impacting the user response times / interaction severely.

sharmadine avatar Jun 07 '18 02:06 sharmadine

take a look at this as it may provide some useful information for you https://blog.botframework.com/2017/11/02/optimizing-latency-bot-framework/

JasonSowers avatar Jun 07 '18 04:06 JasonSowers

@JasonSowers we are getting 503 again now in our production bot hosted in West Europe.

Error: POST to 'https://directline.botframework.com/v3/conversations/xxxxx/activities/xxxxx' failed: [500]  
    at Request._callback (/usr/src/app/node_modules/bot-services/node_modules/botbuilder/lib/bots/ChatConnector.js:559:46)

Please suggest and support. The problem is becoming frequent and causing production bots downtimes.

sharmadine avatar Jun 14 '18 07:06 sharmadine

@JasonSowers @sharmadine We have have the same issue too on our production bot deployment

0xeminneo avatar Jun 14 '18 08:06 0xeminneo

We are also having the same errors on all our bot environments. A sample error:

Failed to load https://directline.botframework.com/v3/directline/conversations/CJNVaedUKzPAuf4kKEn2hL/activities: 
Response to preflight request doesn't pass access control check: 
No 'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'https://www.ouroriginwhichwasworking.com' is therefore not allowed access. 
The response had HTTP status code 503

This is on the C# SDK. Latest version.

JPThorne avatar Jun 14 '18 08:06 JPThorne

Same issue too. (and we definitely use a custom state client)

willemodendaal avatar Jun 14 '18 08:06 willemodendaal

Same

stringhandler avatar Jun 14 '18 09:06 stringhandler

The error that I am getting now is:

Request URL: https://directline.botframework.com/v3/directline/conversations
Request Method: POST
Status Code: 500 Internal Server Error

sharmadine avatar Jun 14 '18 09:06 sharmadine

Do we have a solid solution for this? This is affecting in production. We are getting below error Failed to load https://directline.botframework.com/v3/directline/conversations: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://preview.c9users.io' is therefore not allowed access. The response had HTTP status code 503.

viralgandhi avatar Jun 14 '18 09:06 viralgandhi

Having the same issue. Bots are in production.

kanishk-mehta avatar Jun 14 '18 10:06 kanishk-mehta

Same issue for us as well, causing production downtime. :(

bhushanvadgave avatar Jun 14 '18 10:06 bhushanvadgave

@sharmadine @easkerov @JPThorne @willemodendaal @mikethetike @viralgandhi @kanishk-mehta @bhushanvadgave The issue from 13 hours ago is tracked here: https://github.com/Microsoft/BotBuilder/issues/4738

4686 is a different issue from two weeks ago.

EricDahlvang avatar Jun 14 '18 20:06 EricDahlvang

@sharmadine are you still experiencing any issue?

JasonSowers avatar Jun 25 '18 13:06 JasonSowers

@JasonSowers I have not seen Direct Line 500/503 errors in last couple of days. We are monitoring it closely and will share if observe the errors.

sharmadine avatar Jun 26 '18 05:06 sharmadine

@sharmadine I am going to close this issue as it was overtaken with non-related posts. If you find you are still experiencing this or something new please make a new issue detailing the behavior.

JasonSowers avatar Jun 28 '18 20:06 JasonSowers

i am also facing the issue that after chatting with bot i left for 2 hours, again i returned and tried to chat but bot is not sending the message, it is showing "sent Retry"

Bradrajkumar avatar Aug 02 '19 13:08 Bradrajkumar

Hi @Bradrajkumar

This is a closed issue. Closed issues are not monitored by the team. Please direct your question to StackOverflow The Bot Framework Support Team monitors Stack Overflow daily.

That said: please ensure you are on the latest version of the v3 or v4 sdk. Also, ensure AlwaysOn is set for the web application hosting the bot.

EricDahlvang avatar Aug 02 '19 23:08 EricDahlvang