abpframework / eShopOnAbp

Reference microservice solution built with the ABP Framework and .NET, runs on Kubernetes with Helm configuration, includes API Gateways, Angular and ASP.NET Core MVC applications, PostgreSQL and MongoDB databases
https://www.eShopOnAbp.com/
MIT License
664 stars 259 forks source link

The catalog service is not loading and so the products page is throwing an error #189

Closed justinfraz closed 9 months ago

justinfraz commented 10 months ago

Hello!

In the Tye dashboard, all the other services are loading fine except for the catalog service. It is throwing an error like so:

This site can’t be reachedlocalhost refused to connect. Try:

Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED

Is there a firewall configuration that I should implement?

As a result of the catalog service being down, the Products page is throwing an error like so:

An error has occurred! Http failure response for https://localhost:44354/api/catalog/product/paged: 0 Unknown Error

Best Regards,

Justin

jflaga commented 10 months ago

Please check the logs of the Catalog microservice, then paste here the error you see in there.

justinfraz commented 10 months ago

Could you please tell me the location where I can check the logs?

jflaga commented 10 months ago

The logs for Catalog microservice is in \eShopOnAbp\services\catalog\src\EShopOnAbp.CatalogService.HttpApi.Host\Logs\logs.txt

justinfraz commented 9 months ago

The log file is quite long. Is there an email address that I could mail it to?

gterdem commented 9 months ago

Delete all the lines of the log. Start the request for the catalog view. Check the logs for [ERR] and share it please.

justinfraz commented 9 months ago

I ran run-tye.ps1 and all the services were up and running in the Tye dashboard. The catalog service loaded fine. The PublicWeb site loaded fine and I was able to login. All good.

justinfraz commented 9 months ago

The PublicWeb site is loading fine but when I proceed to complete the payment using the home or work addresses, demo card or paypal, I'm getting the following exception:

Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at EShopOnAbp.OrderingService.Orders.ClientProxies.OrderClientProxy.CreateAsync(OrderCreateDto input) in C:\Users\jstnf\Downloads\ABPeShop\services\ordering\src\EShopOnAbp.OrderingService.HttpApi.Client\ClientProxies\OrderClientProxy.Generated.cs:line 85 at EShopOnAbp.PublicWeb.Pages.PaymentModel.OnPostAsync(PaymentPageViewModel model) in C:\Users\jstnf\Downloads\ABPeShop\apps\public-web\src\EShopOnAbp.PublicWeb\Pages\Payment.cshtml.cs:line 59 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.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.gAwaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gLogged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.gAwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at EShopOnAbp.PublicWeb.AnonymousUser.AnonymousUserMiddleware.InvokeAsync(HttpContext context) in C:\Users\jstnf\Downloads\ABPeShop\apps\public-web\src\EShopOnAbp.PublicWeb\AnonymousUser\AnonymousUserMiddleware.cs:line 35 at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>cDisplayClass6_1.<b1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>cDisplayClass6_1.<b1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

jflaga commented 9 months ago

Hi @justinfraz , you might find the more specific error if you look at the logs in the Payment microservice: \eShopOnAbp\services\payment\src\EShopOnAbp.PaymentService.HttpApi.Host\Logs\logs.txt

Scroll to the bottommost messages, then look for the date and time which matches with the date-time when the error occurred. The error message looks similar to this (with [ERR]

...
2023-05-08 03:08:20.453 +08:00 [ERR] ...
...

Paste the error message here.

If you see two error messages which looks different, paste the two messages here.

An example error message looks like this:

2023-05-08 03:34:09.256 +08:00 [ERR] 42P01: relation "AbpPermissionGroups" does not exist

POSITION: 69
Npgsql.PostgresException (0x80004005): 42P01: relation "AbpPermissionGroups" does not exist

POSITION: 69
   at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|222_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
   ...

or like this:

2023-05-04 20:30:21.209 +08:00 [ERR] An exception occurred while iterating over the results of a query for context type 'EShopOnAbp.AdministrationService.EntityFrameworkCore.AdministrationServiceDbContext'.
Npgsql.PostgresException (0x80004005): 42P01: relation "AbpPermissionGroups" does not exist

POSITION: 69
   at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|222_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode 
   ...
justinfraz commented 9 months ago

Here are pretty much the errors of the type that you described above that I have located in the log file:

2023-08-27 18:24:05.963 +10:00 [ERR] ---------- Exception Data ---------- Severity = FATAL InvariantSeverity = FATAL SqlState = 3D000 MessageText = database "EShopOnAbp_Administration" does not exist File = postinit.c Line = 885 Routine = InitPostgres

2023-09-06 11:36:27.348 +10:00 [ERR] ---------- Exception Data ---------- Severity = FATAL InvariantSeverity = FATAL SqlState = 3D000 MessageText = database "EShopOnAbp_Administration" does not exist File = postinit.c Line = 885 Routine = InitPostgres

2023-09-06 16:44:24.502 +10:00 [ERR] ---------- Exception Data ---------- Severity = FATAL InvariantSeverity = FATAL SqlState = 3D000 MessageText = database "EShopOnAbp_Administration" does not exist File = postinit.c Line = 885 Routine = InitPostgres

2023-09-06 16:44:44.551 +10:00 [ERR] ---------- Exception Data ---------- Severity = FATAL InvariantSeverity = FATAL SqlState = 3D000 MessageText = database "EShopOnAbp_Administration" does not exist File = postinit.c Line = 885 Routine = InitPostgres

2023-09-13 09:58:13.130 +10:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null }

gterdem commented 9 months ago

Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized

This is related to https://github.com/abpframework/eShopOnAbp/issues/197

The database errors you receive are related to race condition. They have retry mechanisms so it is normal to log errors. We expect them to be consistent eventually.

I'm closing this issue to prevent it flooded with different issues, since the main problem seems resolved.

Please open new issues if you are still having problems.

justinfraz commented 9 months ago

Thank you very much @gterdem for helping me resolve this issue.