Open Closed

auth problem when deploying on linux #813


User avatar
0
hiengine created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v4.0.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace:23:55:39 ERR] Exception occurred while processing message.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden. For more details, see [https://aka.ms/IdentityModel/PII](https://aka.ms/IdentityModel/PII).]'.
   at Microsoft.IdentityModel.Protocols.ConfigurationManager\`1.GetConfigurationAsync(CancellationToken cancel)
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler\`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c\_\_DisplayClass0\_0.<\<UseJwtTokenMiddleware>b\_\_0>d.MoveNext()
\-\-\- End of stack trace from previous location where exception was thrown \-\-\-
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft\.AspNetCore\.Diagnostics\.ExceptionHandlerMiddleware\.\<Invoke\>g\_\_Awaited\|6\_0\(ExceptionHandlerMiddleware middleware\, HttpContext context\, Task task\)
[23:55:39 ERR] An unhandled exception has occurred while executing the request.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden. For more details, see [https://aka.ms/IdentityModel/PII](https://aka.ms/IdentityModel/PII).]'.
   at Microsoft.IdentityModel.Protocols.ConfigurationManager\`1.GetConfigurationAsync(CancellationToken cancel)
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler\`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c\_\_DisplayClass0\_0.<\<UseJwtTokenMiddleware>b\_\_0>d.MoveNext()
\-\-\- End of stack trace from previous location where exception was thrown \-\-\-
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft\.AspNetCore\.Diagnostics\.ExceptionHandlerMiddleware\.\<Invoke\>g\_\_Awaited\|6\_0\(ExceptionHandlerMiddleware middleware\, HttpContext context\, Task task\)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
   at Microsoft\.AspNetCore\.Diagnostics\.ExceptionHandlerMiddleware\.\<Invoke\>g\_\_Awaited\|6\_0\(ExceptionHandlerMiddleware middleware\, HttpContext context\, Task task\)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c\_\_DisplayClass5\_1.<\<UseMiddlewareInterface>b\_\_1>d.MoveNext()
\-\-\- End of stack trace from previous location where exception was thrown \-\-\-
   at Microsoft\.AspNetCore\.Server\.Kestrel\.Core\.Internal\.Http\.HttpProtocol\.ProcessRequests\[TContext\]\(IHttpApplication\`1 application\)
[23:55:39 INF] CORS policy execution successful.
[23:55:39 ERR] An exception was thrown attempting to execute the error handler.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden. For more details, see [https://aka.ms/IdentityModel/PII](https://aka.ms/IdentityModel/PII).]'.
   at Microsoft.IdentityModel.Protocols.ConfigurationManager\`1.GetConfigurationAsync(CancellationToken cancel)
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler\`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.&lt;&gt;c\_\_DisplayClass0\_0.&lt;\&lt;UseJwtTokenMiddleware&gt;b\_\_0>d.MoveNext()
\-\-\- End of stack trace from previous location where exception was thrown \-\-\-
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft\.AspNetCore\.Diagnostics\.ExceptionHandlerMiddleware\.\&lt;Invoke\&gt;g\_\_Awaited\|6\_0\(ExceptionHandlerMiddleware middleware\, HttpContext context\, Task task\)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
   at Microsoft\.AspNetCore\.Diagnostics\.ExceptionHandlerMiddleware\.\&lt;Invoke\&gt;g\_\_Awaited\|6\_0\(ExceptionHandlerMiddleware middleware\, HttpContext context\, Task task\)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.&lt;&gt;c\_\_DisplayClass5\_1.&lt;\&lt;UseMiddlewareInterface&gt;b\_\_1>d.MoveNext()
\-\-\- End of stack trace from previous location where exception was thrown \-\-\-
   at Microsoft\.AspNetCore\.Server\.Kestrel\.Core\.Internal\.Http\.HttpProtocol\.ProcessRequests\[TContext\]\(IHttpApplication\`1 application\)
[23:55:39 ERR] Connection id "0HM5QV2GUOI5A", Request id "0HM5QV2GUOI5A:00000007": An unhandled exception was thrown by the application.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden. For more details, see [https://aka.ms/IdentityModel/PII](https://aka.ms/IdentityModel/PII).]'.
   at Microsoft.IdentityModel.Protocols.ConfigurationManager\`1.GetConfigurationAsync(CancellationToken cancel)
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationHandler\`1.AuthenticateAsync()
   at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
   at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c\_\_DisplayClass0\_0.<\<UseJwtTokenMiddleware>b\_\_0>d.MoveNext()
\-\-\- End of stack trace from previous location where exception was thrown \-\-\-
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft\.AspNetCore\.Diagnostics\.ExceptionHandlerMiddleware\.\<Invoke\>g\_\_Awaited\|6\_0\(ExceptionHandlerMiddleware middleware\, HttpContext context\, Task task\)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
   at Microsoft\.AspNetCore\.Diagnostics\.ExceptionHandlerMiddleware\.\<Invoke\>g\_\_Awaited\|6\_0\(ExceptionHandlerMiddleware middleware\, HttpContext context\, Task task\)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c\_\_DisplayClass5\_1.<\<UseMiddlewareInterface>b\_\_1>d.MoveNext()
\-\-\- End of stack trace from previous location where exception was thrown \-\-\-
   at Microsoft\.AspNetCore\.Server\.Kestrel\.Core\.Internal\.Http\.HttpProtocol\.ProcessRequests\[TContext\]\(IHttpApplication\`1 application\)
  • Steps to reproduce the issue:
  • publish to linux platform dotnet publish --framework netcoreapp3.1 --runtime linux-x64 --self-contained true
  • copy to linux and running using : ./abpDemo.HttpApi.Host --urls="https://*:9905"
  • angular web use localhost:4200 jump to the login page, but when jump back the page show 500 error: 
  • the chrome console show get configuration error

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Please check application logs, such as API, Identity Server website.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11