Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnsureUserSet error, User has not been set. #784

Open
jskorlol opened this issue Dec 1, 2023 · 0 comments
Open

EnsureUserSet error, User has not been set. #784

jskorlol opened this issue Dec 1, 2023 · 0 comments

Comments

@jskorlol
Copy link

jskorlol commented Dec 1, 2023

Describe the bug
When accessing /scripts/script-schedules and device-details/ad0feca9-7e34-4019-9a0b-0cde9f2f382e/remote-logs,
I encounter an authentication error. There are no issues with other parts of the application.

To Reproduce

System.InvalidOperationException: User has not been set.
   at Remotely.Server.Components.AuthComponentBase.EnsureUserSet() in C:\repos\Remotely\Server\Components\AuthComponentBase.cs:line 28
   at Remotely.Server.Components.Scripts.ScriptSchedules.get_CanModifySchedule() in C:\repos\Remotely\Server\Components\Scripts\ScriptSchedules.razor.cs:line 55

Remotely Version
Server (can be found on about page): 2023.09.11.1010
Agent (can be found in device card): 2023.09.11.1010

Expected Behavior
The feature itself does not work.

Screenshots
none.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome
  • Version 119.0.6045.199

Additional Context

2023-12-01 03:14:23.847 +00:00 [ERR] An unhandled exception has occurred while executing the request. { EventId: { Id: 1, Name: "UnhandledException" }, SourceContext: "Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware", RequestId: "0HMVI3EF3GJTP:00000001", RequestPath: "/scripts/script-schedules", ConnectionId: "0HMVI3EF3GJTP", ThreadId: 15 }
System.InvalidOperationException: User has not been set.
   at Remotely.Server.Components.AuthComponentBase.EnsureUserSet() in C:\repos\Remotely\Server\Components\AuthComponentBase.cs:line 28
   at Remotely.Server.Components.Scripts.ScriptSchedules.get_CanModifySchedule() in C:\repos\Remotely\Server\Components\Scripts\ScriptSchedules.razor.cs:line 55
   at Remotely.Server.Components.Scripts.ScriptSchedules.<BuildRenderTree>b__38_1(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
   at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.SetDirectParameters(ParameterView parameters)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderRootComponentAsync(Int32 componentId, ParameterView initialParameters)
   at Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.RenderComponentAsync(Type componentType, ParameterView initialParameters)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c__11`1.<<InvokeAsync>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.ViewFeatures.StaticComponentRenderer.PrerenderComponentAsync(ParameterView parameters, HttpContext httpContext, Type componentType)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.PrerenderedServerComponentAsync(HttpContext context, ServerComponentInvocationSequence invocationId, Type type, ParameterView parametersCollection)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.RenderComponentAsync(ViewContext viewContext, Type componentType, RenderMode renderMode, Object parameters)
   at Microsoft.AspNetCore.Mvc.TagHelpers.ComponentTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count)
   at Remotely.Server.Pages.Pages__Host.<>c__DisplayClass21_0.<<ExecuteAsync>b__1>d.MoveNext() in C:\repos\Remotely\Server\Pages\_Host.cshtml:line 61
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
   at Remotely.Server.Pages.Pages__Host.ExecuteAsync() in C:\repos\Remotely\Server\Pages\_Host.cshtml:line 13
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|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>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
2023-12-01 03:14:52.219 +00:00 [WRN] Unhandled exception rendering component: User has not been set. { EventId: { Id: 100, Name: "ExceptionRenderingComponent" }, SourceContext: "Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer", TransportConnectionId: "G6iOm4yN3ofTPGh4svTurw", RequestId: "0HMVI3EF3GJVR:00000001", RequestPath: "/_blazor", ConnectionId: "0HMVI3EF3GJVR", ThreadId: 23 }
System.InvalidOperationException: User has not been set.
   at Remotely.Server.Components.AuthComponentBase.EnsureUserSet() in C:\repos\Remotely\Server\Components\AuthComponentBase.cs:line 28
   at Remotely.Server.Components.Scripts.ScriptSchedules.get_CanModifySchedule() in C:\repos\Remotely\Server\Components\Scripts\ScriptSchedules.razor.cs:line 55
   at Remotely.Server.Components.Scripts.ScriptSchedules.<BuildRenderTree>b__38_1(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant