Open j40903272 opened 3 months ago
In that particular call, there is an error with the bot's attempt to answer it:
Caught an Exception running the task: Answering call 1a008480-2b3e-4c3e-b4d3-f04d5c0f8757 with scenario 3ee52050-835e-4191-807c-570e172d8e19. exception: Code: UnknownError Message: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
HTTP Error 400. The size of the request headers is too long.
Hi, do you know what may cause the problem? I have not change any of the code for a long while but this suddenly came up starting two weeks ago. And there is only one sdk function call for the 'CallsOnIncoming'. How can i troubleshoot? should i capture the request and look at the header? is it possible that the ngrok causing the header size problem while redirecting?
private void CallsOnIncoming(ICallCollection sender, CollectionEventArgs<ICall> args)
{
try
{
args.AddedResources.ForEach(async call =>
{
if (!CallHandlers.ContainsKey(call.Id))
{
CallHandler callHandler = null;
try
{
var mediaSession = Guid.TryParse(call.Id, out Guid callId)
? this.CreateLocalMediaSession(callId)
: this.CreateLocalMediaSession();
// Answer call and start video playback
await call?.AnswerAsync(mediaSession).ForgetAndLogExceptionAsync(
call.GraphLogger,
$"Answering call {call.Id} with scenario {call.ScenarioId}.");
call.GraphLogger.Info($"Call creation complete: {call.Id}");
Logger2.LogError($"Call creation complete: {call.Id}");
}
catch (Exception)
{
// clean up
callHandler?.Dispose();
throw;
}
}
});
}
catch (Exception ex)
{
Logger2.LogError("AnswerAsync Failed");
Logger2.LogError(ex.ToString());
}
Logger2.LogError("Complete CallsOnIncoming");
}
@ssulzer may I ask where causes the header size too long error? Is it when the sdk tries to answer the call but the remote refuses? How can i trouble shoot this issue since I am only answering the call with await call?.AnswerAsync(mediaSession)
@jackry @jackry2023
Hi @ssulzer , the problem seems to be resolved after I removed some of the bot application permission and remain only the necessary ones. I suspect that the bot api permissions are all put inside the header and causes the problem. Hope this can be fixed in the future.
Hi @yundatsai What bot api permissions did you remove?
I removed all of the api permission and add back the necessary permission (6 of them). I did not record what permission exactly. But from the error shown "header length too long", I would suspect that it is about the amount of api permission that cause the problem. I had > 40 api permission for my bot account when the error happened.
Describe the issue Starting from last week, my bot cannot answer calls and will run into error "Callee could not be reached". I did not change the server for more than half year. I checked my connections and bot configurations, but everything seems fine. Can you tell me what might be the problem and how to fix this?
Expected behavior The bot to answer the call successfully.
Graph SDK (please complete the following information):
Call ID 1a008480-2b3e-4c3e-b4d3-f04d5c0f8757 timestamp 1724125433
Logs