You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I tried to update a quite old service to 2.6.10 and using the builder to construct an AsyncDocumentClient immediately throws a DocumentClientException with message Request url is invalid. The exactly same connection string/ endpoint-key-pair is used as before. Downgrading to 2.3 (or 2.2 or 2.1) makes it disappear.
To Reproduce
The following code creates the client:
// endpointKeyPair contains the values from ConnectionString, AccountEndpoint=getFirst() resp. AccountKey=getSecond
new AsyncDocumentClient.Builder()
.withMasterKeyOrResourceToken(endpPointKeyPair.getSecond())
.withServiceEndpoint(endpPointKeyPair.getFirst())
.withConnectionPolicy(ConnectionPolicy.GetDefault())
.withConsistencyLevel(ConsistencyLevel.ConsistentPrefix).build();
Expected behavior
AsyncDocumentClient is created without an exception/ as in versions before 2.4.0.
Actual behavior
throws DocumentClientException, clearly shows resourceAddress='null' but also responseHeaders="…Content-Location=https://.azure.com/;AccountKey="
Environment summary
SDK Version: 2.4.0 onwards
Java JDK version: 8
OS Version (e.g. Windows, Linux, MacOSX) Linux
Additional context
Only downgrading in pom.xml to versions before 2.4.0 makes it disappear and a working AsyncDocumentClient is created. It is also quite hard to spot the difference if esp. the withMasterKeyOrResourceToken-method didn't change, neither its documentation nor tags like @deprecated with a replacement. I assume the URL itself is not handled here but in the underlying Cosmos-library.
The text was updated successfully, but these errors were encountered:
Found the answer hidden in the details of URL-parsing. With 2.4 and its dependencies parsing is less tolerant. The URL contained the full connection string incl. ;AccountKey. Whereas this is syntactically corrrect – URL-parameters can be appended by ';' – underlying GatewayServiceConfigurationReader and others how hiccup.
Describe the bug
I tried to update a quite old service to 2.6.10 and using the builder to construct an AsyncDocumentClient immediately throws a DocumentClientException with message Request url is invalid. The exactly same connection string/ endpoint-key-pair is used as before. Downgrading to 2.3 (or 2.2 or 2.1) makes it disappear.
To Reproduce
The following code creates the client:
Expected behavior
AsyncDocumentClient is created without an exception/ as in versions before 2.4.0.
Actual behavior
throws DocumentClientException, clearly shows resourceAddress='null' but also responseHeaders="…Content-Location=https://.azure.com/;AccountKey="
Environment summary
SDK Version: 2.4.0 onwards
Java JDK version: 8
OS Version (e.g. Windows, Linux, MacOSX) Linux
Additional context
Only downgrading in pom.xml to versions before 2.4.0 makes it disappear and a working AsyncDocumentClient is created. It is also quite hard to spot the difference if esp. the withMasterKeyOrResourceToken-method didn't change, neither its documentation nor tags like @deprecated with a replacement. I assume the URL itself is not handled here but in the underlying Cosmos-library.
The text was updated successfully, but these errors were encountered: