Xabaril / AspNetCore.Diagnostics.HealthChecks

Enterprise HealthChecks for ASP.NET Core Diagnostics Package
Apache License 2.0
4k stars 780 forks source link

HealthCheck UI SQLite Error #411

Closed IsaacWalker closed 4 years ago

IsaacWalker commented 4 years ago

Howdy,

I'm trying to add a the UI to the health checks in an Asp.Net Core 3.1 Project, and I'm running into this error: image

Which, when viewed in the browser console:

image

...and following the 500 error gives:

image

I'm certain that its not the Health Checks causing the issue as they work independently, at /health.

The health checks are configured as follows: ConfigureServices:

            //adding health check services to container
            services.AddHealthChecks()
            .AddCheck<PrinterHealthCheck>(nameof(PrinterHealthCheck))
            .AddCheck<SchedulerHealthCheck>(nameof(SchedulerHealthCheck));

            services.AddHealthChecksUI("healthchecksdb", setupSettings: options => 
            {
                options.AddHealthCheckEndpoint("Health Check Endpoint", "http://localhost:62397/health");
            });

Configure:

            app.UseHealthChecks("/health", new HealthCheckOptions()
            {
                ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
            });

            app.UseHealthChecksUI(options =>
                 options.UIPath = "/health-ui"
            );

Any ideas what could be causing this error with the SQLite database?

unaizorrilla commented 4 years ago

Hi,

Can you share with us more info? A repro project?

Is like some exception with sqlite when evaluate the health checks! Can you try sample projects, UIandApi is like you are trying to do!

IsaacWalker commented 4 years ago

Okay I think I found the culprit, you should be able to reproduce it by adding the following reference: ``

`` This of course has a further dependency on Microsoft.EntityFrameworkCore.InMemory v3.1.1. Now, changing it to the version used in HealthCheck.UI (3.0.0) fixes the problem, and is using that version of EF is fine for what I'm doing.

Moving forward now would be to ensure that the current version of HealthChecks.UI is compatible with the newest version of EFCore.

CarlosLanderas commented 4 years ago

@IsaacWalker your code shows custom healthchecks (Printerhealthcheck, schedulerHealthcheck) As Unai suggested, we would need to see some code or repro project to help you.

As 30 days has passed we temporaly close the issue. Feel free to open it if you need more help