当我在我的Dapr应用程序中使用服务调用时,当它们被部署到Azure容器应用程序时,我得到:
Dapr.Client.InvocationException:在调用方法时出现异常:对app-id:“customers”进行“健康检查” -> System.Net.Http.HttpRequestException:响应状态代码并不表示成功: 500 (内部服务器错误)。 在System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() 在Dapr.Client.DaprClientGrpc.InvokeMethodAsyncTResponse
服务调用是在本地很好地工作,。我该如何找出我的问题所在?
我认为在Dapr中启用调试日志级别可能会给出一些见解,♂️。
[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);
}
}发布于 2022-10-21 06:46:34
服务到服务调用可能受到ssl的影响。
在本地运行时,是否启用了mtls?
# enabling
dapr init --enable-mtls=true
dapr init -k --enable-mtls=true
# Disable
dapr init --enable-mtls=false
dapr init -k --enable-mtls=false你可以在本地尝试使用mtls,
在本地运行应用程序时,命令应该包括--app-ssl
dapr run ... --app-ssl ... https://stackoverflow.com/questions/73638122
复制相似问题