datalust / seq-tickets

Issues, design discussions and feature roadmap for the Seq log server
https://datalust.co/seq
98 stars 5 forks source link

An unhandled error occurred while serving the request #2304

Open VyacheslavPritykin opened 3 weeks ago

VyacheslavPritykin commented 3 weeks ago

When I click on signals, I occasionally receive the banner "An unhandled error occurred while serving the request." It does not affect the logs' output, so it's more like a visual noise.

CleanShot 2024-11-01 at 01 00 08@2x

[14:48:41 ERR] HTTP PUT /api/workspaces/workspace-54 responded 500 in 1.0745 ms System.InvalidOperationException: Id Seq.Data.Dashboarding.Dashboard does not refer to a Seq.Data.Dashboarding.Dashboard. at Quince.TypesafeDocumentSession.CheckStronglyTypedId[TDocument](String id) at Quince.TypesafeDocumentSession.TryLoad[TDocument](String id, TDocument& document) at Seq.Server.Web.Api.WorkspacesController.b16_1[TDocument](String id) at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Collections.Generic.HashSet1.UnionWith(IEnumerable1 other) at System.Collections.Generic.HashSet1..ctor(IEnumerable1 collection, IEqualityComparer1 comparer) at Seq.Server.Web.Api.WorkspacesController.NormalizeContent[TDocument](List1 contentDocumentIds) at Seq.Server.Web.Api.WorkspacesController.ToExistingDocument(WorkspaceEntity entity, Workspace document) at Seq.Server.Web.EntityResourceController2.UpdateEntity(String id) at lambda_method1460(Closure, Object, Object[]) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Seq.Server.Web.Middleware.WebSocketAcceptMiddleware.Invoke(HttpContext context) at Seq.Server.Web.Middleware.RequestAuthenticationMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Seq.Server.Web.Middleware.ServerStatusMiddleware.Invoke(HttpContext context) at Seq.Server.Web.Middleware.UniversalHeadersMiddleware.Invoke(HttpContext context) at Seq.Server.Web.Middleware.RequestCompletionMiddleware.Invoke(HttpContext httpContext)

nblumhardt commented 3 weeks ago

Hi Vyacheslav, thanks for your message.

We think this is due to a bug in an earlier Seq version (perhaps a year or two old?) causing an invalid dashboard id to be recorded in your personal workspace.

The quick fix should be to go to your user avatar, click Workspaces, and then find and delete the Personal workspace.

You can re-create this through the same screen, and populate incrementally as you find and select signals in the signal bar.

If you're on a Seq instance without a large number of signals etc. present, then not having a Personal workspace is also fine - you'll see all available signals/dashboards etc. on every screen.

Hope this helps, Nick

VyacheslavPritykin commented 3 weeks ago

This Seq instance was installed last month, using the version that was current at that time

nblumhardt commented 3 weeks ago

Thanks for the info, we'll take a closer look 👍

VyacheslavPritykin commented 3 weeks ago

More details:

GET /api/users/current

CleanShot 2024-11-01 at 02 44 28@2x

GET /api/workspaces/workspace-54 CleanShot 2024-11-01 at 02 48 40@2x

When I click on a signal: PUT /api/workspaces/workspace-54?version=1 CleanShot 2024-11-01 at 02 50 21@2x

xantari commented 2 weeks ago

I'm also getting this same error. Using Entra auth for Seq. This occurs when we make different signal selections and the dashboard tries to auto-save your preferences.

Seq Version: 2024.3.12680

xantari commented 2 weeks ago

Update: Deleting the personal workspace and recreating it does fix the issue as a work around.

VyacheslavPritykin commented 2 weeks ago

@nblumhardt, should I keep my workspace intact for now if you need more information?

nblumhardt commented 2 weeks ago

Deleting the workspace now is fine, we should have enough information here to work with - thanks very much for all of the investigation 👍