microsoftgraph / microsoft-graph-comms-samples

Microsoft Graph Communications Samples
MIT License
211 stars 237 forks source link

AudioVideoPlaybackBot not joining meeting - Server Internal Error. DiagCode: 500#3002.@ #729

Closed rubenrumu closed 4 months ago

rubenrumu commented 5 months ago

Hello everyone!

I'm having problems executing AudioVideoPlaybackBot from my computer using ngrok. I'm trying this approach since the Cloud Service deployment instructions in the bot seem to be deprecated.

I've followed the instructions described here: https://github.com/microsoftgraph/microsoft-graph-comms-samples/tree/master/Samples/V1.0Samples/LocalMediaSamples/AudioVideoPlaybackBot

I've created an Azure Bot + Application Registration. I've created a secret and I've uploaded my certificate chain to the app registration. It's a valid GoDaddy wildcard for *.biometricvox.com. I've given all the neccessary permissions to the app registration.

I've ran the configure_cloud.ps1 script with my bot name, appId, secret and certificate thumbprint. The certificate chain is installed in my computer.

I've got a Pro ngrok subscription and the neccessary CNAME records pointing from my domain to ngrok. The address bot.biometricvox.com is pointing to ngrok, and 0.bot.ngrok.com is pointing to 0.tcp.ngrok.io, as seen in the documentation: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/calls-and-meetings/debugging-local-testing-calling-meeting-bots

I'm changing the public ngrok port in the code everytime I ran ngrok.

I've ran several SSL Checks from different CA websites to analyze the validity of the certificate, through the ngrok tunnel, and they all passed.

I think I have everything right, but when telling the bot to join a meeting I get the message Server Internal Error. DiagCode: 500#3002.@ from Microsoft Graph, as can be seen in the log file I'm attaching: logs.txt

The communication between the bot and Microsoft Graph API seems to be OK, but at some point Graph sends this 500 Internal Server Error and changes the cll state from Establishing to Terminated. I can't find documentation about error code 500 / subcode 3002.

I've seen some other threads with the same issue, but none of them seem to have a valid solution: https://learn.microsoft.com/en-us/answers/questions/1658031/calling-teams-bot-call-goes-from-establishing-to-t https://github.com/MicrosoftDocs/msteams-docs/issues/9170 https://github.com/microsoftgraph/microsoft-graph-comms-samples/issues/664 https://techcommunity.microsoft.com/t5/teams-developer/ms-teams-recording-bot-fails-with-internal-server-error/m-p/3647394 https://techcommunity.microsoft.com/t5/teams-developer/ms-teams-calling-bot-fails-with-internal-server-error/m-p/4055819

Any help would be appreciated.

Thank you very much!

1fabi0 commented 4 months ago

You don't need to upload you're certificate to you're app registration, you need to have the certificate installed into you're local certificate store [or load it from file i think this is not implemented in any sample]. Then you're domain should point to 0.tcp.ngrok.io and that is only required because you need to have a certifcate with a valid certficate chain which is easily possible if you can proove that you own the domain. When the media platform connects to the TCP endpoint of you're bot it uses TLS and checks if the certificate for TLS has a certificate chain to one of the root certificates, which means self signed certificates won't work.

rubenrumu commented 4 months ago

Thank you for your response! I'm not using self-signed certificates. I'm using a valid wildcard *.biometricvox.com, purchased in GoDaddy. I have installed it in my Windows, with the whole certificate chain. In fact, if I launch GoDaddy's online certificate checker and make it investigate "bot.biometricvox.com" when my ngrok is running, GoDaddy's SSL checker says it's all OK. I have a CNAME from bot.biometricvox.com to the ngrok subdomain that ngrok gives me, and another CNAME from 0.bot.biometricvox.com to 0.tcp.ngrok.io.

1fabi0 commented 4 months ago

I am not sure if .biometricvox.com is valid for 0.bot.biometricvox.com, I assume you would need .bot.biometricvox.com there, I would recommend you to try something like 0bot.biometricvox.com

rubenrumu commented 4 months ago

I tried it and it worked! Thank you very much!