EdwinVW / dapr-workshop

Workshop that teaches how to apply Dapr to an existing .NET, Java or Python based microservices application.
183 stars 81 forks source link

Error in Assignment2 #50

Closed rawatmanish closed 2 years ago

rawatmanish commented 2 years ago

I have dapr version (CLI version: 1.7.1 , Runtime version: 1.7.3) & dotnet version 6.0.300 I bumped into the workshop, which is very well-created.

Erroring out on assignment with the first change of changing proxy URL to "http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/{licenseNumber}");

Both vehicleregistration and finecollection service are in run state. The finecollection error out calling vehicleregistration

_== APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[100] == APP == Start processing HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79 == APP == info: System.Net.Http.HttpClient.Default.ClientHandler[100] == APP == Sending HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79 == APP == info: System.Net.Http.HttpClient.Default.ClientHandler[101] == APP == Received HTTP response headers after 1001.5905ms - 500 == APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[101] == APP == End processing HTTP request after 1001.7241ms - 500 == APP == fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] == APP == An unhandled exception has occurred while executing the request. == APP == System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error). == APP == at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() == APP == at System.Net.Http.Json.HttpClientJsonExtensions.GetFromJsonAsyncCore[T](Task1 taskResponse, JsonSerializerOptions options, CancellationToken cancellationToken) == APP == at FineCollectionService.Proxies.VehicleRegistrationService.GetVehicleInfo(String licenseNumber) in /Users/manrawat1/projects/daprwork/dapr-workshop-csharp/FineCollectionService/Proxies/VehicleRegistrationService.cs:line 14 == APP == at FineCollectionService.Controllers.CollectionController.CollectFine(SpeedingViolation speedingViolation) in /Users/manrawat1/projects/daprwork/dapr-workshop-csharp/FineCollectionService/Controllers/CollectionController.cs:line 33 == APP == at lambda_method4(Closure , Object ) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.gAwaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) == APP == at Microsoft.AspNetCore.Routing.EndpointMiddleware.gAwaitRequestTask|60(Endpoint endpoint, Task requestTask, ILogger logger) == APP == at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

EdwinVW commented 2 years ago

Hi @rawatmanish. Thank you for your interest in the workshop!

I have executed the steps in assignment 2 (with the same specs: Dapr CLI 1.7.1 , Dapr Runtime 1.7.3, .NET SDK 6.0.300) and was not able to reproduce the error. This is the log output I receive (as expected):

== APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[100]
== APP ==       Start processing HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79
== APP == info: System.Net.Http.HttpClient.Default.ClientHandler[100]
== APP ==       Sending HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79
== APP == info: System.Net.Http.HttpClient.Default.ClientHandler[101]
== APP ==       Received HTTP response headers after 106.9157ms - 200
== APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[101]
== APP ==       End processing HTTP request after 107.2138ms - 200
== APP == info: FineCollectionService.Controllers.CollectionController[0]
== APP ==       Sent speeding ticket to Andreas Trypaluk. Road: A12, Licensenumber: TX-TS-79, Vehicle: Mercedes C Class, Violation: 15 Km/h, Fine: 130 Euro, On: 10-09-2020 at 10:38:52.

Did you check the output of the VechicleRegistrationService? Did you see any errors there?

rawatmanish commented 2 years ago

The above issue happensed in mac.( macOS Monterey 12.4). I tried in windows and it works

EdwinVW commented 2 years ago

Did you check the output of the VechicleRegistrationService when running it on the Mac? Did you see any errors there?

Could you try and use 127.0.0.1 in stead of localhost as hostname in the URL on the Mac and try again?

This shoud be the URL then: http://127.0.0.1:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/{licenseNumber}