Azure / azure-cosmosdb-bulkexecutor-dotnet-getting-started

Bulk Executor Utility for Azure Cosmos DB .NET SQL API
MIT License
66 stars 41 forks source link

The requested resource is no longer available at the server #56

Open coccor opened 5 years ago

coccor commented 5 years ago

We are exporting data from our on-premise sql database to cosmos db. Recently we started getting this error all the time:

Microsoft.Azure.Documents.DocumentClientException: Partition range id 1 | Failed to import mini-batch. Exception was Message: {"Errors":["Encountered exception while executing function. Exception = Error: {\"Errors\":[\"The requested resource is no longer available at the server.\"]}\r\nStack trace: Error: {\"Errors\":[\"The requested resource is no longer available at the server.\"]}\n at createCallback (__.sys.commonBulkInsert.js:6236:26)\n at Anonymous function (__.sys.commonBulkInsert.js:758:29)"]} ActivityId: a1a87bae-0f63-4e1d-9c63-2691087c3418, Request URI: /apps/47cc183b-8aaa-487d-8cbd-6e027a0e8189/services/26b588ac-2b7c-4be5-a2af-2ab06457fd12/partitions/5ad42c87-01af-4ebc-b13b-d6fa5b3cfd07/replicas/132069324516526529p/, RequestStats: RequestStartTime: 2019-07-10T13:34:45.2174553Z, RequestEndTime: 2019-07-10T13:34:45.3580856Z, Number of regions attempted: 1 ResponseTime: 2019-07-10T13:34:45.3580856Z, StoreResult: StorePhysicalAddress: rntbd://cdb-ms-prod-centralus1-fd16.documents.azure.com:14038/apps/47cc183b-8aaa-487d-8cbd-6e027a0e8189/services/26b588ac-2b7c-4be5-a2af-2ab06457fd12/partitions/5ad42c87-01af-4ebc-b13b-d6fa5b3cfd07/replicas/132069324516526529p/, LSN: 791965, GlobalCommittedLsn: 791965, PartitionKeyRangeId: 1, IsValid: True, StatusCode: 400, SubStatusCode: 410, RequestCharge: 75.72, ItemLSN: -1, SessionToken: -1#791965, UsingLocalLSN: False, TransportException: null, ResourceType: StoredProcedure, OperationType: ExecuteJavaScript

Possible useful info: The collection size grew to nearly 10 GB and we now have 2 partitions (we used to have only 1) The partition key is set to the \id and the \id is the original sql object id

This is blocking us, as we are no longer able to export data to cosmos db.

coccor commented 5 years ago

I tried this again to see if this happens with a new collection and it did. After 10GB a new partition was created and I started getting that error again.

acdf-pue commented 4 years ago

Did you solve the problem? I'm using pyspark instead, but I'm stucked on this, any idea or cause will be very grateful.

coccor commented 4 years ago

Yes I did manage to fix this. It turns out this was caused because we were setting the id to an integer value. After converting the id to a string everything started working again.

acdf-pue commented 4 years ago

Ok, thank you for your quick response. I don't think this is the cause of my problem. I think it's related with the recreation of the collection with the same name, but i'm not sure yet. Thanks!

dmitriy-kostianetskiy commented 4 years ago

@acdf-pue did you managed to solve the issue? I think I have the same

acdf-pue commented 4 years ago

Hello Redrick. Sorry, but I didn't. Even Azure couldn't help us. In our case it seems is related with a nested key (client.id). Now we are using a simple one without levels (clientId) and it works fine. I hope it helps.