question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Create of of async client fails with assertion error on Cosmos SDK v4

See original GitHub issue

Describe the bug Using the Cosmos SDK v4, I attempt to create a client using CosmosClientBuilder. Both CosmosClientBuilder.buildAsyncClient() and CosmosClientBuilder.buildClient() fail with an assertion error.

Exception or Stack Trace Assertion fails due to globalEndpointManager.getLatestDatabaseAccount() returning null during initialization:

java.lang.AssertionError
	at com.azure.cosmos.implementation.RxDocumentClientImpl.initializeGatewayConfigurationReader(RxDocumentClientImpl.java:264)
	at com.azure.cosmos.implementation.RxDocumentClientImpl.init(RxDocumentClientImpl.java:282)
	at com.azure.cosmos.implementation.AsyncDocumentClient$Builder.build(AsyncDocumentClient.java:204)
	at com.azure.cosmos.CosmosAsyncClient.<init>(CosmosAsyncClient.java:98)
	at com.azure.cosmos.CosmosClientBuilder.buildAsyncClient(CosmosClientBuilder.java:649)
...

To Reproduce Run the following code snippet. The code is executed during a test, while invoking it from @Test and @BeforeClass does not make a difference.

Code Snippet

new CosmosClientBuilder()
    .endpoint(ENDPOINT)
    .key(KEY)
    .buildAsyncClient();

Expected behavior Client is created successfully and can be used to create database and container objects.

Setup (please complete the following information):

  • OS: MacOS 10.15.6 (19G73)
  • IDE : IntelliJ Ultimate 2020.1.4
  • Java: openjdk version “11.0.8” 2020-07-14
  • Library: com.azure:azure-cosmos:4.3.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kushagraThaparcommented, Sep 30, 2020

@JanneKataja-TomTom - closing this issue since the key used was incorrect, hopefully it works fine with the right key 😃

1reaction
JanneKataja-TomTomcommented, Oct 1, 2020

It appears this bug was fixed as a part of #14742

  • Last version where the bug appears: 4.3.1
  • First version where the bug is fixed: 4.4.0

Also, in case the domain name is incorrect, the exception is not thrown but instead the following error is logged in a loop:

2020-10-01 22:42:17.320  WARN 75928 --- [ctor-http-nio-5] c.a.c.i.WebExceptionRetryPolicy          : Received retriable web exception, will retry
com.azure.cosmos.CosmosException: null
Read more comments on GitHub >

github_iconTop Results From Across the Web

Async Java SDK v2 - Azure Cosmos DB - Microsoft Learn
PoolExhaustedException is a client-side failure. This failure indicates that your app workload is higher than what the SDK connection pool can ...
Read more >
CHANGELOG.md - cosmos/cosmos-sdk - Sourcegraph
"Client Breaking" for breaking Protobuf, gRPC and REST routes used by end-users. "CLI Breaking" for breaking CLI commands.
Read more >
Azure Cosmos DB SQL API client library for Python - PyPI
Create and modify containers to store collections of JSON documents; Create, read, update, and delete the items (JSON documents) in your containers; Query...
Read more >
Stardog Platform Release Notes
There are multiple indices maintained by Stardog and as due to this bug the ... fails (#PLAT-3012); Cluster nodes expelled after sending a...
Read more >
Henry Been – DevOps & Azure Architect | Consultant ...
' But again, if you are using a CRM, GitHub issues or bug-tracking software for recording and detailing bugs, it doesn't really make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found