8000 Causing the null reference exception · Issue #1 · mberrishdev/HubDocs · GitHub
[go: up one dir, main page]

Skip to content

Causing the null reference exception #1

@WellitonToledo

Description

@WellitonToledo
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HNJFUM7ILILQ", Request id "0HNJFUM7ILILQ:00000001": An unhandled exception was thrown by the application.
      System.NullReferenceException: Object reference not set to an instance of an object.
         at HubDocs.Extensions.<>c.<DiscoverSignalRHubs>b__2_3(HubMetadata h)
         at System.Linq.Enumerable.IEnumerableWhereIterator`1.MoveNext()
         at System.Linq.Enumerable.DistinctByIterator[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)+MoveNext()
         at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter`2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
         at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
         at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
         at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(PipeWriter pipeWriter, T rootValue, Int32 flushThreshold, CancellationToken cancellationToken, Object rootValueBoxed)
         at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(PipeWriter pipeWriter, T rootValue, Int32 flushThreshold, CancellationToken cancellationToken, Object rootValueBoxed)
         at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(PipeWriter pipeWriter, T rootValue, Int32 flushThreshold, CancellationToken cancellationToken, Object rootValueBoxed)
         at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(PipeWriter pipeWriter, T rootValue, Int32 flushThreshold, CancellationToken cancellationToken, Object rootValueBoxed)
         at Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsyncSlow[TValue](PipeWriter body, TValue value, JsonSerializerOptions options, CancellationToken cancellationToken)
         at Microsoft.AspNetCore.Http.RequestDelegateFactory.ExecuteResultWriteResponse(IResult result, HttpContext httpContext)
         at Sentry.AspNetCore.SentryTracingMiddleware.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
         at Actuar.Auth.AspNetCore.Middlewares.AfterAuthenticationMiddleware.InvokeAsync(HttpContext httpContext, AuthContext authContext)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Toletus.AccessEdgeManager.API.Extensions.SentryExtensions2.<>c.<<UseSentryConfiguration2>b__1_0>d.MoveNext() in /src/src/Toletus.AccessEdgeManager.API/Extensions/SentryExtensions2.cs:line 105
      --- End of stack trace from previous location ---
         at Sentry.AspNetCore.SentryMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
         at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

#AI Assistant:

I can see a NullReferenceException occurring in HubDocs.Extensions at the DiscoverSignalRHubs method. Let me investigate the issue.
Searching project files for 'DiscoverSignalRHubs'
Searching for 'DiscoverSignalRHubs'
Searching for 'HubDocs'
Searching for 'HubDocs'
The issue is occurring in the HubDocs NuGet package (version 0.0.6) when it tries to discover SignalR hubs. The NullReferenceException happens at line b__2_3(HubMetadata h), suggesting that some metadata property is null.
The error occurs when accessing the /hubs/edge-realtime endpoint or when HubDocs tries to generate documentation for your SignalR hubs.
The fix: Upgrade the HubDocs package to a newer version or temporarily remove it if it's not critical.
Reading Toletus.AccessEdgeManager.API.csproj
The HubDocs package (version 0.0.6) is causing the null reference exception. This is likely a bug in that specific version where it doesn't handle null metadata properly when discovering SignalR hubs.

--

First of all, thank you for your project. I'm experiencing this issue in a .NET 10 project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0