microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

Bot channel registration stops working with Skype for Business #4647

Closed jesus-seijas-sp closed 6 years ago

jesus-seijas-sp commented 6 years ago

Bot Info

Issue Description

We have a chatbot connected to Skype for Business. We tested the chatbot with one user, and the chatbot is answering without problems. When a second user connects, or the user talking logoff and logon again to talk with the chatbot, then there is no further answer from the bot.

Analyzing the problem:

Reproduction Steps

  1. Connect a bot with skype for business
  2. Talk to the bot. It will works.
  3. Logoff the user talking with the bot and login again
  4. Talk to the bot. It fails, the piece failing is the Bot Channel Registration due to no further traffic to the bot endpoint.

Another way:

  1. Connect a bot with skype for business
  2. Talk to the bot. It will works.
  3. Talk to the bot with another user. It fails, the piece failing is the Bot Channel Registration due to no further traffic to the bot endpoint.

Expected Behavior

The expected behaviour is that even with 2+ persons talking with the bot, Bot Channel Registration keeps talking with the bot endpoint, so the bot works.

Actual Results

boterror boterror2

slvnperron commented 6 years ago

We're facing the same issue here, S4B totally stopped working

stevkan commented 6 years ago

Hi @jesus-seijas-sp and @slvnperron,

Thank you for your patience while I look into this deeper. In the meantime, can I get each of your AppId's for looking into bot activity?

slvnperron commented 6 years ago

@stevkan Microsoft App Id for the bot in question is 75813397-c61c-45da-b3d0-ea23cec94903

Ultimately the only thing that worked for us is to create a new app and re-deploy the S4B bot to that new app.

This has happened to us in the past as well, and I think this happens when we change the bot's endpoint.

stevkan commented 6 years ago

Hi @jesus-seijas-sp and @slvnperron,

The issue appears to be on the Skype for Business side. That team is being made aware and will continue with the investigation into a possible resolution.

slvnperron commented 6 years ago

Thanks.

That just happened with an other client bot this morning, this time there has been no change to the endpoint.

On Wed, Jun 6, 2018, 4:20 PM Steven Kanberg notifications@github.com wrote:

Hi @jesus-seijas-sp https://github.com/jesus-seijas-sp and @slvnperron https://github.com/slvnperron,

The issue appears to be on the Skype for Business side. That team is being made aware and will continue with the investigation into a possible resolution.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/4647#issuecomment-395200280, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQStKdZ_FxkJ_-hTBvGj46_8ooLygNIks5t6DlzgaJpZM4UJ43W .

stevkan commented 6 years ago

Ok. I'll be sure to add it to the information being passed along.

slvnperron commented 6 years ago

Thanks Steven, much appreciated.

jesus-seijas-sp commented 6 years ago

Thanks Steven, I really appreciate your help. I will wait for further information.

Caynosadler commented 6 years ago

Hi @jesus-seijas-sp I am facing a similar problem, i'd like to know if you were able to resolve it without creating a new bot and redeploying SFB

jesus-seijas-sp commented 6 years ago

Hi @Caynosadler and @stevkan : I did an analysis of what is happening, I will explain what I did and my conclussions:

  1. I created a new skype for business tenant.
  2. I created 6 bots, 3 on the same tenant as skype, 3 on a different tenant. 2 of the bots deployed on azure, 2 on AWS and 2 on my local through ngrok.
  3. Every bot pointing to https://{host}/api/messages
  4. I connected the 6 bots to my Skype for business, webchat and slack. The result was 6 bots perfectly working on all channels.
  5. I changed one of the bots from https://{host}/api/messages to http://{host}/messages
  6. This bot still worked on webchat and slack but not in skype for business.
  7. Looking the logs I found that the SFB was still connecting to https://{host}/api/messages !!!!!
  8. I did another test: I changed the {host} of one of the bots, to double check if the problem is that /api/messages is hardcoded.... so I passed from https://{host}/api/messages to https://{anotherhost}/api/messages
  9. This bot still worked on webchat and slack but not in skype for business
  10. No call was made to my {anotherhost}... but there were calls to {host}
  11. I went to powershell and removed this last csconnection by sip, and created the csconnection again to the same sip
  12. The bot was still failing
  13. I went to the Admin Panel and removed the user of the sip, and also the csconnection by sip, and created bot again with the same sip
  14. The bot was still failing.

Conclussions:

Way to Get if working:

  1. You cannot use the same sip that you used before if you got your bot failing
  2. You must create a new Bot Channel Registration with new app-id
  3. Once you configure it, you can never change the endpoint at the Bot Channel Registration.

Also I found another breaking change: we deploy with firewall, so the domains that the bot can call must be whitelisted. But the Microsoft Bot Framework messages comme with a serviceUrl that is the url where you must answer. Months ago, the serviceUrl was .onmicrosoft.com or .azure.com, but now is *.lync.com, but I was not notified of this change :(

Hope this helped :)

stevkan commented 6 years ago

Hi @jesus-seijas-sp, refer to the this doc regarding serviceUrl changes.

dkonyayev commented 6 years ago

I am having same issues with S4B. We are running bot in pilot mode so it doesn't get much activity. We also have not changed anything since bot setup. However, now S4B fails with same messages as reported above. Any resolution to this aside from recreating everything from scratch?

jesus-seijas-sp commented 6 years ago

@dkonyayev In fact there seems to be a way. I continued trying after my analysis of more than two months ago. I found that when I modify the description of the bot in the Bot Channel Registration, and then save, then the changes are applied including the endpoint. I didn't published that before because it was so OMG that modifying the endpoint does not apply changes and modifying the description yes that I could not believe. But I reproduced this 2 times more to be sure. Important note: the changes are not inmediately applied, you have to wait several hours (I think that less than 8). Importan note 2: I reproduced this behaviour more than 2 months ago, so I don't know if the actual behaviour will be the same.

Hope that helped :)

dkonyayev commented 6 years ago

@jesus-seijas-sp See my post here, I seem to be having similar but slightly different problem with S4B

https://github.com/Microsoft/BotBuilder/issues/5015 [mod: fixed link]

FKSI commented 6 years ago

@dkonyayev you mentioned the wrong issue :)

JasonSowers commented 6 years ago

Thank you for opening an issue against the Bot Framework SDK v3. As part of the Bot Framework v4 release, we’ve moved all v3 work to a new repo located at https://github.com/microsoft/botbuilder-v3. We will continue to support and offer maintenance updates to v3 via this new repo.

From now on, https://github.com/microsoft/botbuilder repo will be used as hub, with pointers to all the different SDK languages, tools and samples repos.

As part of this restructuring, we are closing all tickets in this repo.

For defects or feature requests, please create a new issue in the new Bot Framework v3 repo found here: https://github.com/microsoft/botbuilder-v3/issues

For Azure Bot Service Channel specific defects or feature requests (e.g. Facebook, Twilio, Teams, Slack, etc.), please create a new issue in the new Bot Framework Channel repo found here: https://github.com/microsoft/botframework-services/issues

For product behavior, how-to, or general understanding questions, please use Stackoverflow. https://stackoverflow.com/search?q=bot+framework

Thank you.

The Bot Framework Team