System.Net.Sockets.SocketException thrown by sentry with virtually no information #1962
-
I recently set up Sentry on two different ASP.NET 6 micro-services, but while setting it up, I get the following exception spammed into Sentry about once every 5 minutes, sometimes longer and I have not been able to reproduce this outside my kubernetes cluster. I ran the same container image locally for an hour and ran the code directly from Rider, it still never produced the exception outlined below. The stack trace also does not originate from my code base not does it give any clues as to what the heck it means. I would raise a bug report but there is no way to reproduce. Links to sentry errors Exception
Logs
Related Code public static class Program
{
public static IHostBuilder CreateHost() => new HostBuilder()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseDefaultServiceProvider((context, options) =>
{
bool isDevelopment = context.HostingEnvironment.IsDevelopment();
options.ValidateScopes = isDevelopment;
options.ValidateOnBuild = isDevelopment;
})
.UseRgsp1Configuration()
.UseRgsp1Logging() // Adds logging stuff, I don't have Sentry's logging thing setup here
.ConfigureServices((context, collection) =>
{
// Global Services
// ...
collection.AddSentry();
// ...
});
public static IHostBuilder CreateWebHost() => CreateHost()
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseSentry(o =>
{
o.Dsn = "DNS Here";
o.TracesSampleRate = 1.0;
// Debug is set to true in the config files
// Log Level is also set to Verbose so I can see everything
});
});
// This function is called by "void Main(string[] args);" so just assume this is entry point
private static Task Serve(ServeOptions serveOptions, string[] args)
{
CreateWebHost().Build().Run();
return Task.CompletedTask;
}
// ...
}
// ...
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseSentryTracing();
app.UseCors(CorsConstants.Rgsp1CorsPolicy);
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
}
// ... |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
I do note that the logs also say However I can't find any tasks (That run on a timer since this bug has no trigger, and is periodic) that don't get handled wrong. I could however be wrong. That said, I suspect this may be something inside Sentry that fails for some reason |
Beta Was this translation helpful? Give feedback.
-
The message in the logs indicate that the exception was caught on the Hard to tell exactly without seeing your source code, but here are some pointers: https://stackoverflow.com/a/42675271/634824 This one's older, on blocking TPL waits, but same idea: https://stackoverflow.com/a/7883083/634824 |
Beta Was this translation helpful? Give feedback.
-
are you using net6 with prometheus-net? Since that is not supported yet |
Beta Was this translation helpful? Give feedback.
-
i also note you are using a 4 year old version Pipelines.Sockets.Unofficial |
Beta Was this translation helpful? Give feedback.
-
also u r using out of date versions of both StackExchange.Redis RabbitMQ which both use sockets |
Beta Was this translation helpful? Give feedback.
-
also the bundling symbols from dependencies might also help https://github.com/SimonCropp/Cymbal |
Beta Was this translation helpful? Give feedback.
are you using net6 with prometheus-net? Since that is not supported yet
prometheus-net/prometheus-net#345