诊断和排查“Azure Cosmos DB Java v4 SDK 服务不可用”异常Diagnose and troubleshoot Azure Cosmos DB Java v4 SDK service unavailable exceptions

Java v4 SDK 无法连接到 Azure Cosmos DB。The Java v4 SDK wasn't able to connect to Azure Cosmos DB.

疑难解答步骤Troubleshooting steps

下面的列表包含“服务不可用”异常的已知原因和解决方案。The following list contains known causes and solutions for service unavailable exceptions.

所需端口被阻止The required ports are being blocked

验证所有必需的端口是否已启用。Verify that all the required ports are enabled.

客户端暂时性连接问题Client-side transient connectivity issues

当存在导致超时的暂时性连接问题时,可能会出现“服务不可用”异常。Service unavailable exceptions can surface when there are transient connectivity problems that are causing timeouts. 通常,与此情况相关的堆栈跟踪会包含 ServiceUnavailableException 错误以及诊断详细信息。Typically, the stack trace related to this scenario will contain a ServiceUnavailableException error with diagnostic details. 例如:For example:

Exception in thread "main" ServiceUnavailableException{userAgent=azsdk-java-cosmos/4.6.0 Linux/4.15.0-1096-azure JRE/11.0.8, error=null, resourceAddress='null', requestUri='null', statusCode=503, message=Service is currently unavailable, please retry after a while. If this problem persists please contact support.: Message: "" {"diagnostics"}

请按照请求超时故障排除步骤解决此问题。Follow the request timeout troubleshooting steps to resolve it.

服务中断Service outage

检查 Azure 状态,了解是否有正在发生的问题。Check the Azure status to see if there's an ongoing issue.

后续步骤Next steps