Azure / azure-cosmos-dotnet-v2

Contains samples and utilities relating to the Azure Cosmos DB .NET SDK
MIT License
577 stars 837 forks source link

Cosmos DB Emulator: Collection is not yet available for read. #815

Open mjgabriel opened 4 years ago

mjgabriel commented 4 years ago

Describe the bug Exception information from code, please note the emulator was already up and running before hitting it via service code.

ERROR - Collection is not yet available for read. Please retry in some time.
ActivityId: d7bc8d8d-ee85-46a8-8372-31e2a6ceabb4, Microsoft.Azure.Documents.Common/2.11.0, documentdb-dotnet-sdk/2.5.1 Host/32-bit MicrosoftWindowsNT/10.0.19041.0
Microsoft.Azure.Documents.DocumentClientException: Collection is not yet available for read. Please retry in some time.
ActivityId: d7bc8d8d-ee85-46a8-8372-31e2a6ceabb4, Microsoft.Azure.Documents.Common/2.11.0, documentdb-dotnet-sdk/2.5.1 Host/32-bit MicrosoftWindowsNT/10.0.19041.0
   at Microsoft.Azure.Documents.GatewayStoreClient.<ParseResponseAsync>d__8.MoveNext()

Error message reported by the emulator provided data explorer

{"code":503,"body":{"code":"ServiceUnavailable","message":"Service is currently unavailable.\r\nActivityId: 0a5f1976-0b2b-468a-a0f0-79b47a69a998, \r\nRequestStartTime: 2020-08-19T20:08:22.5152934Z, RequestEndTime: 2020-08-19T20:08:23.5236451Z,  Number of regions attempted:1\r\nResponseTime: 2020-08-19T20:08:22.5157920Z, StoreResult: StorePhysicalAddress: rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer1/partitions/a4cb494d-38c8-11e6-8106-8cdcd42c33be/replicas/1p/, LSN: 50, GlobalCommittedLsn: -1, PartitionKeyRangeId: , IsValid: True, StatusCode: 410, SubStatusCode: 1000, RequestCharge: 0, ItemLSN: -1, SessionToken: , UsingLocalLSN: True, TransportException: null, ResourceType: Document, OperationType: Query\r\nResponseTime: 2020-08-19T20:08:22.5187919Z, StoreResult: StorePhysicalAddress: rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer1/partitions/a4cb494d-38c8-11e6-8106-8cdcd42c33be/replicas/1p/, LSN: 50, GlobalCommittedLsn: -1, PartitionKeyRangeId: , IsValid: True, StatusCode: 410, SubStatusCode: 1000, RequestCharge: 0, ItemLSN: -1, SessionToken: , UsingLocalLSN: True, TransportException: null, ResourceType: Document, OperationType: Query\r\nResponseTime: 2020-08-19T20:08:23.5236451Z, StoreResult: StorePhysicalAddress: rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer1/partitions/a4cb494d-38c8-11e6-8106-8cdcd42c33be/replicas/1p/, LSN: 50, GlobalCommittedLsn: -1, PartitionKeyRangeId: , IsValid: True, StatusCode: 410, SubStatusCode: 1000, RequestCharge: 0, ItemLSN: -1, SessionToken: , UsingLocalLSN: True, TransportException: null, ResourceType: Document, OperationType: Query\r\n, Microsoft.Azure.Documents.Common/2.11.0"},"headers":{"x-ms-request-charge":0,"x-ms-documentdb-query-metrics":{}},"activityId":"0a5f1976-0b2b-468a-a0f0-79b47a69a998"}

To Reproduce Start emulator. Create container. You can access the container via code, the data explorer available at https://localhost:8081/_explorer/index.html You can access it via Storage Explorer. Shutdown emulator. Restart emulator. You can no longer access the container via code or the data explorer provided by the emulator.

Expected behavior I would expect the containers created to remain accessible between emulator usage sessions.

Actual behavior Can't access containers created during previous emulator session/usage.

Environment summary

SDK Version: Microsoft.Azure.DocumentDM 2.5.1 OS Version (e.g. Windows, Linux, MacOSX): Windows 10 Pro Build 19041

Additional context Please note, even using the data explorer provided via the emulator I can't access the container previously created.

vamanpnayak commented 3 years ago

I faced same issue as @mjgabriel.

Removing all collections/containers from local cosmos emulator DB resolved the issue.

vmachacek commented 1 year ago

I have same issue now, I cannot delete the collection as I get same error "Collection is not yet available for read"