Hi @maliming,
After taking a closer look, I have found that same api is returning the 200 Ok response before login, But after login it started throwing 500 error.
Please have a look at attached image of headers. We can see that allow cors origin is not adding in header after login. Please help me.
Hello @maliming
2022-07-25 22:25:49.525 -07:00 [INF] Hosting environment: Production
2022-07-25 22:25:49.525 -07:00 [INF] Content root path: C:\inetpub\wwwroot
2022-07-25 22:25:49.559 -07:00 [ERR] GetHealthReport threw an exception when trying to get report from https://api.ubxcloud.net/health-status configured with name UBX_Client_Angular Health Status.
System.Net.Http.HttpRequestException: No such host is known. (api.ubxcloud.net:443)
---> System.Net.Sockets.SocketException (11001): No such host is known.
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|277_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(HttpRequestMessage request)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, 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 HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 96
2022-07-25 22:25:51.030 -07:00 [INF] CORS policy execution failed.
2022-07-25 22:25:51.030 -07:00 [INF] Request origin http://10.9.100.101 does not have permission to access the resource.
2022-07-25 22:25:51.450 -07:00 [INF] CORS policy execution successful.
2022-07-25 22:25:51.746 -07:00 [INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.DiscoveryEndpoint for /.well-known/openid-configuration
2022-07-25 22:25:52.209 -07:00 [INF] Request finished HTTP/2 GET https://api.ubxcloud.net/.well-known/openid-configuration - - - 200 - application/json;+charset=UTF-8 2786.4676ms
2022-07-25 22:25:52.487 -07:00 [INF] Request starting HTTP/2 GET https://api.ubxcloud.net/.well-known/openid-configuration/jwks - -
2022-07-25 22:25:52.491 -07:00 [INF] CORS policy execution failed.
2022-07-25 22:25:52.491 -07:00 [INF] Request origin http://10.9.100.101 does not have permission to access the resource.
2022-07-25 22:25:52.499 -07:00 [INF] CORS policy execution successful.
2022-07-25 22:25:52.514 -07:00 [INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.DiscoveryKeyEndpoint for /.well-known/openid-configuration/jwks
2022-07-25 22:25:52.527 -07:00 [INF] Request finished HTTP/2 GET https://api.ubxcloud.net/.well-known/openid-configuration/jwks - - - 200 - application/json;+charset=UTF-8 39.7694ms
2022-07-25 22:25:52.847 -07:00 [INF] Request starting HTTP/2 GET https://api.ubxcloud.net/api/abp/application-configuration - -
2022-07-25 22:25:52.848 -07:00 [INF] CORS policy execution failed.
2022-07-25 22:25:52.848 -07:00 [INF] Request origin http://10.9.100.101 does not have permission to access the resource.
2022-07-25 22:25:52.852 -07:00 [INF] No CORS policy found for the specified request.
2022-07-25 22:25:52.896 -07:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2022-07-25 22:25:52.914 -07:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync() on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).
2022-07-25 22:25:53.589 -07:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.
2022-07-25 22:25:53.626 -07:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 706.6509ms
2022-07-25 22:25:53.626 -07:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2022-07-25 22:25:54.193 -07:00 [INF] Request finished HTTP/2 GET https://api.ubxcloud.net/api/abp/application-configuration - - - 200 - application/json;+charset=utf-8 1345.9654ms
2022-07-25 22:25:59.852 -07:00 [INF] Start processing HTTP request GET "https://api.ubxcloud.net/health-status"
2022-07-25 22:25:59.852 -07:00 [INF] Sending HTTP request GET "https://api.ubxcloud.net/health-status"
2022-07-25 22:25:59.855 -07:00 [ERR] GetHealthReport threw an exception when trying to get report from https://api.ubxcloud.net/health-status configured with name UBX_Client_Angular Health Status.
System.Net.Http.HttpRequestException: No such host is known. (api.ubxcloud.net:443)
---> System.Net.Sockets.SocketException (11001): No such host is known.
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|277_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(HttpRequestMessage request)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, 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 HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 96
2022-07-25 22:25:59.860 -07:00 [INF] Notification is sent on same window time.
Hi,
You can check this: https://support.abp.io/QA/Questions/3327/#answer-51baf847-087a-2aa1-1d76-3a04d9420894
hi
This code is working for me.
Thank you
Hi
I can try this code
var healthChecksUiBuilder = services.AddHealthChecksUI(settings =>
{
settings.AddHealthCheckEndpoint("MyProjectName Health Status", "https://yourwebsite.com/health-status");
});
services.MapHealthChecksUiEndpoints(options =>
{
options.UIPath = "https://yourwebsite.com/health-ui";
options.ApiPath = "https://yourwebsite.com/health-api";
});
error:
2022-07-20 03:39:56.518 -07:00 [FTL] Application startup exception
Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module UBX_Client_Angular.UBX_Client_AngularHttpApiHostModule, UBX_Client_Angular.HttpApi.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: The value for customized path can't be null and need to start with / character. (Parameter 'ApiPath'). See the inner exception for details.
---> System.ArgumentException: The value for customized path can't be null and need to start with / character. (Parameter 'ApiPath')
at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.<>c.<EnsureValidApiOptions>b__1_0(String path, String argument) in /_/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs:line 63
at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.EnsureValidApiOptions(Options options) in /_/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs:line 59
at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.MapHealthChecksUI(IEndpointRouteBuilder builder, Action`1 setupOptions) in /_/src/HealthChecks.UI/Extensions/EndpointRouteBuilderExtensions.cs:line 17
at UBX_Client_Angular.HealthChecks.HealthChecksBuilderExtensions.<>c__DisplayClass2_0.<MapHealthChecksUiEndpoints>b__1(EndpointRouteBuilderContext endpointContext) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\HealthChecks\HealthChecksBuilderExtensions.cs:line 67
at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.<>c__DisplayClass0_0.<UseConfiguredEndpoints>b__0(IEndpointRouteBuilder endpoints)
at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.UseConfiguredEndpoints(IApplicationBuilder app, Action`1 additionalConfigurationAction)
at UBX_Client_Angular.UBX_Client_AngularHttpApiHostModule.OnApplicationInitialization(ApplicationInitializationContext context) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\UBX_Client_AngularHttpApiHostModule.cs:line 279
at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module)
at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)
--- End of inner exception stack trace ---
at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)
at Volo.Abp.AbpApplicationBase.InitializeModules()
at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider)
at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplication(IApplicationBuilder app)
at UBX_Client_Angular.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\Startup.cs:line 17
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Server.IIS.Core.IISServerSetupFilter.<>c__DisplayClass2_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at UBX_Client_Angular.Program.Main(String[] args) in D:\Projects\UBX\aspnet-core\src\UBX_Client_Angular.HttpApi.Host\Program.cs:line 32
thanks
hi,
I faced error
2022-07-20 02:52:34.184 -07:00 [ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name UBX_Client_Angular Health Status. System.InvalidOperationException: An invalid request URI was provided. Either the request URI must be an absolute URI or BaseAddress must be set. at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at System.Net.Http.HttpClient.GetAsync(Uri requestUri, HttpCompletionOption completionOption) at HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 96
Hello,
I add new entity from Code Generator abp suite. successfully generated my code. but I click new entity menu in angular UI. faced error in console.
core.mjs:6494 ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(UserKeyModule)[ScrollbarHelper -> ScrollbarHelper -> ScrollbarHelper -> ScrollbarHelper]: NullInjectorError: No provider for ScrollbarHelper! NullInjectorError: R3InjectorError(UserKeyModule)[ScrollbarHelper -> ScrollbarHelper -> ScrollbarHelper -> ScrollbarHelper]: NullInjectorError: No provider for ScrollbarHelper! at NullInjector.get (core.mjs:11157:1) at R3Injector.get (core.mjs:11324:1) at R3Injector.get (core.mjs:11324:1) at R3Injector.get (core.mjs:11324:1) at NgModuleRef.get (core.mjs:21888:1) at R3Injector.get (core.mjs:11324:1) at NgModuleRef.get (core.mjs:21888:1) at Object.get (core.mjs:21565:1) at lookupTokenUsingModuleInjector (core.mjs:3367:1) at getOrCreateInjectable (core.mjs:3479:1) at resolvePromise (zone.js:1213:1) at resolvePromise (zone.js:1167:1) at zone.js:1279:1 at ZoneDelegate.invokeTask (zone.js:406:1) at Object.onInvokeTask (core.mjs:25595:1) at ZoneDelegate.invokeTask (zone.js:405:1) at Zone.runTask (zone.js:178:1) at drainMicroTaskQueue (zone.js:582:1)
please solve this error
Thanks
Hello
Configure<AbpClaimsServiceOptions>(options => { options.RequestedClaims.AddRange(new[]{ "SocialSecurityNumber" }); });
After adding this code working fine.
Thank you
hello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