getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
603 stars 206 forks source link

Input contains invalid characters error when MicrosoftDateFormat is used #351

Closed olsh closed 4 years ago

olsh commented 4 years ago

Please mark the type framework used:

Please mark the type of the runtime used:

Please mark the NuGet packages used:

When we are trying to log an event, an HTTP body is not recorded. I can see HTTP headers, though. There is an error in the Sentry event image

I suppose that the issue was in the old SDK (Raven) too.

bruno-garcia commented 4 years ago

We don't have an OWIN integration yet. This is the second time it came up (the other outside of GH). Are you using WebAPI 1 or 2? Would you be willing to submit a PR to add support?

The error message you're showing is odd, also likely unrelated to OWIN. Could you please attach the JSON event? Are you using sentry.io or self hosted?

olsh commented 4 years ago

Hi @bruno-garcia, We are using WebAPI 2 and sentry.io. I'll submit a PR if I have time.

Here is the event(JSON) ```json { "_meta": { "timestamp": { "": { "err": [ [ "invalid_data", { "reason": "input contains invalid characters" } ] ], "val": "/Date(1581015838498+0000)/" } }, "user": { "data": { "other": { "IsAuthenticated": { "": { "len": 5, "rem": [ [ "@password:filter", "s", 0, 10 ] ] } } } } } }, "_metrics": { "bytes.ingested.event": 16915, "bytes.stored.event": 25406 }, "_relay_processed": true, "contexts": { "server-os": { "name": "Windows", "raw_description": "Microsoft Windows 6.3.9600 ", "type": "os", "version": "6.3.9600" }, "server-runtime": { "name": ".NET Framework", "raw_description": ".NET Framework 4.7.2558.0", "type": "runtime", "version": "4.7.1" } }, "culprit": "Dapper.SqlMapper in ExecuteImplAsync", "datetime": "2020-02-06T19:03:59.342126Z", "dist": null, "environment": "production", "errors": [ { "name": "timestamp", "reason": "input contains invalid characters", "type": "invalid_data", "value": "/Date(1581015838498+0000)/" } ], "event_id": "cf6d93da5a6a4e86accaaef9ba3b939d", "exception": { "values": [ { "module": "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "thread_id": 34, "type": "System.ComponentModel.Win32Exception", "value": "The wait operation timed out" }, { "module": "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "stacktrace": { "frames": [ { "function": "CallOnActionExecutedAsync", "in_app": false, "module": "System.Web.Http.Filters.ActionFilterAttribute", "package": "System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" }, { "function": "HandleNonSuccessAndDebuggerNotification", "in_app": false, "module": "System.Runtime.CompilerServices.TaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "Throw", "in_app": false, "module": "System.Runtime.ExceptionServices.ExceptionDispatchInfo", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "InvokeActionAsyncCore", "in_app": false, "module": "System.Web.Http.Controllers.ApiControllerActionInvoker", "package": "System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" }, { "function": "HandleNonSuccessAndDebuggerNotification", "in_app": false, "module": "System.Runtime.CompilerServices.TaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "Throw", "in_app": false, "module": "System.Runtime.ExceptionServices.ExceptionDispatchInfo", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "MoveNext", "in_app": false, "module": "System.Threading.Tasks.TaskHelpersExtensions+d__1`1", "package": "System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" }, { "function": "ValidateEnd", "in_app": false, "module": "System.Runtime.CompilerServices.TaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "HandleNonSuccessAndDebuggerNotification", "in_app": false, "module": "System.Runtime.CompilerServices.TaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "Throw", "in_app": false, "module": "System.Runtime.ExceptionServices.ExceptionDispatchInfo", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "abs_path": "D:\\BuildAgent\\work\\d6bd8ff9b345e8e3\\src\\Futhark.Gyfu.Data\\Services\\ClientService.cs", "colno": 13, "filename": "D:\\BuildAgent\\work\\d6bd8ff9b345e8e3\\src\\Futhark.Gyfu.Data\\Services\\ClientService.cs", "function": "SyncIptvChannels", "in_app": true, "lineno": 418, "module": "Futhark.Gyfu.Data.Services.ClientService", "package": "Futhark.Gyfu.Data, Version=2020.2.6.453, Culture=neutral, PublicKeyToken=null" }, { "function": "HandleNonSuccessAndDebuggerNotification", "in_app": false, "module": "System.Runtime.CompilerServices.TaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "Throw", "in_app": false, "module": "System.Runtime.ExceptionServices.ExceptionDispatchInfo", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "abs_path": "D:\\BuildAgent\\work\\d6bd8ff9b345e8e3\\src\\Futhark.Gyfu.Data\\Repositories\\DbRepository.cs", "colno": 17, "filename": "D:\\BuildAgent\\work\\d6bd8ff9b345e8e3\\src\\Futhark.Gyfu.Data\\Repositories\\DbRepository.cs", "function": "SyncIptvChannelsAsync", "in_app": true, "lineno": 371, "module": "Futhark.Gyfu.Data.Repositories.DbRepository", "package": "Futhark.Gyfu.Data, Version=2020.2.6.453, Culture=neutral, PublicKeyToken=null" }, { "function": "GetResult", "in_app": false, "module": "System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "HandleNonSuccessAndDebuggerNotification", "in_app": false, "module": "System.Runtime.CompilerServices.TaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "Throw", "in_app": false, "module": "System.Runtime.ExceptionServices.ExceptionDispatchInfo", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "abs_path": "C:\\projects\\dapper\\Dapper\\SqlMapper.Async.cs", "colno": 21, "filename": "C:\\projects\\dapper\\Dapper\\SqlMapper.Async.cs", "function": "ExecuteImplAsync", "in_app": true, "lineno": 678, "module": "Dapper.SqlMapper", "package": "Dapper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" }, { "function": "HandleNonSuccessAndDebuggerNotification", "in_app": false, "module": "System.Runtime.CompilerServices.TaskAwaiter", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "Throw", "in_app": false, "module": "System.Runtime.ExceptionServices.ExceptionDispatchInfo", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "FromAsyncCoreLogic", "in_app": false, "module": "System.Threading.Tasks.TaskFactory`1", "package": "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "EndExecuteNonQueryAsync", "in_app": false, "module": "System.Data.SqlClient.SqlCommand", "package": "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "EndExecuteNonQueryInternal", "in_app": false, "module": "System.Data.SqlClient.SqlCommand", "package": "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "InternalEndExecuteNonQuery", "in_app": false, "module": "System.Data.SqlClient.SqlCommand", "package": "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "ThrowExceptionAndWarning", "in_app": false, "module": "System.Data.SqlClient.TdsParser", "package": "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" }, { "function": "OnError", "in_app": false, "module": "System.Data.SqlClient.SqlConnection", "package": "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" } ] }, "thread_id": 34, "type": "System.Data.SqlClient.SqlException", "value": "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding." } ] }, "extra": { "Exception[1][HelpLink.BaseHelpUrl]": "http://go.microsoft.com/fwlink", "Exception[1][HelpLink.EvtID]": "-2", "Exception[1][HelpLink.EvtSrc]": "MSSQLServer", "Exception[1][HelpLink.LinkId]": "20476", "Exception[1][HelpLink.ProdName]": "Microsoft SQL Server", "Exception[1][HelpLink.ProdVer]": "13.00.4474", "client_ip": "10.0.51.20", "type": "futhark-gyfu-api-production" }, "fingerprint": [ "{{ default }}" ], "grouping_config": { "enhancements": "eJybzDhxY05qemJypZWRgaGlroGxrqHRBABbEwcC", "id": "legacy:2019-03-12" }, "hashes": [ "1afd604de85145390abc002e4d67b516", "061292edef4840781efe45deca71cec7" ], "key_id": "552648", "level": "fatal", "location": "C:\\projects\\dapper\\Dapper\\SqlMapper.Async.cs", "logentry": { "formatted": "Critical error while executing Executed InternalController.SyncIptvChannels" }, "logger": "", "message": "Critical error while executing Executed InternalController.SyncIptvChannels", "metadata": { "filename": "C:\\projects\\dapper\\Dapper\\SqlMapper.Async.cs", "function": "ExecuteImplAsync", "type": "System.Data.SqlClient.SqlException", "value": "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding." }, "modules": { "App_global.asax.zmtkzcb4": "0.0.0.0", "AutoMapper": "4.2.1.0", "Autofac": "3.5.0.0", "Autofac.Configuration": "3.3.0.0", "Autofac.Extras.Attributed": "3.3.0.0", "Autofac.Integration.Mef": "3.0.0.0", "Autofac.Integration.WebApi": "3.4.0.0", "AutofacSerilogIntegration": "1.0.0.0", "Dapper": "2.0.0.0", "DatabaseAccess.AttributeMapping": "1.0.1.2", "DatabaseAccess.ColumnMapping": "1.0.1.0", "Elasticsearch.Net": "7.0.0.0", "Futhark.Common.Cryptography": "1.0.4.0", "Futhark.Common.Serialization": "1.5.0.0", "Futhark.Common.Web": "1.1.0.2", "Futhark.Gyfu.Amazon": "2020.2.6.453", "Futhark.Gyfu.Api": "2020.2.6.453", "Futhark.Gyfu.Apple": "2020.2.6.453", "Futhark.Gyfu.Contracts": "2020.2.6.453", "Futhark.Gyfu.Data": "2020.2.6.453", "Futhark.Gyfu.Roku": "2020.2.6.453", "Futhark.Gyfu.Shared": "2020.2.6.453", "IP2LocationHelper": "1.0.1.0", "ISymWrapper": "4.0.0.0", "IdentityModel": "4.1.0.0", "JetBrains.Annotations": "10.4.0.0", "Microsoft.Build.Utilities.v4.0": "4.0.0.0", "Microsoft.CSharp": "4.0.0.0", "Microsoft.IdentityModel.Logging": "1.1.2.0", "Microsoft.IdentityModel.Tokens": "5.1.2.0", "Microsoft.JScript": "10.0.0.0", "Microsoft.Web.Infrastructure": "1.0.0.0", "Microsoft.Win32.Primitives": "4.0.0.0", "MsgPack": "1.0.0.0", "Nest": "7.0.0.0", "NetVips": "1.1.0.0", "NewRelic.Agent.Core": "8.22.181.0", "NewRelic.Agent.Extensions": "8.22.181.0", "NewRelic.Api.Agent": "8.15.455.0", "NewRelic.Core": "8.22.181.0", "NewRelic.Parsing": "8.22.181.0", "NewRelic.Providers.Storage.AsyncLocal": "8.22.181.0", "NewRelic.Providers.Storage.CallContext": "8.22.181.0", "NewRelic.Providers.Storage.HttpContext": "8.22.181.0", "NewRelic.Providers.Storage.OperationContext": "8.22.181.0", "NewRelic.Providers.Wrapper.Asp35": "8.22.181.0", "NewRelic.Providers.Wrapper.CastleMonoRail2": "8.22.181.0", "NewRelic.Providers.Wrapper.Couchbase": "8.22.181.0", "NewRelic.Providers.Wrapper.HttpClient": "8.22.181.0", "NewRelic.Providers.Wrapper.HttpWebRequest": "8.22.181.0", "NewRelic.Providers.Wrapper.MongoDb": "8.22.181.0", "NewRelic.Providers.Wrapper.MongoDb26": "8.22.181.0", "NewRelic.Providers.Wrapper.Msmq": "8.22.181.0", "NewRelic.Providers.Wrapper.Mvc3": "8.22.181.0", "NewRelic.Providers.Wrapper.NServiceBus": "8.22.181.0", "NewRelic.Providers.Wrapper.OpenRasta": "8.22.181.0", "NewRelic.Providers.Wrapper.RabbitMq": "8.22.181.0", "NewRelic.Providers.Wrapper.RestSharp": "8.22.181.0", "NewRelic.Providers.Wrapper.ScriptHandlerFactory": "8.22.181.0", "NewRelic.Providers.Wrapper.ServiceStackRedis": "8.22.181.0", "NewRelic.Providers.Wrapper.Sql": "8.22.181.0", "NewRelic.Providers.Wrapper.StackExchangeRedis": "8.22.181.0", "NewRelic.Providers.Wrapper.Wcf3": "8.22.181.0", "NewRelic.Providers.Wrapper.WebApi1": "8.22.181.0", "NewRelic.Providers.Wrapper.WebApi2": "8.22.181.0", "NewRelic.Providers.Wrapper.WebOptimization": "8.22.181.0", "NewRelic.Providers.Wrapper.WebServices": "8.22.181.0", "Newtonsoft.Json": "12.0.0.0", "Pipelines.Sockets.Unofficial": "1.0.0.0", "Refit": "4.4.0.0", "RestSharp": "105.2.3.0", "SMDiagnostics": "4.0.0.0", "Sentry": "2.0.1.0", "Sentry.PlatformAbstractions": "1.1.0.0", "Sentry.Protocol": "2.0.0.0", "Sentry.Serilog": "2.0.1.0", "Serilog": "2.0.0.0", "Serilog.Formatting.Compact": "1.0.0.0", "Serilog.Formatting.Elasticsearch": "0.0.0.0", "Serilog.Sinks.Async": "1.4.0.0", "Serilog.Sinks.Elasticsearch": "8.0.1.0", "Serilog.Sinks.File": "2.0.0.0", "Serilog.Sinks.PeriodicBatching": "2.0.0.0", "SparkPost": "1.14.0.25860", "StackExchange.Redis": "2.0.0.0", "Swashbuckle.Core": "1.0.0.0", "System": "4.0.0.0", "System.AppContext": "4.0.0.0", "System.Buffers": "4.0.3.0", "System.Collections": "4.0.0.0", "System.Collections.Concurrent": "4.0.0.0", "System.Collections.Immutable": "1.2.3.0", "System.Collections.NonGeneric": "4.0.0.0", "System.Collections.Specialized": "4.0.0.0", "System.ComponentModel": "4.0.0.0", "System.ComponentModel.DataAnnotations": "4.0.0.0", "System.ComponentModel.EventBasedAsync": "4.0.0.0", "System.ComponentModel.Primitives": "4.0.0.0", "System.ComponentModel.TypeConverter": "4.0.0.0", "System.Configuration": "4.0.0.0", "System.Console": "4.0.0.0", "System.Core": "4.0.0.0", "System.Data": "4.0.0.0", "System.Data.Common": "4.2.0.0", "System.Diagnostics.Contracts": "4.0.0.0", "System.Diagnostics.Debug": "4.0.0.0", "System.Diagnostics.DiagnosticSource": "4.0.3.1", "System.Diagnostics.FileVersionInfo": "4.0.0.0", "System.Diagnostics.PerformanceCounter": "4.0.0.0", "System.Diagnostics.Process": "4.0.0.0", "System.Diagnostics.StackTrace": "4.1.0.0", "System.Diagnostics.TextWriterTraceListener": "4.0.0.0", "System.Diagnostics.Tools": "4.0.0.0", "System.Diagnostics.TraceSource": "4.0.0.0", "System.Diagnostics.Tracing": "4.2.0.0", "System.Drawing": "4.0.0.0", "System.Drawing.Primitives": "4.0.0.0", "System.Dynamic": "4.0.0.0", "System.Dynamic.Runtime": "4.0.0.0", "System.EnterpriseServices": "4.0.0.0", "System.Globalization": "4.0.0.0", "System.Globalization.Calendars": "4.0.0.0", "System.Globalization.Extensions": "4.1.0.0", "System.IO": "4.0.0.0", "System.IO.Compression": "4.2.0.0", "System.IO.Compression.ZipFile": "4.0.3.0", "System.IO.FileSystem": "4.0.0.0", "System.IO.FileSystem.DriveInfo": "4.0.0.0", "System.IO.FileSystem.Primitives": "4.0.0.0", "System.IO.FileSystem.Watcher": "4.0.0.0", "System.IO.IsolatedStorage": "4.0.0.0", "System.IO.MemoryMappedFiles": "4.0.0.0", "System.IO.Pipelines": "4.0.0.0", "System.IO.Pipes": "4.0.0.0", "System.IO.UnmanagedMemoryStream": "4.0.0.0", "System.IdentityModel.Tokens.Jwt": "5.1.2.0", "System.Linq": "4.0.0.0", "System.Linq.Expressions": "4.0.0.0", "System.Linq.Parallel": "4.0.0.0", "System.Linq.Queryable": "4.0.0.0", "System.Management": "4.0.0.0", "System.Memory": "4.0.1.1", "System.Net.Http": "4.2.0.0", "System.Net.Http.Formatting": "5.2.7.0", "System.Net.IPNetwork": "2.0.3.0", "System.Net.NameResolution": "4.0.0.0", "System.Net.NetworkInformation": "4.0.0.0", "System.Net.Ping": "4.0.0.0", "System.Net.Primitives": "4.0.0.0", "System.Net.Requests": "4.0.0.0", "System.Net.Security": "4.0.0.0", "System.Net.Sockets": "4.2.0.0", "System.Net.WebHeaderCollection": "4.0.0.0", "System.Net.WebSockets": "4.0.0.0", "System.Net.WebSockets.Client": "4.0.0.0", "System.Numerics": "4.0.0.0", "System.Numerics.Vectors": "4.1.3.0", "System.ObjectModel": "4.0.0.0", "System.Reflection": "4.0.0.0", "System.Reflection.Extensions": "4.0.0.0", "System.Reflection.Primitives": "4.0.0.0", "System.Resources.Reader": "4.0.0.0", "System.Resources.ResourceManager": "4.0.0.0", "System.Resources.Writer": "4.0.0.0", "System.Runtime": "4.0.0.0", "System.Runtime.Caching": "4.0.0.0", "System.Runtime.CompilerServices.Unsafe": "4.0.4.1", "System.Runtime.CompilerServices.VisualC": "4.0.0.0", "System.Runtime.Extensions": "4.0.0.0", "System.Runtime.Handles": "4.0.0.0", "System.Runtime.InteropServices": "4.0.0.0", "System.Runtime.InteropServices.RuntimeInformation": "4.0.0.0", "System.Runtime.Numerics": "4.0.0.0", "System.Runtime.Serialization": "4.0.0.0", "System.Runtime.Serialization.Formatters": "4.0.0.0", "System.Runtime.Serialization.Json": "4.0.0.0", "System.Runtime.Serialization.Primitives": "4.2.0.0", "System.Runtime.Serialization.Xml": "4.0.0.0", "System.Security.Claims": "4.0.0.0", "System.Security.Cryptography.Algorithms": "4.3.0.0", "System.Security.Cryptography.Csp": "4.0.0.0", "System.Security.Cryptography.Encoding": "4.0.0.0", "System.Security.Cryptography.Primitives": "4.0.0.0", "System.Security.Cryptography.X509Certificates": "4.0.0.0", "System.Security.Principal": "4.0.0.0", "System.Security.SecureString": "4.1.0.0", "System.ServiceModel": "4.0.0.0", "System.ServiceModel.Activation": "4.0.0.0", "System.ServiceModel.Internals": "4.0.0.0", "System.Text.Encoding": "4.0.0.0", "System.Text.Encoding.Extensions": "4.0.0.0", "System.Text.Encodings.Web": "4.0.3.0", "System.Text.RegularExpressions": "4.0.0.0", "System.Threading": "4.0.0.0", "System.Threading.Channels": "4.0.0.0", "System.Threading.Overlapped": "4.1.0.0", "System.Threading.Tasks": "4.0.0.0", "System.Threading.Tasks.Extensions": "4.2.0.0", "System.Threading.Tasks.Parallel": "4.0.0.0", "System.Threading.Thread": "4.0.0.0", "System.Threading.ThreadPool": "4.0.0.0", "System.Threading.Timer": "4.0.0.0", "System.Transactions": "4.0.0.0", "System.ValueTuple": "4.0.0.0", "System.Web": "4.0.0.0", "System.Web.Extensions": "4.0.0.0", "System.Web.Http": "5.2.7.0", "System.Web.Http.WebHost": "5.2.7.0", "System.Xml": "4.0.0.0", "System.Xml.Linq": "4.0.0.0", "System.Xml.ReaderWriter": "4.0.0.0", "System.Xml.XDocument": "4.0.0.0", "System.Xml.XPath": "4.0.0.0", "System.Xml.XPath.XDocument": "4.1.0.0", "System.Xml.XmlDocument": "4.0.0.0", "System.Xml.XmlSerializer": "4.0.0.0", "Twilio": "5.32.0.0", "VMedia.Common.Messaging.Sms": "1.0.0.0", "VMedia.IP2Location": "1.0.0.0", "VMedia.Logging.Common": "1.0.0.0", "VMedia.NPAS.Contracts": "1.0.3.0", "WebActivatorEx": "2.0.0.0", "mscorlib": "4.0.0.0", "netstandard": "2.0.0.0" }, "platform": "csharp", "project": 1075569, "received": 1581015839.342126, "release": "2020.2.6.453", "request": { "headers": [ [ "Accept", "application/json, application/xml, text/json, text/x-json, text/javascript, text/xml" ], [ "Accept-Encoding", "gzip, deflate" ], [ "Content-Length", "25" ], [ "Content-Type", "application/json" ], [ "Host", "10.0.51.20:8080" ], [ "User-Agent", "RestSharp/106.3.1.0" ], [ "X-NewRelic-ID", "VQ4CUlZUABAJXVlQDggCUg==" ], [ "X-NewRelic-Transaction", "PxQDViInDgtzIiVXdnJ1ViEEFB8EBw8RVU4aVg98cAQLJn8lBCBwIFRzAkNKQQ1QVVBXVgIGFTs=" ], [ "X-ORIGINAL-URL", "/api/internal/synciptvchannels" ], [ "X-REWRITE-URL", "/api/internal/synciptvchannels" ] ], "inferred_content_type": "application/json", "method": "POST", "url": "/api/internal/synciptvchannels" }, "sdk": { "name": "sentry.dotnet.serilog", "packages": [ { "name": "nuget:Sentry", "version": "2.0.1" }, { "name": "nuget:Sentry.Serilog", "version": "2.0.1" } ], "version": "2.0.1" }, "tags": [ [ "environment", "production" ], [ "level", "fatal" ], [ "release", "2020.2.6.453" ], [ "user", "ip:10.0.51.20" ], [ "server-os", "Windows 6.3.9600" ], [ "server-os.name", "Windows" ], [ "server-runtime", ".NET Framework 4.7.1" ], [ "server-runtime.name", ".NET Framework" ], [ "server_name", "WIN-2SNUH7GO6F3" ], [ "url", "/api/internal/synciptvchannels" ] ], "timestamp": 1581015839.342126, "title": "System.Data.SqlClient.SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or th...", "type": "error", "user": { "data": { "other": { "IsAuthenticated": "[Filtered]" } }, "ip_address": "10.0.51.20" }, "version": "7" } ```
bruno-garcia commented 4 years ago

Thanks for sharing the event @olsh . I'm not sure why the timestamp is getting errored. Does it happen with all your events? I wonder if it's a event normalization regression on the backend or something with SDK event serialization or else. I dogfood the SDK with a couple of projects and those are not erroring with the timestamp at all.

If you're willing to contribute it would be great! feel free to open a draft PR with any sketch, we can collaborate on the idea etc. I believe it would be a new package Sentry.AspNet.WebApi, what do you think?

Ideally Web API 2 and 1 but the least would be 2 since most apps are there I believe are on 2.0.

olsh commented 4 years ago

I get the error for all events in the project.

I believe it would be a new package Sentry.AspNet.WebApi, what do you think?

Yes, probably, you're right, I'll try to find time for the contribution. Sorry for misleading, we don't use OWIN, we use bare Web.API 2.

Not sure, but probably the issue is related to our Web.API serialization configuration

            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
            };
bruno-garcia commented 4 years ago

oh that would explain it. Strange because we ping the settings we use:

https://github.com/getsentry/sentry-dotnet/blob/b150d25e2b9250d1b09c92fac6a0101099dfeb61/src/Sentry/Internal/JsonSerializer.cs#L9-L16

olsh commented 4 years ago

Well, I manage to reproduce the issue with the error.

  1. Create a default Web API2 project with the following WebApiApplication class
    public class WebApiApplication : HttpApplication
    {
        protected void Application_Start()
        {
            SentrySdk.Init("dsn");

            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
                                                    {
                                                        DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
                                                    };

            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
    }
  1. Add an empty API controller with an action

        public void Post([FromBody]string value)
        {
            try
            {
                throw new InvalidOperationException("Post");
            }
            catch (Exception e)
            {
                SentrySdk.CaptureException(e);
            }
        }
  2. Run the curl command curl http://localhost:4839/api/default/post -d "'my payload'" -H "Content-Type: application/json"

P.S. it seems like the body capturing and the timestamp error are unrelated. The body is not captured even if I don't use MicrosoftDateFormat.

bruno-garcia commented 4 years ago

Yeah we don't support HTTP extraction for Web API projects yet. But you mentioned you get Headers? Oh and it's not OWIN?

So it's System.Web, we get the headers here.

Did you configure it to extract values?

https://github.com/getsentry/sentry-dotnet/blob/b150d25e2b9250d1b09c92fac6a0101099dfeb61/src/Sentry/SentryOptions.cs#L340

This is an opt-in.

bruno-garcia commented 4 years ago

With regards to the JSON configuration, it's just unfortunate that this static DefaultSettings affects the serializer the SDK uses even though it passes explicit configuration to it.

Is it possible to configure Web API JSON settings via some instance base settings object? As opposed to this static global configuration?

olsh commented 4 years ago

Hi @bruno-garcia,

Thanks for pointing me out. Indeed, I need to set RequestSize.Always for MaxRequestBodySize. The old Raven SDK captured the body by default, so I missed this. Updated the issue title.

bruno-garcia commented 4 years ago

2.0.2 is out with this fix: https://github.com/getsentry/sentry-dotnet/releases/tag/2.0.2