title: Connection issues with Cosmos DB SDK
body: <p>Im trying to connect to a CosmosDB instance using the Java SDK. My code to do so looks like this:</p>
  <pre><code>public static void main(String[] args) {
    String host = &quot;https://mycosmosinstance.cosmos.azure.com:443&quot;;
    String key = &quot;mykey&quot;;
  
    InetSocketAddress proxy = InetSocketAddress.createUnresolved(&quot;corporate.proxy.net&quot;, 8080);
  
    ConnectionPolicy.getDefaultPolicy().setProxy(new ProxyOptions(ProxyOptions.Type.HTTP, proxy));
  
    CosmosClient cc = new CosmosClientBuilder()
                       .endpoint(host)
                       .key(key)
                       .gatewayMode()
                       .buildClient();   
    cc.getDatabase(&quot;MY_DB&quot;);
  
    cc.close();
  }
  </code></pre>
  <p>As the example shows Im behind a corporate proxy. Connection should not be an issue though, because our mongo clients work fine. Ports are open as I can telnet directly. I have no access to the Azure control plane.</p>
  <p>Im getting RuntimeExceptions that says &quot;Client initialization failed. Check if the endpoint is reachable and if your auth token is valid&quot;. The token is the same used for our mongodb clients.</p>
  <p>Trying to connect to 443 and the 10255 (being the mongo port) yields a 404 and a timeout.</p>
  <p>Is the code wrong? Anyone have experience with this?</p>
  <pre><code>Timeout log:
  
  
  WARNING: [id:a0bf804d-1, L:/10.0.2.15:44498 - R:mycosmosinstance.cosmos.azure.com/10.x.x.x:10255] The connection observed an error
  
  io.netty.handler.timeout.ReadTimeoutException
  
   
  
  Sep 10, 2021 10:03:28 AM com.azure.cosmos.implementation.RxGatewayStoreModel lambda$toDocumentServiceResponse$3
  
  SEVERE: Network failure
  
  io.netty.handler.timeout.ReadTimeoutException
  
   
  
  Sep 10, 2021 10:03:28 AM com.azure.cosmos.implementation.RxDocumentClientImpl lambda$getDatabaseAccountFromEndpoint$142
  
  WARNING: Failed to retrieve database account information. io.netty.handler.timeout.ReadTimeoutException
  
  Sep 10, 2021 10:03:28 AM com.azure.cosmos.implementation.GlobalEndpointManager lambda$getDatabaseAccountFromAnyLocationsAsync$2
  
  SEVERE: Fail to reach global gateway [http://mycosmosinstance.cosmos.azure.com:10255], [{&quot;innerErrorMessage&quot;:null,&quot;cosmosDiagnostics&quot;:{&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;requestLatencyInMs&quot;:60636,&quot;requestStartTimeUTC&quot;:&quot;2021-09-10T08:02:28.031464262Z&quot;,&quot;requestEndTimeUTC&quot;:&quot;2021-09-10T08:03:28.667618587Z&quot;,&quot;responseStatisticsList&quot;:[],&quot;supplementalResponseStatisticsList&quot;:[],&quot;addressResolutionStatistics&quot;:{},&quot;regionsContacted&quot;:[],&quot;retryContext&quot;:{&quot;statusAndSubStatusCodes&quot;:null,&quot;retryLatency&quot;:0,&quot;retryCount&quot;:0},&quot;metadataDiagnosticsContext&quot;:{&quot;metadataDiagnosticList&quot;:null},&quot;serializationDiagnosticsContext&quot;:{&quot;serializationDiagnosticsList&quot;:null},&quot;gatewayStatistics&quot;:{&quot;sessionToken&quot;:null,&quot;operationType&quot;:&quot;Read&quot;,&quot;resourceType&quot;:&quot;DatabaseAccount&quot;,&quot;statusCode&quot;:0,&quot;subStatusCode&quot;:10002,&quot;requestCharge&quot;:null,&quot;requestTimeline&quot;:[{&quot;eventName&quot;:&quot;connectionCreated&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.033787036Z&quot;,&quot;durationInMicroSec&quot;:567084},{&quot;eventName&quot;:&quot;connectionConfigured&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.600871087Z&quot;,&quot;durationInMicroSec&quot;:10852},{&quot;eventName&quot;:&quot;requestSent&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.611723553Z&quot;,&quot;durationInMicroSec&quot;:12087},{&quot;eventName&quot;:&quot;transitTime&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.623811005Z&quot;,&quot;durationInMicroSec&quot;:60036821},{&quot;eventName&quot;:&quot;received&quot;,&quot;startTimeUTC&quot;:null,&quot;durationInMicroSec&quot;:0}],&quot;partitionKeyRangeId&quot;:null},&quot;systemInformation&quot;:{&quot;usedMemory&quot;:&quot;26202 KB&quot;,&quot;availableMemory&quot;:&quot;6023590 KB&quot;,&quot;systemCpuLoad&quot;:&quot;(2021-09-10T08:03:02.912144761Z 3.5%), (2021-09-10T08:03:07.912029515Z 3.2%), (2021-09-10T08:03:12.911460277Z 3.1%), (2021-09-10T08:03:17.911173112Z 3.5%), (2021-09-10T08:03:22.912067928Z 2.2%), (2021-09-10T08:03:27.911201387Z 2.4%)&quot;,&quot;availableProcessors&quot;:4},&quot;clientCfgs&quot;:{&quot;id&quot;:0,&quot;connectionMode&quot;:&quot;GATEWAY&quot;,&quot;numberOfClients&quot;:1,&quot;connCfg&quot;:{&quot;rntbd&quot;:null,&quot;gw&quot;:&quot;(cps:1000, rto:PT5S, icto:PT1M, p:false)&quot;,&quot;other&quot;:&quot;(ed: true, cs: false)&quot;},&quot;consistencyCfg&quot;:&quot;(consistency: null, mm: true, prgns: [])&quot;}}}]
  
  Sep 10, 2021 10:03:28 AM com.azure.cosmos.implementation.GlobalEndpointManager lambda$startRefreshLocationTimerAsync$12
  
  SEVERE: startRefreshLocationTimerAsync() - Unable to refresh database account from any location. Exception: {&quot;ClassName&quot;:&quot;CosmosException&quot;,&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;statusCode&quot;:0,&quot;resourceAddress&quot;:&quot;https://mycosmosinstance.cosmos.azure.com:10255/&quot;,&quot;innerErrorMessage&quot;:null,&quot;causeInfo&quot;:&quot;[class: class io.netty.handler.timeout.ReadTimeoutException, message: null]&quot;,&quot;responseHeaders&quot;:&quot;{x-ms-substatus=10002}&quot;,&quot;requestHeaders&quot;:&quot;[Accept=application/json, x-ms-date=Fri, 10 Sep 2021 08:02:27 GMT]&quot;,&quot;cosmosDiagnostics&quot;:{&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;requestLatencyInMs&quot;:60636,&quot;requestStartTimeUTC&quot;:&quot;2021-09-10T08:02:28.031464262Z&quot;,&quot;requestEndTimeUTC&quot;:&quot;2021-09-10T08:03:28.667618587Z&quot;,&quot;responseStatisticsList&quot;:[],&quot;supplementalResponseStatisticsList&quot;:[],&quot;addressResolutionStatistics&quot;:{},&quot;regionsContacted&quot;:[],&quot;retryContext&quot;:{&quot;statusAndSubStatusCodes&quot;:null,&quot;retryLatency&quot;:0,&quot;retryCount&quot;:0},&quot;metadataDiagnosticsContext&quot;:{&quot;metadataDiagnosticList&quot;:null},&quot;serializationDiagnosticsContext&quot;:{&quot;serializationDiagnosticsList&quot;:null},&quot;gatewayStatistics&quot;:{&quot;sessionToken&quot;:null,&quot;operationType&quot;:&quot;Read&quot;,&quot;resourceType&quot;:&quot;DatabaseAccount&quot;,&quot;statusCode&quot;:0,&quot;subStatusCode&quot;:10002,&quot;requestCharge&quot;:null,&quot;requestTimeline&quot;:[{&quot;eventName&quot;:&quot;connectionCreated&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.033787036Z&quot;,&quot;durationInMicroSec&quot;:567084},{&quot;eventName&quot;:&quot;connectionConfigured&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.600871087Z&quot;,&quot;durationInMicroSec&quot;:10852},{&quot;eventName&quot;:&quot;requestSent&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.611723553Z&quot;,&quot;durationInMicroSec&quot;:12087},{&quot;eventName&quot;:&quot;transitTime&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.623811005Z&quot;,&quot;durationInMicroSec&quot;:60036821},{&quot;eventName&quot;:&quot;received&quot;,&quot;startTimeUTC&quot;:null,&quot;durationInMicroSec&quot;:0}],&quot;partitionKeyRangeId&quot;:null},&quot;systemInformation&quot;:{&quot;usedMemory&quot;:&quot;26202 KB&quot;,&quot;availableMemory&quot;:&quot;6023590 KB&quot;,&quot;systemCpuLoad&quot;:&quot;(2021-09-10T08:03:02.912144761Z 3.5%), (2021-09-10T08:03:07.912029515Z 3.2%), (2021-09-10T08:03:12.911460277Z 3.1%), (2021-09-10T08:03:17.911173112Z 3.5%), (2021-09-10T08:03:22.912067928Z 2.2%), (2021-09-10T08:03:27.911201387Z 2.4%)&quot;,&quot;availableProcessors&quot;:4},&quot;clientCfgs&quot;:{&quot;id&quot;:0,&quot;connectionMode&quot;:&quot;GATEWAY&quot;,&quot;numberOfClients&quot;:1,&quot;connCfg&quot;:{&quot;rntbd&quot;:null,&quot;gw&quot;:&quot;(cps:1000, rto:PT5S, icto:PT1M, p:false)&quot;,&quot;other&quot;:&quot;(ed: true, cs: false)&quot;},&quot;consistencyCfg&quot;:&quot;(consistency: null, mm: true, prgns: [])&quot;}}}
  
  {&quot;ClassName&quot;:&quot;CosmosException&quot;,&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;statusCode&quot;:0,&quot;resourceAddress&quot;:&quot;https://mycosmosinstance.cosmos.azure.com:10255/&quot;,&quot;innerErrorMessage&quot;:null,&quot;causeInfo&quot;:&quot;[class: class io.netty.handler.timeout.ReadTimeoutException, message: null]&quot;,&quot;responseHeaders&quot;:&quot;{x-ms-substatus=10002}&quot;,&quot;requestHeaders&quot;:&quot;[Accept=application/json, x-ms-date=Fri, 10 Sep 2021 08:02:27 GMT]&quot;,&quot;cosmosDiagnostics&quot;:{&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;requestLatencyInMs&quot;:60636,&quot;requestStartTimeUTC&quot;:&quot;2021-09-10T08:02:28.031464262Z&quot;,&quot;requestEndTimeUTC&quot;:&quot;2021-09-10T08:03:28.667618587Z&quot;,&quot;responseStatisticsList&quot;:[],&quot;supplementalResponseStatisticsList&quot;:[],&quot;addressResolutionStatistics&quot;:{},&quot;regionsContacted&quot;:[],&quot;retryContext&quot;:{&quot;statusAndSubStatusCodes&quot;:null,&quot;retryLatency&quot;:0,&quot;retryCount&quot;:0},&quot;metadataDiagnosticsContext&quot;:{&quot;metadataDiagnosticList&quot;:null},&quot;serializationDiagnosticsContext&quot;:{&quot;serializationDiagnosticsList&quot;:null},&quot;gatewayStatistics&quot;:{&quot;sessionToken&quot;:null,&quot;operationType&quot;:&quot;Read&quot;,&quot;resourceType&quot;:&quot;DatabaseAccount&quot;,&quot;statusCode&quot;:0,&quot;subStatusCode&quot;:10002,&quot;requestCharge&quot;:null,&quot;requestTimeline&quot;:[{&quot;eventName&quot;:&quot;connectionCreated&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.033787036Z&quot;,&quot;durationInMicroSec&quot;:567084},{&quot;eventName&quot;:&quot;connectionConfigured&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.600871087Z&quot;,&quot;durationInMicroSec&quot;:10852},{&quot;eventName&quot;:&quot;requestSent&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.611723553Z&quot;,&quot;durationInMicroSec&quot;:12087},{&quot;eventName&quot;:&quot;transitTime&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:02:28.623811005Z&quot;,&quot;durationInMicroSec&quot;:60036821},{&quot;eventName&quot;:&quot;received&quot;,&quot;startTimeUTC&quot;:null,&quot;durationInMicroSec&quot;:0}],&quot;partitionKeyRangeId&quot;:null},&quot;systemInformation&quot;:{&quot;usedMemory&quot;:&quot;26202 KB&quot;,&quot;availableMemory&quot;:&quot;6023590 KB&quot;,&quot;systemCpuLoad&quot;:&quot;(2021-09-10T08:03:02.912144761Z 3.5%), (2021-09-10T08:03:07.912029515Z 3.2%), (2021-09-10T08:03:12.911460277Z 3.1%), (2021-09-10T08:03:17.911173112Z 3.5%), (2021-09-10T08:03:22.912067928Z 2.2%), (2021-09-10T08:03:27.911201387Z 2.4%)&quot;,&quot;availableProcessors&quot;:4},&quot;clientCfgs&quot;:{&quot;id&quot;:0,&quot;connectionMode&quot;:&quot;GATEWAY&quot;,&quot;numberOfClients&quot;:1,&quot;connCfg&quot;:{&quot;rntbd&quot;:null,&quot;gw&quot;:&quot;(cps:1000, rto:PT5S, icto:PT1M, p:false)&quot;,&quot;other&quot;:&quot;(ed: true, cs: false)&quot;},&quot;consistencyCfg&quot;:&quot;(consistency: null, mm: true, prgns: [])&quot;}}}
  
                  at com.azure.cosmos.BridgeInternal.createCosmosException(BridgeInternal.java:466)
  
  
  404 log:
  
  ep 10, 2021 10:18:29 AM com.azure.cosmos.implementation.RxDocumentClientImpl$1 getDatabaseAccountFromEndpoint
  
  INFO: Getting database account endpoint from https://mycosmosinstance.cosmos.azure.com:443
  
  Sep 10, 2021 10:18:30 AM com.azure.cosmos.implementation.RxDocumentClientImpl lambda$getDatabaseAccountFromEndpoint$142
  
  WARNING: Failed to retrieve database account information. {&quot;ClassName&quot;:&quot;CosmosException&quot;,&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;statusCode&quot;:404,&quot;resourceAddress&quot;:&quot;https://mycosmosinstance.cosmos.azure.com:443/&quot;,&quot;error&quot;:&quot;{\&quot;code\&quot;:\&quot;NotFound\&quot;,\&quot;message\&quot;:\&quot;null, StatusCode: NotFound\&quot;,\&quot;additionalErrorInfo\&quot;:null}&quot;,&quot;innerErrorMessage&quot;:&quot;null, StatusCode: NotFound&quot;,&quot;causeInfo&quot;:null,&quot;responseHeaders&quot;:&quot;{content-length=0, Date=Fri, 10 Sep 2021 08:18:30 GMT}&quot;,&quot;requestHeaders&quot;:&quot;[Accept=application/json, x-ms-date=Fri, 10 Sep 2021 08:18:29 GMT]&quot;,&quot;cosmosDiagnostics&quot;:{&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;requestLatencyInMs&quot;:744,&quot;requestStartTimeUTC&quot;:&quot;2021-09-10T08:18:29.891310289Z&quot;,&quot;requestEndTimeUTC&quot;:&quot;2021-09-10T08:18:30.635990134Z&quot;,&quot;responseStatisticsList&quot;:[],&quot;supplementalResponseStatisticsList&quot;:[],&quot;addressResolutionStatistics&quot;:{},&quot;regionsContacted&quot;:[],&quot;retryContext&quot;:{&quot;statusAndSubStatusCodes&quot;:null,&quot;retryLatency&quot;:0,&quot;retryCount&quot;:0},&quot;metadataDiagnosticsContext&quot;:{&quot;metadataDiagnosticList&quot;:null},&quot;serializationDiagnosticsContext&quot;:{&quot;serializationDiagnosticsList&quot;:null},&quot;gatewayStatistics&quot;:{&quot;sessionToken&quot;:null,&quot;operationType&quot;:&quot;Read&quot;,&quot;resourceType&quot;:&quot;DatabaseAccount&quot;,&quot;statusCode&quot;:404,&quot;subStatusCode&quot;:0,&quot;requestCharge&quot;:null,&quot;requestTimeline&quot;:[{&quot;eventName&quot;:&quot;connectionCreated&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:29.894688313Z&quot;,&quot;durationInMicroSec&quot;:637342},{&quot;eventName&quot;:&quot;connectionConfigured&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.532031288Z&quot;,&quot;durationInMicroSec&quot;:12332},{&quot;eventName&quot;:&quot;requestSent&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.544363773Z&quot;,&quot;durationInMicroSec&quot;:9266},{&quot;eventName&quot;:&quot;transitTime&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.553630445Z&quot;,&quot;durationInMicroSec&quot;:63763},{&quot;eventName&quot;:&quot;received&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.617394320Z&quot;,&quot;durationInMicroSec&quot;:11039}],&quot;partitionKeyRangeId&quot;:null},&quot;systemInformation&quot;:{&quot;usedMemory&quot;:&quot;25671 KB&quot;,&quot;availableMemory&quot;:&quot;6024121 KB&quot;,&quot;systemCpuLoad&quot;:&quot;empty&quot;,&quot;availableProcessors&quot;:4},&quot;clientCfgs&quot;:{&quot;id&quot;:0,&quot;connectionMode&quot;:&quot;GATEWAY&quot;,&quot;numberOfClients&quot;:1,&quot;connCfg&quot;:{&quot;rntbd&quot;:null,&quot;gw&quot;:&quot;(cps:1000, rto:PT5S, icto:PT1M, p:false)&quot;,&quot;other&quot;:&quot;(ed: true, cs: false)&quot;},&quot;consistencyCfg&quot;:&quot;(consistency: null, mm: true, prgns: [])&quot;}}}
  
  Sep 10, 2021 10:18:30 AM com.azure.cosmos.implementation.GlobalEndpointManager lambda$getDatabaseAccountFromAnyLocationsAsync$2
  
  SEVERE: Fail to reach global gateway [https://mycosmosinstance.cosmos.azure.com:443], [{&quot;innerErrorMessage&quot;:&quot;null, StatusCode: NotFound&quot;,&quot;cosmosDiagnostics&quot;:{&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;requestLatencyInMs&quot;:744,&quot;requestStartTimeUTC&quot;:&quot;2021-09-10T08:18:29.891310289Z&quot;,&quot;requestEndTimeUTC&quot;:&quot;2021-09-10T08:18:30.635990134Z&quot;,&quot;responseStatisticsList&quot;:[],&quot;supplementalResponseStatisticsList&quot;:[],&quot;addressResolutionStatistics&quot;:{},&quot;regionsContacted&quot;:[],&quot;retryContext&quot;:{&quot;statusAndSubStatusCodes&quot;:null,&quot;retryLatency&quot;:0,&quot;retryCount&quot;:0},&quot;metadataDiagnosticsContext&quot;:{&quot;metadataDiagnosticList&quot;:null},&quot;serializationDiagnosticsContext&quot;:{&quot;serializationDiagnosticsList&quot;:null},&quot;gatewayStatistics&quot;:{&quot;sessionToken&quot;:null,&quot;operationType&quot;:&quot;Read&quot;,&quot;resourceType&quot;:&quot;DatabaseAccount&quot;,&quot;statusCode&quot;:404,&quot;subStatusCode&quot;:0,&quot;requestCharge&quot;:null,&quot;requestTimeline&quot;:[{&quot;eventName&quot;:&quot;connectionCreated&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:29.894688313Z&quot;,&quot;durationInMicroSec&quot;:637342},{&quot;eventName&quot;:&quot;connectionConfigured&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.532031288Z&quot;,&quot;durationInMicroSec&quot;:12332},{&quot;eventName&quot;:&quot;requestSent&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.544363773Z&quot;,&quot;durationInMicroSec&quot;:9266},{&quot;eventName&quot;:&quot;transitTime&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.553630445Z&quot;,&quot;durationInMicroSec&quot;:63763},{&quot;eventName&quot;:&quot;received&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.617394320Z&quot;,&quot;durationInMicroSec&quot;:11039}],&quot;partitionKeyRangeId&quot;:null},&quot;systemInformation&quot;:{&quot;usedMemory&quot;:&quot;25671 KB&quot;,&quot;availableMemory&quot;:&quot;6024121 KB&quot;,&quot;systemCpuLoad&quot;:&quot;empty&quot;,&quot;availableProcessors&quot;:4},&quot;clientCfgs&quot;:{&quot;id&quot;:0,&quot;connectionMode&quot;:&quot;GATEWAY&quot;,&quot;numberOfClients&quot;:1,&quot;connCfg&quot;:{&quot;rntbd&quot;:null,&quot;gw&quot;:&quot;(cps:1000, rto:PT5S, icto:PT1M, p:false)&quot;,&quot;other&quot;:&quot;(ed: true, cs: false)&quot;},&quot;consistencyCfg&quot;:&quot;(consistency: null, mm: true, prgns: [])&quot;}}}]
  
  Sep 10, 2021 10:18:30 AM com.azure.cosmos.implementation.GlobalEndpointManager lambda$startRefreshLocationTimerAsync$12
  
  SEVERE: startRefreshLocationTimerAsync() - Unable to refresh database account from any location. Exception: {&quot;ClassName&quot;:&quot;CosmosException&quot;,&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;statusCode&quot;:404,&quot;resourceAddress&quot;:&quot;https://mycosmosinstance.cosmos.azure.com:443/&quot;,&quot;error&quot;:&quot;{\&quot;code\&quot;:\&quot;NotFound\&quot;,\&quot;message\&quot;:\&quot;null, StatusCode: NotFound\&quot;,\&quot;additionalErrorInfo\&quot;:null}&quot;,&quot;innerErrorMessage&quot;:&quot;null, StatusCode: NotFound&quot;,&quot;causeInfo&quot;:null,&quot;responseHeaders&quot;:&quot;{content-length=0, Date=Fri, 10 Sep 2021 08:18:30 GMT}&quot;,&quot;requestHeaders&quot;:&quot;[Accept=application/json, x-ms-date=Fri, 10 Sep 2021 08:18:29 GMT]&quot;,&quot;cosmosDiagnostics&quot;:{&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;requestLatencyInMs&quot;:744,&quot;requestStartTimeUTC&quot;:&quot;2021-09-10T08:18:29.891310289Z&quot;,&quot;requestEndTimeUTC&quot;:&quot;2021-09-10T08:18:30.635990134Z&quot;,&quot;responseStatisticsList&quot;:[],&quot;supplementalResponseStatisticsList&quot;:[],&quot;addressResolutionStatistics&quot;:{},&quot;regionsContacted&quot;:[],&quot;retryContext&quot;:{&quot;statusAndSubStatusCodes&quot;:null,&quot;retryLatency&quot;:0,&quot;retryCount&quot;:0},&quot;metadataDiagnosticsContext&quot;:{&quot;metadataDiagnosticList&quot;:null},&quot;serializationDiagnosticsContext&quot;:{&quot;serializationDiagnosticsList&quot;:null},&quot;gatewayStatistics&quot;:{&quot;sessionToken&quot;:null,&quot;operationType&quot;:&quot;Read&quot;,&quot;resourceType&quot;:&quot;DatabaseAccount&quot;,&quot;statusCode&quot;:404,&quot;subStatusCode&quot;:0,&quot;requestCharge&quot;:null,&quot;requestTimeline&quot;:[{&quot;eventName&quot;:&quot;connectionCreated&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:29.894688313Z&quot;,&quot;durationInMicroSec&quot;:637342},{&quot;eventName&quot;:&quot;connectionConfigured&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.532031288Z&quot;,&quot;durationInMicroSec&quot;:12332},{&quot;eventName&quot;:&quot;requestSent&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.544363773Z&quot;,&quot;durationInMicroSec&quot;:9266},{&quot;eventName&quot;:&quot;transitTime&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.553630445Z&quot;,&quot;durationInMicroSec&quot;:63763},{&quot;eventName&quot;:&quot;received&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.617394320Z&quot;,&quot;durationInMicroSec&quot;:11039}],&quot;partitionKeyRangeId&quot;:null},&quot;systemInformation&quot;:{&quot;usedMemory&quot;:&quot;25671 KB&quot;,&quot;availableMemory&quot;:&quot;6024121 KB&quot;,&quot;systemCpuLoad&quot;:&quot;empty&quot;,&quot;availableProcessors&quot;:4},&quot;clientCfgs&quot;:{&quot;id&quot;:0,&quot;connectionMode&quot;:&quot;GATEWAY&quot;,&quot;numberOfClients&quot;:1,&quot;connCfg&quot;:{&quot;rntbd&quot;:null,&quot;gw&quot;:&quot;(cps:1000, rto:PT5S, icto:PT1M, p:false)&quot;,&quot;other&quot;:&quot;(ed: true, cs: false)&quot;},&quot;consistencyCfg&quot;:&quot;(consistency: null, mm: true, prgns: [])&quot;}}}
  
  {&quot;ClassName&quot;:&quot;CosmosException&quot;,&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;statusCode&quot;:404,&quot;resourceAddress&quot;:&quot;https://mycosmosinstance.cosmos.azure.com:443/&quot;,&quot;error&quot;:&quot;{\&quot;code\&quot;:\&quot;NotFound\&quot;,\&quot;message\&quot;:\&quot;null, StatusCode: NotFound\&quot;,\&quot;additionalErrorInfo\&quot;:null}&quot;,&quot;innerErrorMessage&quot;:&quot;null, StatusCode: NotFound&quot;,&quot;causeInfo&quot;:null,&quot;responseHeaders&quot;:&quot;{content-length=0, Date=Fri, 10 Sep 2021 08:18:30 GMT}&quot;,&quot;requestHeaders&quot;:&quot;[Accept=application/json, x-ms-date=Fri, 10 Sep 2021 08:18:29 GMT]&quot;,&quot;cosmosDiagnostics&quot;:{&quot;userAgent&quot;:&quot;azsdk-java-cosmos/4.18.0 Linux/5.4.0-71-generic JRE/16&quot;,&quot;requestLatencyInMs&quot;:744,&quot;requestStartTimeUTC&quot;:&quot;2021-09-10T08:18:29.891310289Z&quot;,&quot;requestEndTimeUTC&quot;:&quot;2021-09-10T08:18:30.635990134Z&quot;,&quot;responseStatisticsList&quot;:[],&quot;supplementalResponseStatisticsList&quot;:[],&quot;addressResolutionStatistics&quot;:{},&quot;regionsContacted&quot;:[],&quot;retryContext&quot;:{&quot;statusAndSubStatusCodes&quot;:null,&quot;retryLatency&quot;:0,&quot;retryCount&quot;:0},&quot;metadataDiagnosticsContext&quot;:{&quot;metadataDiagnosticList&quot;:null},&quot;serializationDiagnosticsContext&quot;:{&quot;serializationDiagnosticsList&quot;:null},&quot;gatewayStatistics&quot;:{&quot;sessionToken&quot;:null,&quot;operationType&quot;:&quot;Read&quot;,&quot;resourceType&quot;:&quot;DatabaseAccount&quot;,&quot;statusCode&quot;:404,&quot;subStatusCode&quot;:0,&quot;requestCharge&quot;:null,&quot;requestTimeline&quot;:[{&quot;eventName&quot;:&quot;connectionCreated&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:29.894688313Z&quot;,&quot;durationInMicroSec&quot;:637342},{&quot;eventName&quot;:&quot;connectionConfigured&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.532031288Z&quot;,&quot;durationInMicroSec&quot;:12332},{&quot;eventName&quot;:&quot;requestSent&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.544363773Z&quot;,&quot;durationInMicroSec&quot;:9266},{&quot;eventName&quot;:&quot;transitTime&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.553630445Z&quot;,&quot;durationInMicroSec&quot;:63763},{&quot;eventName&quot;:&quot;received&quot;,&quot;startTimeUTC&quot;:&quot;2021-09-10T08:18:30.617394320Z&quot;,&quot;durationInMicroSec&quot;:11039}],&quot;partitionKeyRangeId&quot;:null},&quot;systemInformation&quot;:{&quot;usedMemory&quot;:&quot;25671 KB&quot;,&quot;availableMemory&quot;:&quot;6024121 KB&quot;,&quot;systemCpuLoad&quot;:&quot;empty&quot;,&quot;availableProcessors&quot;:4},&quot;clientCfgs&quot;:{&quot;id&quot;:0,&quot;connectionMode&quot;:&quot;GATEWAY&quot;,&quot;numberOfClients&quot;:1,&quot;connCfg&quot;:{&quot;rntbd&quot;:null,&quot;gw&quot;:&quot;(cps:1000, rto:PT5S, icto:PT1M, p:false)&quot;,&quot;other&quot;:&quot;(ed: true, cs: false)&quot;},&quot;consistencyCfg&quot;:&quot;(consistency: null, mm: true, prgns: [])&quot;}}}
  
                  at com.azure.cosmos.BridgeInternal.createCosmosException(BridgeInternal.java:475)
  
  </code></pre>