How to investigate Dapr service invocation 500 error

spottedmahn 21 Reputation points
2022-09-13T13:05:22.067+00:00

When I use service invocation in my Dapr applications and when they are deployed to Azure Container Apps I get:

Dapr.Client.InvocationException: An exception occurred while invoking method: 'health-check' on app-id: 'customers'

---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at Dapr.Client.DaprClientGrpc.InvokeMethodAsync[TResponse](HttpRequestMessage request, CancellationToken cancellationToken)

Service invocation is working fine locally. How do I figure out where my problem lies?

I would think enabling the debug log level in Dapr might give some insight.


   csharp  
   [HttpGet, Route("health-check")]  
   public ActionResult HealthCheck()  
   {  
    logger.LogInformation("health check called");  
    return Ok(new HealthCheckResponse  
    {  
        Message = "I'm up - orders service"  
    });  
   }  

   [HttpGet, Route("health-check-service-invocation")]  
   public async Task<ActionResult> HealthCheckServiceInvocation()  
   {  
    try  
    {  
        logger.LogInformation("health check service invocation of the catalog service called");  
        return Ok(await daprClient.InvokeMethodAsync<HealthCheckResponse>(HttpMethod.Get, "customers", "health-check"));  
    }  
    catch (Exception ex)  
    {  
        logger.LogError(ex, "unable to talk to the customers service");  
        return StatusCode(StatusCodes.Status500InternalServerError);  
    }  
   }  

note: This is an Azure Container Apps issue but there doesn't appear to be a tag for that so I choose Azure Container Instances

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,856 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.