Open lukepuplett opened 3 years ago
Creating tables in the Azure portal via the Data Explorer works, so whatever SDK that's using behind the scenes is working okay :-D
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Wmengmsft, @MehaKaushik, @AverageDesigner.
Author: | lukepuplett |
---|---|
Assignees: | - |
Labels: | `Client`, `Cosmos`, `Service Attention`, `customer-reported`, `needs-team-attention`, `needs-triage`, `question` |
Milestone: | - |
Thank you for your feedback. Tagging and routing to the team best able to assist.
News just in: after making all the tables in the portal, I was able to run and use my app, confirming that the programmatic creation of tables seems to be the issue, and that a workaround is to preconfigure what you need.
Hello, today I have another issue which might be related.
The related part is the lack of error from CreateIfNotExist()
when creating the 6th unlimited table against a Cosmos DB Emulator. The documentation says that (before I upped the default PartitionCount) I should have experienced an error upon creation of the 6th. Instead it works and I can write to it but segmented queries fail.
Update
I see this was "transferred" (thanks) but I don't know how to leap over to the issue wherever it's now gone. Anyway, I just wanted to add that the "but segmented queries fail" part is incorrect; the problem was my rubbish code. However, the original quirk about it not reporting a problem creating a 6th unlimited collection still remains, I think.
@lukepuplett We're tracking a bug that prevents the creation of serverless tables in direct mode. It should work if you create your table client like:
CreateCloudTableClient(new TableClientConfiguration
{
UseRestExecutorForCosmosEndpoint = true
});
@ThomasWeiss Thank you for following up quickly. I can try that. My code for creating a table client instance is DRY, so I'm concerned about the ramifications for all my other operations, data reads and writes.
I guess my question is: does using the "REST executor" have any impact on anything else? I assume it does, else it would be true
by default. Thanks. Sorry to be a pain.
@lukepuplett This configuration will put you in "gateway mode" as opposed to "direct mode", which may impact request latency to some extent. This should only be a concern if your workload is very latency-sensitive.
Adding more recent error message.
Reading or replacing offers is not supported for serverless accounts.
I've not gotten around to patching my app with the fix yet as it's only one environment that's effected and I've had other items to squash first :)
Happy to confirm this bug still exists in space year 2022. It's rearing its ugly head in the dt
"blessed" tool for performing Cosmos DB migrations. Here's a sample stack trace:
Critical error: Microsoft.Azure.Documents.DocumentClientException: Setting offer throughput or autopilot on container is not supported for serverless accounts. ActivityId: 4555ba7d-902c-4426-b197-e664424e9186, Microsoft.Azure.Documents.Common/2.14.0, documentdb-dotnet-sdk/2.2.1 Host/64-bit MicrosoftWindowsNT/6.2.9200.0
at Microsoft.Azure.Documents.Client.ClientExtensions.<ParseResponseAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.GatewayStoreModel.<>c__DisplayClass21_0.<<InvokeAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass1_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetryAsync>d__5.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.BackoffRetryUtility`1.<ExecuteRetryAsync>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.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.GatewayStoreModel.<InvokeAsync>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.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.GatewayStoreModel.<ProcessMessageAsync>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.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.Client.DocumentClient.<CreateAsync>d__305.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.Client.DocumentClient.<CreateDocumentCollectionPrivateAsync>d__150.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass1_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetryAsync>d__5.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.BackoffRetryUtility`1.<ExecuteRetryAsync>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.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DataTransfer.DocumentDb.Client.DocumentDbClient.<GetOrCreateCollectionAsyncInternal>d__4.MoveNext() in d:\a\1\s\DocumentDb\Microsoft.DataTransfer.DocumentDb\Client\DocumentDbClient.cs:line 70
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DataTransfer.DocumentDb.Sink.Parallel.DocumentDbParallelSinkAdapter.<InitializeAsync>d__4.MoveNext() in d:\a\1\s\DocumentDb\Microsoft.DataTransfer.DocumentDb\Sink\Parallel\DocumentDbParallelSinkAdapter.cs:line 26
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DataTransfer.DocumentDb.Sink.Parallel.DocumentDbParallelSinkAdapterInternalFactory.<CreateAsync>d__2.MoveNext() in d:\a\1\s\DocumentDb\Microsoft.DataTransfer.DocumentDb\Sink\Parallel\DocumentDbParallelSinkAdapterInternalFactory.cs:line 30
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DataTransfer.Core.Service.DataTransferService.<TransferAsync>d__6.MoveNext() in d:\a\1\s\Core\Microsoft.DataTransfer.Core\Service\DataTransferService.cs:line 70
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DataTransfer.ConsoleHost.App.Handlers.OneTimeDataTransferHandler.<RunAsync>d__6.MoveNext() in d:\a\1\s\Console\Microsoft.DataTransfer.ConsoleHost\App\Handlers\OneTimeDataTransferHandler.cs:line 51
This fails when:
Sample command line:
dt.exe /ErrorDetails:All `
/s:DocumentDB `
/s.ConnectionString:"$sourceConnStr" ` # Scrubbed because API keys
/s.Collection:"Companies" `
/s.ConnectionMode:Gateway `
/s.Query:"SELECT * FROM c" `
/t:DocumentDB `
/t.ConnectionString:"$targetConnStr" ` # Scrubbed because API keys
/t.Collection:"Companies" `
/t.PartitionKey:"organisationId" `
/t.IdField:"id" `
/t.UpdateExisting:true `
/t.ConnectionMode:Gateway
Is there any workaround for this? Even the official tool seems to be affected by the problem:
Describe the bug
When calling
cloudTable.CreateIfNotExistsAsync()
against a new serverless Cosmos DB account (the table does not already exist in my case) it throws with the following message.See other people experiencing same issue.
https://docs.microsoft.com/en-us/answers/questions/94814/cosmos-quick-start-gt-create-items-contaner-gt-htt.html
Expected behavior
To create the table if it doesn't exist and return, or return without change.
Actual behavior (include Exception or Stack Trace)
To Reproduce
CloudTableClient
and aCloudTable
instance referring to a table that does not exist..CreateIfNotExistsAsync()
and observe the error.Environment: