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

src/installation/elsa-studio/ElsaStudioBlazorServer sample does crash at login #40

Open
GWeidmann opened this issue Jan 15, 2024 · 0 comments

Comments

@GWeidmann
Copy link

When I download the sample and do want to run it, it doesn't work:

First, the Elsa.Api.Client nuget is missing from the sample. I can add this myself, no problem.

Second, no that the project builds and the login page appears, I can input admin and password. But then the blazor ui crashes with a HttpRequestException.

System.Net.Http.HttpRequestException: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte. (localhost:5001)
 ---> System.Net.Sockets.SocketException (10061): Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionAsync(Boolean async, CancellationToken requestCancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Refit.RequestBuilderImplementation.<>c__DisplayClass14_0`2.<<BuildCancellableTaskFuncForMethod>b__0>d.MoveNext() in /_/Refit/RequestBuilderImplementation.cs:line 256
--- End of stack trace from previous location ---
   at Elsa.Studio.Login.Services.DefaultCredentialsValidator.ValidateCredentialsAsync(String username, String password, CancellationToken cancellationToken)
   at Elsa.Studio.Login.Pages.Login.Login.ValidateCredentials(String username, String password)
   at Elsa.Studio.Login.Pages.Login.Login.TryLogin()
   at Elsa.Studio.Components.StudioComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Elsa.Studio.Components.StudioComponentBase.InvokeWithBlazorServiceContext(Func`1 func)
   at Microsoft.AspNetCore.Components.Forms.EditForm.HandleSubmitAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'PdOc5BnTLF9Q39X-OOnbleQxTZiIJasl0hI1wIr6oGk'.

This is probably, because the appsettings.json points to https://localhost:5001/elsa/api as backend while the server runs on "applicationUrl": "https://localhost:53214;http://localhost:53215".

I can also change this to point to the right endpoint

Third, now that appsettings point to the app url, if I try to login again, I get this error:

Refit.ApiException: Response status code does not indicate success: 400 (Bad Request).
   at Refit.RequestBuilderImplementation.<>c__DisplayClass14_0`2.<<BuildCancellableTaskFuncForMethod>b__0>d.MoveNext() in /_/Refit/RequestBuilderImplementation.cs:line 288
--- End of stack trace from previous location ---
   at Elsa.Studio.Login.Services.DefaultCredentialsValidator.ValidateCredentialsAsync(String username, String password, CancellationToken cancellationToken)
   at Elsa.Studio.Login.Pages.Login.Login.ValidateCredentials(String username, String password)
   at Elsa.Studio.Login.Pages.Login.Login.TryLogin()
   at Elsa.Studio.Components.StudioComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Elsa.Studio.Components.StudioComponentBase.InvokeWithBlazorServiceContext(Func`1 func)
   at Microsoft.AspNetCore.Components.Forms.EditForm.HandleSubmitAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'd6-nJm9fFXPt3LK-GaQ0Io24RKX-OsV2eQ8qcVJa0gQ'.

I have also tried to copy the code directly from the docs, but same result.

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