sendgrid-csharp icon indicating copy to clipboard operation
sendgrid-csharp copied to clipboard

System.Net.Http.WinHttpException: A security error occurred

Open grana601 opened this issue 7 years ago • 3 comments

Technical details:

  • sendgrid-csharp Version: 9.9.0
  • Platform : ASP.NET Core 2.0

Issue Summary:

This issue is coming while sending email to user. This issue is coming some time, 2 or 3 time a day. Please let me know what is the reason for this issue.

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.Tasks.RendezvousAwaitable1.GetResult() at System.Net.Http.WinHttpHandler.<StartRequest>d__105.MoveNext() --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at SendGrid.Helpers.Reliability.RetryDelegatingHandler.<SendAsync>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at System.Net.Http.HttpClient.d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at SendGrid.SendGridClient.d__23.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at SendGrid.SendGridClient.d__24.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at SendGrid.SendGridClient.d__25.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at School.Api.Services.EmailService.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at School.Api.Services.EmailService.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at School.Api.Services.ControlPanelRepository.d__115.MoveNext()

grana601 avatar Oct 07 '19 06:10 grana601

Hello @grana601,

Thanks for reporting this issue!

This looks like an intermittent networking error. I'm thinking these errors might happen when your server can't talk to ours correctly.

Understanding that the issue happens 2-3 times a day, can you please provide some context? (i.e. what percentage does 2-3 errors mean?)

My suggestion would be to catch this error in your code, log and implement some retry logic.

With best regards,

Elmer

thinkingserious avatar Oct 09 '19 18:10 thinkingserious

2 % chance error comes in a day

grana601 avatar Oct 23 '19 11:10 grana601

Hello @grana601,

I'm closing this issue as it's not related to this helper library. If you require further assistance on this issue, please open a ticket at https://support.sendgrid.com.

Thanks!

With best regards,

Elmer

thinkingserious avatar Mar 20 '20 18:03 thinkingserious