0

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 ‍♂️.


[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);
    }
}
spottedmahn
  • 14,823
  • 13
  • 108
  • 178

1 Answers1

0

Service to service Invocation can be affected by ssl

When Running Locally are you running with mtls Enabled ?

# enabling
dapr init --enable-mtls=true
dapr init -k --enable-mtls=true

# Disable
dapr init --enable-mtls=false
dapr init -k --enable-mtls=false

You could try locally with mtls,

when running your app locally, the command should include --app-ssl

 dapr run ... --app-ssl ...