microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
867 stars 369 forks source link

Under proxy when testing in embedded compo webchat, the user receives read ECONNRESET #8686

Open geo-msft opened 2 years ago

geo-msft commented 2 years ago

Describe the bug

I was working with a customer on the following ISSUE:

The customer has a proxy on his machine where is running composer 2.1.1.

They setup the proxy vars:

set https_proxy="your proxy server IP address":"your port number"

set http_proxy="your proxy server IP address":"your port number"

set no_proxy=localhost

in order to make the publish work well. Docs here Configure a proxy server - Bot Framework Composer | Microsoft Docs

But now, when using the embedded compo webchat to test the bot, they receive this error

[03:48:44 AM]POST201/v3/conversations

[03:48:44 AM]POST404/v3/directline/conversations/75fbaa47-b676-4606-95ac-082c38ed172c%7Clivechat/activitiesAn error occurred posting activity to the bot. read ECONNRESET

Version

2.1.1

Browser

OS

To Reproduce

Steps to reproduce the behavior:

  1. Have a proxy setup on the machine as we explain here Configure a proxy server - Bot Framework Composer | Microsoft Docs
  2. Start the bot in composer
  3. Wait for it to start
  4. Type a message to the bot
  5. Receive the error

[03:48:44 AM]POST201/v3/conversations

[03:48:44 AM]POST404/v3/directline/conversations/75fbaa47-b676-4606-95ac-082c38ed172c%7Clivechat/activitiesAn error occurred posting activity to the bot. read ECONNRESET

Expected behavior

The bot should reply with no error.

Additional context

The bot replies alright if the customer is testing it into the emulator on the same machine; it's just the embedded compo webchat showing that error.

dmvtech commented 2 years ago

Hi @geo-msft

I cannot reproduce this exact error (although there are other issues with proxy; LUIS and sign-in, etc).

Is this still reproducible for you/customer? Is this a simple echo bot? Can you confirm they set the proxy as the system proxy as well?

jithin24 commented 2 years ago

Hi Dana,

The error does still exists within a corporate proxy setup. It seems like an issue between the Emulator Channel and the BotFramework Response methods. The only way I can get it to work is by temporarily deleting the Proxy (process.env.HTTP_PROXY and process.env.HTTPS_PROXY) in the ProccessActivity() function of the botbuilder>lib>botFrameworkAdapter.js file which I believe is triggered on processing an activity and enable the process Env Proxy back after the final Send Activity to the channel.