microsoftgraph / microsoftgraph/microsoft-graph-comms-samples
EchoBot throws exceptions during the initialization and terminates the call on joining.
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 253
- Forks
- 275
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 1
Description
We try to run the EchoBot example (GitHub: microsoftgraph/microsoft-graph-comms-samples/Samples/PublicSamples/EchoBot/).
We have a Microsoft 365 Developer sandbox as a part of Visual Studio subscription, and a tenant in the sandbox.
We use Postman to hit the bot.
Versioning:
- We use Windows 11, Visual Studio 2022 Professional, C#, and .NET version 6.0.
- README in the EchoBot example recommends .NET 4.7.1, but it looks like it's just wrong.
(The project file for the EchoBot example contains net6.0).
- We downloaded .NET 4.7.1 SDK from the NET web site, installed it, switched to .NET Framework 4.7.1,
did the NuGet clean and restore. Does not compile.
Ngrok:
- We have Ngrok (free version) running and providing two endpoints locally, one for HTTPS, and one for TCP.
Certificates:
- We created a self-signed certificate for the TCP domain and installed it in the local certificate store for
both User / Personal and Local Machine / Personal.
- The certificate is being picked up by the bot (without the certificate installed, the bot does not start at all).
Graph Application and Azure Bot registrations:
- The application is registered in MS Entra for our sandbox tenant, all the permissions are granted and consented.
- The Azure Bot is also registered in the Azure portal.
- We also added the Microsoft Teams Channel to the bot channels in the bot registration, enabled calling in the Calling tab,
and added the correct domain name to Webhook (for calling) field: https://.ngrok-free.app/api/calling
Local environment:
- The application / client ID and the application / client secret are added to the .env file in the bot project.
- The Ngrok endpoints and ports are added to the .env file.
- The certificate thumbprint is added to the .env file.
When we run the bot from Visual Studio in the debug mode, during the bot initialization, the following 12 different types of exceptions are logged:
1. onecore\net\netprofiles\service\src\nsp\dll\namespaceserviceprovider.cpp(613)\nlansp_c.dll!00007FFF45F1F6BD:
(caller: 00007FFF619FACF6) LogHr(1) tid(59e8) 8007277C No such service is known. The service cannot be found in the specified name space. (3)
2. Microsoft C++ exception: std::system_error at memory location 0x00000050203BA850.
3. Exception thrown at 0x00007FFF5FE1FABC (KernelBase.dll) in EchoBot.exe: WinRT originate error - 0x80040155 :
'Failed to find proxy registration for IID: {79EAC9E4-BAF9-11CE-8C82-00AA004BA90B}.'.
4. Exception thrown at 0x00007FFF5FE1FABC (KernelBase.dll) in EchoBot.exe: 0x80040155: Interface not registered. (2)
5. MediaPerf is not registered: no key found at SYSTEM\CurrentControlSet\Services\MediaPerf\Performance
6. Exception thrown at 0x00007FFF5FE1FABC (KernelBase.dll) in EchoBot.exe: 0x000006D9: There are no more endpoints available from the endpoint mapper.
7. Exception thrown at 0x00007FFF5FE1FABC (KernelBase.dll) in EchoBot.exe: 0x000006BA: The RPC server is unavailable. (3)
8. 'System.InvalidOperationException' in System.Diagnostics.PerformanceCounter.dll: Category does not exist.
9. 'System.IO.IOException' in System.Net.Sockets.dll, System.Net.Security.dll, System.Private.CoreLib.dll
10. 'System.InvalidOperationException' in Unity.Container.dll.
No public constructor is available for type Microsoft.Extensions.Options.IPostConfigureOptions`1[Microsoft.Extensions.Logging.LoggerFilterOptions]
(and for other interfaces, about 60 of them).
Inner Exception: InvalidRegistrationException: Exception of type 'Unity.Exceptions.InvalidRegistrationException' was thrown.
11. System.IO.IOException in System.Net.Security.dll, System.Private.CoreLib.dll. Received an unexpected EOF or 0 bytes from the transport stream. (5)
12. System.IO.IOException: 'Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..'
But despite of all the exceptions, the bot starts:
Microsoft.Hosting.Lifetime: Information: Now listening on: http://[::]:9442
Microsoft.Extensions.Hosting.Internal.Host: Debug: Hosting started.
And the GET health check request from Postman hits Ngrok, hits the bot, and returns 200 OK to the Postman.
During the bot initialization, the BotMediaStream is created, the audio socket is initialized,
the bot sends status active for media, and the media player is created.
Testing;
- We start the bot in Visual Studio (as administrator) locally.
- We start the Teams client locally, in our sandbox tenant.
- We start a private scheduled meeting in Teams (Calendar -> Schedule -> Join Meeting).
- We use the meeting JoinURL for the bot to join the meeting call from Postman with a JSON POST request
{ "joinURL": <JOIN_URL> }.
- It hits Ngrok, hits the bot, the bot returns 200 OK and reports that it joined the call:
CallController: Joined the call, call ID: 1e005980-8e2c-4831..., URL: https://teams.microsoft.com/l/meetup-join/19%3ameeting_NjZh...
- The bot also receives two notifications via api/calling/notification endpoint after the join call request and replies with 202 Accepted:
PlatformCallController: Notification result: StatusCode: 202, ReasonPhrase: 'Accepted', Version: 1.1, Content: System.Net.Http.EmptyContent.
- We monitor the wire in WireShark for the media TCP ports.
The problem:
It tries to establish the call:
17:01:28:954 CallHandler: Call status updated to Establishing.
And then immediately terminates it:
17:01:29:954 CallHandler: Call status updated to Terminated - Server Internal Error. DiagCode: 500#1203002.@.
And then throws the following exceptions:
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.CoreLib.dll
A task was canceled.
Exception thrown: 'System.IO.IOException' in System.Net.Sockets.dll
Unable to read data from the transport connection:
The I/O operation has been aborted because of either a thread exit or an application request.
THE BOT DOES NOT APPEAR IN THE MEETING, and NO MEDIA IS SENT TO THE BOT.
Questions:
1. All the exceptions are triggered deeply in the native libraries. Can it mean that there are some versioning issues?
2. What can cause the exceptions in the bot during the initialization? Are those exceptions significant?
3. Can those exceptions cause that the bot is not joining the call and also the media stream issues?
4. Is it OK to use a self-signed certificate?
5. What would you recommend to further debug the issue?
Thank you!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the EchoBot README and project file, then trace CallController, PlatformCallController, BotMediaStream, and the api/calling/notification endpoint. Reproduce the join request while comparing initialization, call-status, and media-socket logs, including the listed version, certificate, and Ngrok settings. Done means identifying a supported configuration or a confirmed cause of the termination and documenting the relevant evidence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, audio-video-rtc, backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100