Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WCF core client throws EventSourceException:The payload for a single event is too large #4775

Closed
imcarolwang opened this issue Dec 20, 2021 · 1 comment
Assignees

Comments

@imcarolwang
Copy link
Contributor

Describe the bug
"EventSourceException:The payload for a single event is too large" instead of the actual exception thrown from .net core wcf client

To Reproduce
Steps to reproduce the behavior:

  1. on machine A, deploy the sample service in wcf.git: TcpTransSecMessCredsUserName.svc/tcp-message-credentials-username
  2. create .net core project in machine B, add wcf packages reference
  3. write wcf client test code for service mentioned in step1, provide correct user name, but transport certificate in machine A is not trusted by machine B
  4. run wcf test client project, observe the exception

Expected behavior
Similar as .NetFramework project, should throw exception with the actual error message:
System.ServiceModel.Security.SecurityNegotiationException
HResult=0x80131501
Message=The X.509 certificate CN=xxx, O=xxx, OU=Created by https://github.com/dotnet/wcf chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority.

Actual error
System.Diagnostics.Tracing.EventSourceException
HResult=0x80131500
Message=The payload for a single event is too large.
Source=System.Private.CoreLib
StackTrace:
at System.Diagnostics.Tracing.EventSource.ThrowEventSourceException(String eventName, Exception innerEx)
at System.Diagnostics.Tracing.EventSource.WriteEventVarargs(Int32 eventId, Guid* childActivityID, Object[] args)
at System.Diagnostics.Tracing.EventSource.WriteEvent(Int32 eventId, Object[] args)
at System.Runtime.WcfEventSource.ThrowingException(String data1, String data2, String SerializedException, String AppDomain) in //src/System.Private.ServiceModel/src/Internals/WcfEventSource.cs:line 2040
at System.Runtime.WcfEventSource.ThrowingException(String data1, String data2, String SerializedException) in /
/src/System.Private.ServiceModel/src/Internals/WcfEventSource.cs:line 2046
at System.Runtime.TraceCore.ThrowingException(EtwDiagnosticTrace trace, String param0, String param1, Exception exception) in //src/System.Private.ServiceModel/src/Internals/TraceCore.cs:line 114
at System.Runtime.ExceptionTrace.TraceException[TException](TException exception, String eventSource) in /
/src/System.Private.ServiceModel/src/Internals/System/Runtime/ExceptionTrace.cs:line 236
at System.Runtime.ExceptionTrace.TraceException[TException](TException exception) in //src/System.Private.ServiceModel/src/Internals/System/Runtime/ExceptionTrace.cs:line 228
at System.Runtime.ExceptionTrace.AsError(Exception exception) in /
/src/System.Private.ServiceModel/src/Internals/System/Runtime/ExceptionTrace.cs:line 43
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) in //src/System.Private.ServiceModel/src/Internals/System/Runtime/AsyncResult.cs:line 351
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) in /
/src/System.Private.ServiceModel/src/System/ServiceModel/Channels/ServiceChannel.cs:line 1909
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) in //src/System.Private.ServiceModel/src/System/ServiceModel/Channels/ServiceChannel.cs:line 806
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.b__0(IAsyncResult asyncResult) in /
/src/System.Private.ServiceModel/src/System/ServiceModel/Channels/ServiceChannelProxy.cs:line 184
--- End of stack trace from previous location ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at TransportWithMsgCredentialClient.Program.TestClient() in E:\test\TransportWithMsgCredentialClient\Program.cs:line 35
at TransportWithMsgCredentialClient.Program.Main(String[] args) in E:\test\TransportWithMsgCredentialClient\Program.cs:line 16

This exception was originally thrown at this call stack:
System.Diagnostics.Tracing.EventSource.ThrowEventSourceException(string, System.Exception)
System.Diagnostics.Tracing.EventSource.WriteEventVarargs(int, System.Guid*, object[])
System.Diagnostics.Tracing.EventSource.WriteEvent(int, object[])
System.Runtime.WcfEventSource.ThrowingException(string, string, string, string) in WcfEventSource.cs
System.Runtime.WcfEventSource.ThrowingException(string, string, string) in WcfEventSource.cs
System.Runtime.TraceCore.ThrowingException(System.Runtime.Diagnostics.EtwDiagnosticTrace, string, string, System.Exception) in TraceCore.cs
System.Runtime.ExceptionTrace.TraceException(TException, string) in ExceptionTrace.cs
System.Runtime.ExceptionTrace.TraceException(TException) in ExceptionTrace.cs
System.Runtime.ExceptionTrace.AsError(System.Exception) in ExceptionTrace.cs
System.Runtime.AsyncResult.End(System.IAsyncResult) in AsyncResult.cs
...
[Call Stack Truncated]

@HongGit
Copy link
Contributor

HongGit commented May 19, 2022

This is already fixed.

@HongGit HongGit closed this as completed May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants