vietnam-devs / coolstore-microservices

A full-stack .NET microservices build on Dapr and Tye
https://vietnam-devs.github.io/coolstore-microservices
MIT License
2.46k stars 571 forks source link

Error Connection refused #62

Open huynhtangiau opened 2 years ago

huynhtangiau commented 2 years ago

I got 500 error as bellow, how can I fix it, Dapr.Client.InvocationException: Exception while invoking get-inventories-by-ids on appId:inventoryapp


 ---> Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Connection refused (127.0.0.1:50001) SocketException: Connection refused", DebugException="System.Net.Http.HttpRequestException: Connection refused (127.0.0.1:50001)
 ---> System.Net.Sockets.SocketException (61): Connection refused
   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|283_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.DefaultConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken)
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(Func`3 callback, DnsEndPoint endPoint, HttpRequestMessage requestMessage, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")
   at Dapr.Client.DaprClientGrpc.MakeInvokeRequestAsyncWithResponse[TRequest,TResponse](InvocationRequest`1 request, Boolean useRaw, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Dapr.Client.DaprClientGrpc.MakeInvokeRequestAsyncWithResponse[TRequest,TResponse](InvocationRequest`1 request, Boolean useRaw, CancellationToken cancellationToken)
   at Dapr.Client.DaprClientGrpc.InvokeMethodAsync[TRequest,TResponse](String appId, String methodName, TRequest data, HTTPExtension httpExtension, CancellationToken cancellationToken)
   at ProductCatalogService.Infrastructure.Gateway.InventoryGateway.GetInventoryListAsync(IEnumerable`1 ids, CancellationToken cancellationToken) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService/Infrastructure/Gateway/InventoryGateway.cs:line 28
   at ProductCatalogService.Application.SearchProducts.SearchProductsHandler.Handle(SearchProductsQuery request, CancellationToken cancellationToken) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService/Application/SearchProducts/SearchProductsHandler.cs:line 63
   at ProductCatalogService.Application.SearchProducts.SearchProductsHandler.Handle(SearchProductsQuery request, CancellationToken cancellationToken) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService/Application/SearchProducts/SearchProductsHandler.cs:line 113
   at N8T.Infrastructure.OTel.MediatR.OTelMediatRTracingBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure.OTel/MediatR/OTelMediatRTracingBehavior.cs:line 45
   at N8T.Infrastructure.Auth.AuthBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure/Auth/AuthBehavior.cs:line 58
   at N8T.Infrastructure.Logging.LoggingBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure/Logging/LoggingBehavior.cs:line 27
   at N8T.Infrastructure.Validator.RequestValidationBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next) in /Users/giauht/coolstore-microservices/src/BasicBuildingBlocks/N8T.Infrastructure/Validator/RequestValidationBehavior.cs:line 36
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at ProductCatalogService.Api.Http.Controllers.ProductSearchController.Get(IMediator mediator, String query, Double price, Int32 page, Int32 pageSize) in /Users/giauht/coolstore-microservices/src/Services/ProductCatalog/ProductCatalogService.Api/Http/Controllers/ProductSearchController.cs:line 17
   at lambda_method226(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
thangchung commented 2 years ago

How can you run Dapr on your machine? Plz describe it a bit