We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.
Describe the bug
I described the bug in a blog post: A strange bug in Azure Cosmos DB SQL API account (SDK Version 3 Preview)
To Reproduce
Steps to reproduce the behavior. If you can include code snippets or links to repositories containing a repro of the issue that can help us in detecting the scenario it would speed up the resolution.
Expected behavior
A clear and concise description of what you expected to happen.
Actual behavior
Error: System.AggregateException: One or more errors occurred. (Exception has been thrown by the target of an invocation.) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(Boolean overflow, String overflowResourceKey)
at System.Double.Parse(String s)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.<>c__DisplayClass43_0.b__3(String value)
at Microsoft.Azure.Cosmos.CosmosCustomHeader.Set(String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersBase.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.ExecuteHttpRequestAsync(Func1 callbackMethod, Func3 callShouldRetry, Func3 callShouldRetryException, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.Azure.Cosmos.ExecUtils.<>c__DisplayClass3_01.b__0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at CosmosGettingStartedDotnetCoreTutorial.Program.ReplaceFamilyItem() in D:\CosmosGettingStartedDotnetCoreTutorial\CosmosGettingStartedDotnetCoreTutorial\Program.cs:line 210
at CosmosGettingStartedDotnetCoreTutorial.Program.GetStartedDemoAsync() in D:\CosmosGettingStartedDotnetCoreTutorial\CosmosGettingStartedDotnetCoreTutorial\Program.cs:line 75
at CosmosGettingStartedDotnetCoreTutorial.Program.Main(String[] args) in D:\CosmosGettingStartedDotnetCoreTutorial\CosmosGettingStartedDotnetCoreTutorial\Program.cs:line 30
---> (Inner Exception #0) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(Boolean overflow, String overflowResourceKey)
at System.Double.Parse(String s)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.<>c__DisplayClass43_0.b__3(String value)
at Microsoft.Azure.Cosmos.CosmosCustomHeader.Set(String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersBase.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.ExecuteHttpRequestAsync(Func1 callbackMethod, Func3 callShouldRetry, Func3 callShouldRetryException, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)<---
End of demo, press any key to exit
Environment summary
SDK Version: 3.0.0.1-preview
OS Version (e.g. Windows, Linux, MacOSX): Windows 10 Version 809
Additional context
Add any other context about the problem here (for example, complete stack traces or logs).
@MaherJendoubi Is your application running dotnet Core or full framework? Which version?
@ealsur it's running .NET Core 3.0 Preview 1 version.
@MaherJendoubi I created a Net Core 3.0 project here https://github.com/ealsur/cosmosv3sample and it works using the credentials of a live account, I went through the tutorial as your post describes. Do you have a repo you can share that is experiencing the issue?
@ealsur I run your sample. This is what I get :
Created Database: FamilyDatabase
Created Container: FamilyContainer
The thread 14916 has exited with code 0 (0x0).
Item in database with id: Andersen.1 already exists
Item in database with id: Wakefield.7 already exists
Running query: SELECT * FROM c WHERE c.LastName = 'Andersen'
Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App3.0.0-preview-27122-01Microsoft.CSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Read {"id":"Andersen.1","LastName":"Andersen","Parents":[{"FamilyName":null,"FirstName":"Thomas"},{"FamilyName":null,"FirstName":"Mary Kay"}],"Children":[{"FamilyName":null,"FirstName":"Henriette Thaulow","Gender":"female","Grade":5,"Pets":[{"GivenName":"Fluffy"}]}],"Address":{"State":"WA","County":"King","City":"Seattle"},"IsRegistered":true}
The thread 9664 has exited with code 0 (0x0).
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll
Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App3.0.0-preview-27122-01System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App3.0.0-preview-27122-01System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App3.0.0-preview-27122-01System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Error: System.AggregateException: One or more errors occurred. (Exception has been thrown by the target of an invocation.) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(Boolean overflow, String overflowResourceKey)
at System.Double.Parse(String s)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.<>c__DisplayClass43_0.
at Microsoft.Azure.Cosmos.CosmosCustomHeader.Set(String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersBase.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.ExecuteHttpRequestAsync(Func1 callbackMethod, Func3 callShouldRetry, Func`3 callShouldRetryException, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.Azure.Cosmos.ExecUtils.<>c__DisplayClass3_01.<ProcessResourceOperationAsync>b__0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at ConsoleApp1.Program.ReplaceFamilyItem() in C:UsersM_JendoubiDocumentsGitHubcosmosv3sampleProgram.cs:line 99
at ConsoleApp1.Program.GetStartedDemoAsync() in C:UsersM_JendoubiDocumentsGitHubcosmosv3sampleProgram.cs:line 51
at ConsoleApp1.Program.Main(String[] args) in C:UsersM_JendoubiDocumentsGitHubcosmosv3sampleProgram.cs:line 260
---> (Inner Exception #0) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormatException(Boolean overflow, String overflowResourceKey)
at System.Double.Parse(String s)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.<>c__DisplayClass43_0.
at Microsoft.Azure.Cosmos.CosmosCustomHeader.Set(String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersBase.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.ExecuteHttpRequestAsync(Func1 callbackMethod, Func3 callShouldRetry, Func`3 callShouldRetryException, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.SendAsync(CosmosRequestMessage request, CancellationToken cancellationToken)<---
End of demo, press any key to exit.
Loaded 'C:Program FilesdotnetsharedMicrosoft.NETCore.App3.0.0-preview-27122-01System.Resources.ResourceManager.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.InvalidOperationException' in System.Console.dll
@MaherJendoubi Is this to a live account or the Emulator?
@ealsur It is a live account.
@ealsur How can we troubleshoot this issue?
@MaherJendoubi It seems from the stacktrace that some header does not have a valid value, although I'm not sure how using NET Core 3 might generate it.
If you switch to NET Core 2.1, does it repro? Since NET Core 3 is preview, we have not tested it.
@ealsur I am switching to .NET Core 2.2
位 dotnet --list-sdks
2.1.200 [C:Program Filesdotnetsdk]
2.1.201 [C:Program Filesdotnetsdk]
2.1.202 [C:Program Filesdotnetsdk]
2.1.300 [C:Program Filesdotnetsdk]
2.1.400 [C:Program Filesdotnetsdk]
2.1.401 [C:Program Filesdotnetsdk]
2.1.402 [C:Program Filesdotnetsdk]
2.1.403 [C:Program Filesdotnetsdk]
2.1.500 [C:Program Filesdotnetsdk]
2.1.600-preview-009426 [C:Program Filesdotnetsdk]
2.2.100 [C:Program Filesdotnetsdk]
3.0.100-preview-009812 [C:Program Filesdotnetsdk]
@ealsur same error with .NET Core 2.2
@ealsur it also repro with .NET Core 2.1
Could you share a Read-Only key for that account and account name to maquaran at microsoft.com? I want to test and see what is the response coming from the account that has an invalid request charge.
@ealsur done.
@ealsur FYI, I am using France Central region.
We synced and it seems its affecting only one machine, the same code runs in another VM.
The same code runs in the VM hosted in my machine but does not on my machine. I keep investigations using Fiddler and Wireshark to know the root cause of this issue. With Fiddler, we notice the direct effect which is that the requests are missing headers.
I've got the same problem. Tried to run a few times, it crashed in different steps. After deleting the db, this is what I get (using emulator v2.1.3.0, tried with dotnetcore 2.0, 2.1 and 2.2):
`Beginning operations...
Error: System.AggregateException: One or more errors occurred. (Exception has been thrown by the target of an invocation.) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.
--- 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.Cosmos.Handlers.AbstractRetryHandler.
--- 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.Cosmos.Handlers.AbstractRetryHandler.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.Azure.Cosmos.ExecUtils.<>c__DisplayClass3_01.1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- 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.Cosmos.CosmosDatabases.
--- 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 System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at CosmosGettingStartedDotnetCoreTutorial.Program.<CreateDatabase>d__9.MoveNext() in C:\Projects\CosmosDbSamples\cosmos-dotnet-core-getting-started\CosmosGettingStartedDotnetCoreTutorial\Program.cs:line 74
--- 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 CosmosGettingStartedDotnetCoreTutorial.Program.<GetStartedDemoAsync>d__8.MoveNext() in C:\Projects\CosmosDbSamples\cosmos-dotnet-core-getting-started\CosmosGettingStartedDotnetCoreTutorial\Program.cs:line 59
--- 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 CosmosGettingStartedDotnetCoreTutorial.Program.<Main>d__7.MoveNext() in C:\Projects\CosmosDbSamples\cosmos-dotnet-core-getting-started\CosmosGettingStartedDotnetCoreTutorial\Program.cs:line 34
---> (Inner Exception #0) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at Microsoft.Azure.Cosmos.CosmosResponseMessageHeaders.set__requestCharge(String value)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Microsoft.Azure.Cosmos.CosmosMessageHeadersInternal.Add(String headerName, String value)
at Microsoft.Azure.Cosmos.Extensions.ToCosmosResponseMessage(DocumentServiceResponse response, CosmosRequestMessage requestMessage)
at Microsoft.Azure.Cosmos.Handlers.TransportHandler.<SendAsync>d__2.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.Cosmos.Handlers.AbstractRetryHandler.<ExecuteHttpRequestAsync>d__2.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.Cosmos.Handlers.AbstractRetryHandler.<SendAsync>d__1.MoveNext()<---
@larserikfinholt @MaherJendoubi Could you confirm if in the environment you are facing the issue, the culture is set to use a different decimal separator? Trying to confirm if what I found is related to your scenario.
@ealsur How to know it?
@ealsur My Laptop is a French OS while my on-prem VM and my Azure VM are English OS.
Was able to repro when setting Region to France, thanks @MaherJendoubi
@ealsur That's great! Thanks Matias.
@ealsur How did you find out that it may be a Culture problem?
@MaherJendoubi Just thinking about the code path, the exception and the fact that it was working in a VM, I guess it just was an idea and I tried and was able to repro, but was not sure your case was the same 馃槃
@MaherJendoubi The fix was merged and will be included in the next preview release
@ealsur where can I see the fix code?
I also just ran into this one. Any idea when the next preview release will be out, @ealsur ?
New version with the fix is released https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.0.0.9-preview
@kirankumarkolli thanks a lot!
I just ran into this one my self. Very hard to debug. Exists on both versions 3.0.0.9 and .10
Workaround:
Setting culture info before calling FetchNextSetAsync() seems to work.
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("en-gb");
Should I create a new bug about this?
I still have the same issue on version 3.0.0.19-preview. The workaround setting culture info from "fr-fr" to "en-gb" works.
I write a document that is serialized with double typed properties:
"latitude": 47.5842916606069, "longitude": 5.36402467619632,
I notice value contains a dot, as I would except in a Json file.
I think in the culture "fr", the parse function expects a comma instead of a dot.
I don't have the issue with the Container.ReadItemAsync
Container.GetItemLinqQueryable
Container.GetItemQueryIterator
@Ozzian and @Anthony-Breneliere is this only and issue in query?
I don't know I only tested the methods GetItemLinqQueryable, GetItemQueryIterator and ReadItemAsync. The last one ReadItemAsync parsed the document correctly.
@Anthony-Breneliere I'll try creating a test for this later today. Are you still seeing this in the 3.0.0 GA release?
@j82w I just tested it and yes I still have the issue with version 3.0.0.
To test it just store a float value like a _latitude = 47.651651651_ in CosmosDb, and run a query that returns it.
At the begining of the test add:
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("fr-FR");
Hi,
Run into this one today with Cosmos DB Emulator (2.4.5.0 ddf424be) and Microsoft.EntityFrameworkCore.Cosmos provider (3.0.0-preview6.19304.10).
Found one more ticket in EF repo : https://github.com/aspnet/EntityFrameworkCore/issues/16153 with easy steps to reproduce.
Workaround:
Setting culture info before calling FetchNextSetAsync() seems to work.
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("en-gb");
@Ozzian nice idea! I've spent ~2 hours trying different versions of CosmosDB provider and .Net Core without any result, but your workaround looks like the most suitable one.
@Anthony-Breneliere and @Ozzian I created a new issue to track this: #542
Most helpful comment
I just ran into this one my self. Very hard to debug. Exists on both versions 3.0.0.9 and .10
Workaround:
Setting culture info before calling FetchNextSetAsync() seems to work.
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo("en-gb");Should I create a new bug about this?