Skip to content

Client initialization fails due to time-out on account read #1670

Closed

Description

he code that throws the error:

var database = Client.CreateDatabaseIfNotExistsAsync(DatabaseName).ConfigureAwait(false).GetAwaiter().GetResult().Database;
var containerTasks = ContainerDefinitions.Select(c => database.CreateContainerIfNotExistsAsync(c.Properties));
Task.WhenAll(containerTasks).ConfigureAwait(false).GetAwaiter().GetResult();

The stack trace:

'Type':'System.Threading.Tasks.TaskCanceledException',
'Message':'A task was canceled.','InnerExceptions':[],'StackTrace':[' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.ClientExtensions.<GetAsync>d__0.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.<GetMasterAddressesViaGatewayAsync>d__23.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.<ResolveMasterAsync>d__21.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.<TryGetAddressesAsync>d__19.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Cosmos.AddressResolver.<ResolveAddressesAndIdentityAsync>d__12.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Cosmos.AddressResolver.<ResolveAsync>d__9.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.AddressSelector.<ResolveAddressesAsync>d__5.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.AddressSelector.<ResolveAllUriAsync>d__3.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()',' at Microsoft.Azure.Documents.StoreReader.&lt;ReadMultipleReplicasInternalAsync&gt;d__13.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Documents.StoreReader.&lt;ReadMultipleReplicaAsync&gt;d__11.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Documents.QuorumReader.&lt;ReadQuorumAsync&gt;d__14.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at Microsoft.Azure.Documents.QuorumReader.&lt;ReadStrongAsync&gt;d__12.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Documents.ReplicatedResourceClient.&lt;&gt;c__DisplayClass27_0.&lt;&lt;InvokeAsync&gt;b__0&gt;d.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at Microsoft.Azure.Documents.RequestRetryUtility.&lt;ProcessRequestAsync&gt;d__22.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at Microsoft.Azure.Documents.ShouldRetryResult.ThrowIfDoneTrying(ExceptionDispatchInfo capturedException)',' at Microsoft.Azure.Documents.RequestRetryUtility.<ProcessRequestAsync>d__2`2.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.StoreClient.<ProcessMessageAsync>d__19.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at Microsoft.Azure.Documents.ServerStoreModel.<ProcessMessageAsync>d__15.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()',' at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)',' at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)',' at Microsoft.Azure.Cosmos.Handlers.TransportHandler.<ProcessMessageAsync>d__3.MoveNext()','--- End of stack trace from previous location where exception was thrown ---',' at Syste

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions