Response status code does not indicate success: BadRequest (400); Substatus: 1001; ActivityId: 68af0c72-ff2d-4055-8898-b94a08f18ead; Reason: ();
rakeshbimra opened this issue · 7 comments
While creating new item I am getting below error
"Response status code does not indicate success: BadRequest (400); Substatus: 1001; ActivityId: 68af0c72-ff2d-4055-8898-b94a08f18ead; Reason: ();"
Stack Trace:
at Microsoft.Azure.Cosmos.ResponseMessage.EnsureSuccessStatusCode()
at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.ProcessMessage[T](ResponseMessage responseMessage, Func2 createResponse) at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.CreateItemResponse[T](ResponseMessage responseMessage) at Microsoft.Azure.Cosmos.ContainerCore.<CreateItemAsync>d__54
1.MoveNext()
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.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.Cosmos.ClientContextCore.<RunWithDiagnosticsHelperAsync>d__39
1.MoveNext()
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.TaskAwaiter1.GetResult() at Microsoft.Azure.Cosmos.ClientContextCore.<OperationHelperWithRootTraceAsync>d__30
1.MoveNext()
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.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.CosmosRepository.DefaultRepository
1.d__7.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask1.get_Result() at System.Runtime.CompilerServices.ValueTaskAwaiter
1.GetResult()
at CardGroupEventSubscriber.Publishers.UINotificationPublisher.d__2.MoveNext() in C:\notification-subscribers\dev\Notification-Microservices\CardGroupEventSubscriber\CardGroupEventSubscriber\Publishers\UINotificationPublisher.cs:line 49
Below is my code:
public class UINotificationPublisher : IUINotificationPublisher
{
private readonly IRepository<Notifications> _uiNotificationsRepository;
public UINotificationPublisher(
IRepositoryFactory factory
)
{
_uiNotificationsRepository = factory.RepositoryOf<Notifications>();
}
public async Task PublishAsync(IEnumerable<UserSubscriptions> userSubscriptions, CardGroupEvent @event, ILogger logger)
{
try
{
var uiSubscriptions = userSubscriptions
.Where(x => x.Events.Any(y => y.EventType == (int)EventType.CARD_GROUP_CHANGED && y.Channels.Contains((int)ChannelType.UI)));
if (uiSubscriptions.Any())
{
logger.LogInformation($"UI notification subscriptions found, requestID:{@event.RequestID}");
List<Notifications> uiNotifications = new List<Notifications>();
foreach (var item in uiSubscriptions)
{
logger.LogInformation($"creating UI notification for UUID:{item.UUID}. requestID:{@event.RequestID}");
uiNotifications.Add(CreateItemAsync(item, @event));
logger.LogInformation($"successfully created UI Notification for UUID:{item.UUID}: {@event.RequestID}");
}
await _uiNotificationsRepository.CreateAsync(uiNotifications);
}
else
logger.LogInformation($"No UI notification subscriptions found: requestID:{@event.RequestID}");
}
catch (Exception ex)
{
throw ex;
}
}
private Notifications CreateItemAsync(UserSubscriptions userSubscription, CardGroupEvent @event)
{
Notifications notifications = new Notifications
{
Id = Guid.NewGuid().ToString(),
Created = DateTime.UtcNow,
RequestID = @event.RequestID,
NotificationType = (int)EventType.CARD_GROUP_CHANGED,
SubType = @event.EventSubType,
UserUUId = userSubscription.UUID,
Payer = @event.PayerNumber,
PayerName = @event.PayerName,
Account = @event.AccountNumber,
AccountName = @event.AccountName,
MetaData = GetMetaData(@event),
Status = (int)NotificationStatus.UnRead
};
return notifications;
}
private Dictionary<string, string> GetMetaData(CardGroupEvent @event)
{
var metaData = new Dictionary<string, string>();
metaData.Add(nameof(@event.AccountNumber), @event.AccountNumber);
metaData.Add(nameof(@event.AccountName), @event.AccountName);
return metaData;
}
}
Hi @rakeshbimra would you be able to share the full error? Cosmos DB usually logs a JSON body with some more details on the 400 response.
Hi, I tried with another object, now I got to know why this issue is coming:
For example: If I define PartitionKeyPath in Pascal case(as shown in the below object), then it is throwing the error.
[Container("Employee")]
[PartitionKeyPath("/EmployeeId")]
public class Employee : Item
{
[JsonProperty("EmployeeId")]
public string EmployeeId { get; set; }
[JsonProperty("FirstName")]
public string FirstName { get; set; }
[JsonProperty("LastName")]
public string LastName { get; set; }
protected override string GetPartitionKeyValue() => EmployeeId;
}
When I am trying to add new item for above object I am getting below error:
Microsoft.Azure.Cosmos.CosmosException : Response status code does not indicate success: BadRequest (400); Substatus: 1001; ActivityId: 62f88a7a-952f-41ef-9bd3-1c09df77df0d; Reason: ();
at Microsoft.Azure.Cosmos.ResponseMessage.EnsureSuccessStatusCode()
at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.ProcessMessage[T](ResponseMessage responseMessage, Func2 createResponse) at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.CreateItemResponse[T](ResponseMessage responseMessage) at Microsoft.Azure.Cosmos.ContainerCore.CreateItemAsync[T](T item, ITrace trace, Nullable
1 partitionKey, ItemRequestOptions requestOptions, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.ClientContextCore.RunWithDiagnosticsHelperAsync[TResult](ITrace trace, Func2 task) at Microsoft.Azure.Cosmos.ClientContextCore.OperationHelperWithRootTraceAsync[TResult](String operationName, RequestOptions requestOptions, Func
2 task, TraceComponent traceComponent, TraceLevel traceLevel)
at Microsoft.Azure.CosmosRepository.DefaultRepository1.CreateAsync(TItem value, CancellationToken cancellationToken) at Microsoft.Azure.CosmosRepository.DefaultRepository
1.CreateAsync(IEnumerable1 values, CancellationToken cancellationToken) at lambda_method5(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask
1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
--- Cosmos Diagnostics ---{"Summary":{"DirectCalls":{"(207, 0)":1},"RegionsContacted":1,"GatewayCalls":{"(200, 0)":1}},"name":"CreateItemAsync","id":"8cc57a15-4351-4eae-862d-ce5ef0b705a6","caller info":{"member":"OperationHelperWithRootTraceAsync","file":"ClientContextCore.cs","line":244},"start time":"08:44:40:366","duration in milliseconds":511.5327,"data":{"Client Configuration":{"Client Created Time Utc":"2022-05-14T08:44:37.4047086Z","NumberOfClientsCreated":1,"User Agent":"cosmos-netstandard-sdk/3.23.0|3.23.1|1|X64|Microsoft Windows 10.0.22000|.NET 6.0.5|N|F 00000011|","ConnectionConfig":{"gw":"(cps:50, urto:10, p:False, httpf: True)","rntbd":"(cto: 5, icto: -1, mrpc: 30, mcpe: 65535, erd: True, pr: ReuseUnicastPort)","other":"(ed:False, be:True)"},"ConsistencyConfig":"(consistency: NotSet, prgns:[])"}},"children":[{"name":"ItemSerialize","id":"a18e2702-d242-408f-8d42-b2a413ddd533","caller info":{"member":"ExtractPartitionKeyAndProcessItemStreamAsync","file":"ContainerCore.Items.cs","line":941},"start time":"08:44:40:372","duration in milliseconds":9.3449},{"name":"Get Collection Cache","id":"b5cb7ba0-b762-4126-88c1-edd0a79beee5","caller info":{"member":"GetCollectionCacheAsync","file":"DocumentClient.cs","line":546},"start time":"08:44:40:446","duration in milliseconds":0.0092},{"name":"Batch Dispatch Async","id":"2d3fc9e8-025f-4c38-800e-207f061df215","caller info":{"member":"DispatchAsync","file":"BatchAsyncBatcher.cs","line":124},"start time":"08:44:40:591","duration in milliseconds":284.0741,"children":[{"name":"Using Wait","id":"115599cf-99b7-4304-b566-8e9642869a9b","caller info":{"member":"UsingWaitAsync","file":"Extensions.cs","line":189},"start time":"08:44:40:740","duration in milliseconds":0.0505},{"name":"Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler","id":"24552172-b290-4d46-a477-fcefe15f855c","start time":"08:44:40:740","duration in milliseconds":104.7389,"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler","id":"df46c23f-ac0b-4b19-8965-05a9cf927111","start time":"08:44:40:741","duration in milliseconds":103.7768,"data":{"System Info":{"systemHistory":[{"dateUtc":"2022-05-14T08:44:39.4818499Z","cpu":6.211,"memory":6575452.000,"threadInfo":{"isThreadStarving":"no info","availableThreads":32765,"minThreads":8,"maxThreads":32767}}]}},"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.RetryHandler","id":"ae7996aa-2277-4bb3-b12c-9a4130741ccd","start time":"08:44:40:741","duration in milliseconds":103.762,"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.RouterHandler","id":"f61dcd1d-765e-4b33-a678-93ea62b2eb72","start time":"08:44:40:741","duration in milliseconds":103.7365,"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.TransportHandler","id":"4a72fbf9-e09b-4aba-bd97-4695a570c233","start time":"08:44:40:741","duration in milliseconds":103.7301,"children":[{"name":"Microsoft.Azure.Documents.ServerStoreModel Transport Request","id":"9e5b3de7-8546-450d-8310-f6dc6ef504e5","caller info":{"member":"ProcessMessageAsync","file":"TransportHandler.cs","line":109},"start time":"08:44:40:742","duration in milliseconds":103.4108,"data":{"Client Side Request Stats":{"Id":"AggregatedClientSideRequestStatistics","ContactedReplicas":[{"Count":12,"Uri":"rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer0/partitions/a4cb494c-38c8-11e6-8106-8cdcd42c33be/replicas/1p/"}],"RegionsContacted":["https://127.0.0.1:8081/"],"FailedReplicas":[],"AddressResolutionStatistics":[{"StartTimeUTC":"2022-05-14T08:44:40.7532755Z","EndTimeUTC":"2022-05-14T08:44:40.7636993Z","TargetEndpoint":"https://127.0.0.1:8081//addresses/?$resolveFor=dbs%2f0DAwAA%3d%3d%2fcolls%2f0DAwAMV-5Uc%3d%2fdocs&$filter=protocol eq rntbd&$partitionKeyRangeIds=0"}],"StoreResponseStatistics":[{"ResponseTimeUTC":"2022-05-14T08:44:40.8391066Z","ResourceType":"Document","OperationType":"Batch","LocationEndpoint":"https://127.0.0.1:8081/","StoreResult":{"ActivityId":"62f88a7a-952f-41ef-9bd3-1c09df77df0d","StatusCode":"MultiStatus","SubStatusCode":"Unknown","LSN":25,"PartitionKeyRangeId":"0","GlobalCommittedLSN":-1,"ItemLSN":-1,"UsingLocalLSN":false,"QuorumAckedLSN":25,"SessionToken":"-1#25","CurrentWriteQuorum":1,"CurrentReplicaSetSize":1,"NumberOfReadRegions":0,"IsValid":true,"StorePhysicalAddress":"rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer0/partitions/a4cb494c-38c8-11e6-8106-8cdcd42c33be/replicas/1p/","RequestCharge":1.24,"RetryAfterInMs":null,"BELatencyInMs":"0.48","transportRequestTimeline":{"requestTimeline":[{"event": "Created", "startTimeUtc": "2022-05-14T08:44:40.8058064Z", "durationInMs": 0.0281},{"event": "ChannelAcquisitionStarted", "startTimeUtc": "2022-05-14T08:44:40.8058345Z", "durationInMs": 26.0951},{"event": "Pipelined", "startTimeUtc": "2022-05-14T08:44:40.8319296Z", "durationInMs": 5.9906},{"event": "Transit Time", "startTimeUtc": "2022-05-14T08:44:40.8379202Z", "durationInMs": 0.7719},{"event": "Received", "startTimeUtc": "2022-05-14T08:44:40.8386921Z", "durationInMs": 0.3489},{"event": "Completed", "startTimeUtc": "2022-05-14T08:44:40.8390410Z", "durationInMs": 0}],"requestSizeInBytes":516,"requestBodySizeInBytes":170,"responseMetadataSizeInBytes":239,"responseBodySizeInBytes":47},"TransportException":null}}],"HttpResponseStats":[{"StartTimeUTC":"2022-05-14T08:44:40.7533210Z","DurationInMs":9.3191,"RequestUri":"https://127.0.0.1:8081//addresses/?$resolveFor=dbs%2f0DAwAA%3d%3d%2fcolls%2f0DAwAMV-5Uc%3d%2fdocs&$filter=protocol eq rntbd&$partitionKeyRangeIds=0","ResourceType":"Document","HttpMethod":"GET","ActivityId":"62f88a7a-952f-41ef-9bd3-1c09df77df0d","StatusCode":"OK"}]}}}]}]}]}]}]},{"name":"Create Trace","id":"f65c9368-245a-4eca-bd97-f66f69512cee","caller info":{"member":"FromResponseMessageAsync","file":"TransactionalBatchResponse.cs","line":214},"start time":"08:44:40:847","duration in milliseconds":18.8027}]}]}
I deleted Employee container and I tried PartitionKeyPath name with camel case it is working fine.
[Container("Employee")]
[PartitionKeyPath("/employeeId")]
public class Employee : Item
{
[JsonProperty("employeeId")]
public string EmployeeId { get; set; }
[JsonProperty("FirstName")]
public string FirstName { get; set; }
[JsonProperty("LastName")]
public string LastName { get; set; }
protected override string GetPartitionKeyValue() => EmployeeId;
}
So is this library only supporting PartitionKeyPath name in camel case?
Okay I think @IEvangelist ran into this problem as well a few months back.
Have you tried setting the serialised options on RepositoryOptions
if you see here
It defaults to camel case unless overridden.
I tried but still getting the same issue
builder.Services.AddCosmosRepository(options =>
{
options.SerializationOptions = new Microsoft.Azure.CosmosRepository.Options.RepositorySerializationOptions
{
PropertyNamingPolicy = Microsoft.Azure.Cosmos.CosmosPropertyNamingPolicy.Default
};
});
Microsoft.Azure.Cosmos.CosmosException : Response status code does not indicate success: BadRequest (400); Substatus: 1001; ActivityId: af83319b-ef2b-4abc-93ec-357f214a1f48; Reason: ();
at Microsoft.Azure.Cosmos.ResponseMessage.EnsureSuccessStatusCode()
at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.ProcessMessage[T](ResponseMessage responseMessage, Func2 createResponse) at Microsoft.Azure.Cosmos.CosmosResponseFactoryCore.CreateItemResponse[T](ResponseMessage responseMessage) at Microsoft.Azure.Cosmos.ContainerCore.CreateItemAsync[T](T item, ITrace trace, Nullable
1 partitionKey, ItemRequestOptions requestOptions, CancellationToken cancellationToken)
at Microsoft.Azure.Cosmos.ClientContextCore.RunWithDiagnosticsHelperAsync[TResult](ITrace trace, Func2 task) at Microsoft.Azure.Cosmos.ClientContextCore.OperationHelperWithRootTraceAsync[TResult](String operationName, RequestOptions requestOptions, Func
2 task, TraceComponent traceComponent, TraceLevel traceLevel)
at Microsoft.Azure.CosmosRepository.DefaultRepository1.CreateAsync(TItem value, CancellationToken cancellationToken) at Microsoft.Azure.CosmosRepository.DefaultRepository
1.CreateAsync(IEnumerable1 values, CancellationToken cancellationToken) at lambda_method5(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask
1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
--- Cosmos Diagnostics ---{"Summary":{"DirectCalls":{"(207, 0)":1},"RegionsContacted":1,"GatewayCalls":{"(200, 0)":1}},"name":"CreateItemAsync","id":"2fad8e01-215e-4ab9-abcc-4c602bd22eab","caller info":{"member":"OperationHelperWithRootTraceAsync","file":"ClientContextCore.cs","line":244},"start time":"04:23:14:564","duration in milliseconds":511.9447,"data":{"Client Configuration":{"Client Created Time Utc":"2022-05-14T16:23:11.8202242Z","NumberOfClientsCreated":1,"User Agent":"cosmos-netstandard-sdk/3.23.0|3.23.1|1|X64|Microsoft Windows 10.0.22000|.NET 6.0.5|N|F 00000011|","ConnectionConfig":{"gw":"(cps:50, urto:10, p:False, httpf: True)","rntbd":"(cto: 5, icto: -1, mrpc: 30, mcpe: 65535, erd: True, pr: ReuseUnicastPort)","other":"(ed:False, be:True)"},"ConsistencyConfig":"(consistency: NotSet, prgns:[])"}},"children":[{"name":"ItemSerialize","id":"787e87d1-6842-4d9a-9c36-fe2fb04e8612","caller info":{"member":"ExtractPartitionKeyAndProcessItemStreamAsync","file":"ContainerCore.Items.cs","line":941},"start time":"04:23:14:569","duration in milliseconds":18.2076},{"name":"Get Collection Cache","id":"5b7fed76-4b1f-4550-bd27-5fb200fd2159","caller info":{"member":"GetCollectionCacheAsync","file":"DocumentClient.cs","line":546},"start time":"04:23:14:647","duration in milliseconds":0.007},{"name":"Batch Dispatch Async","id":"dd4506e8-6abf-4880-bdd6-1879919584d0","caller info":{"member":"DispatchAsync","file":"BatchAsyncBatcher.cs","line":124},"start time":"04:23:14:802","duration in milliseconds":271.6853,"children":[{"name":"Using Wait","id":"96445465-1301-4594-a764-7603288d4aab","caller info":{"member":"UsingWaitAsync","file":"Extensions.cs","line":189},"start time":"04:23:14:944","duration in milliseconds":0.0429},{"name":"Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler","id":"0a1be41d-9815-4aca-9948-c683e483ca19","start time":"04:23:14:944","duration in milliseconds":94.0321,"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler","id":"69abaa22-1db9-417e-976f-d68ee7afb54e","start time":"04:23:14:945","duration in milliseconds":92.7605,"data":{"System Info":{"systemHistory":[{"dateUtc":"2022-05-14T16:23:13.9006712Z","cpu":6.263,"memory":5479204.000,"threadInfo":{"isThreadStarving":"no info","availableThreads":32765,"minThreads":8,"maxThreads":32767}}]}},"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.RetryHandler","id":"2dbede1d-d52f-4e28-9659-029859ea65a9","start time":"04:23:14:945","duration in milliseconds":92.7151,"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.RouterHandler","id":"5954432d-ee8b-4d7f-88ba-7f42650d61e7","start time":"04:23:14:945","duration in milliseconds":92.6554,"children":[{"name":"Microsoft.Azure.Cosmos.Handlers.TransportHandler","id":"9b5e14e2-6984-4d8c-a958-b5affce0be7b","start time":"04:23:14:945","duration in milliseconds":92.6376,"children":[{"name":"Microsoft.Azure.Documents.ServerStoreModel Transport Request","id":"7efb3b93-0bcb-4dcd-a221-53fa58d6600e","caller info":{"member":"ProcessMessageAsync","file":"TransportHandler.cs","line":109},"start time":"04:23:14:945","duration in milliseconds":92.1329,"data":{"Client Side Request Stats":{"Id":"AggregatedClientSideRequestStatistics","ContactedReplicas":[{"Count":12,"Uri":"rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer0/partitions/a4cb494c-38c8-11e6-8106-8cdcd42c33be/replicas/1p/"}],"RegionsContacted":["https://127.0.0.1:8081/"],"FailedReplicas":[],"AddressResolutionStatistics":[{"StartTimeUTC":"2022-05-14T16:23:14.9648854Z","EndTimeUTC":"2022-05-14T16:23:14.9755754Z","TargetEndpoint":"https://127.0.0.1:8081//addresses/?$resolveFor=dbs%2f0DAwAA%3d%3d%2fcolls%2f0DAwAKEhSb0%3d%2fdocs&$filter=protocol eq rntbd&$partitionKeyRangeIds=0"}],"StoreResponseStatistics":[{"ResponseTimeUTC":"2022-05-14T16:23:15.0331138Z","ResourceType":"Document","OperationType":"Batch","LocationEndpoint":"https://127.0.0.1:8081/","StoreResult":{"ActivityId":"af83319b-ef2b-4abc-93ec-357f214a1f48","StatusCode":"MultiStatus","SubStatusCode":"Unknown","LSN":36,"PartitionKeyRangeId":"0","GlobalCommittedLSN":-1,"ItemLSN":-1,"UsingLocalLSN":false,"QuorumAckedLSN":36,"SessionToken":"-1#36","CurrentWriteQuorum":1,"CurrentReplicaSetSize":1,"NumberOfReadRegions":0,"IsValid":true,"StorePhysicalAddress":"rntbd://127.0.0.1:10253/apps/DocDbApp/services/DocDbServer0/partitions/a4cb494c-38c8-11e6-8106-8cdcd42c33be/replicas/1p/","RequestCharge":1.24,"RetryAfterInMs":null,"BELatencyInMs":"0.43","transportRequestTimeline":{"requestTimeline":[{"event": "Created", "startTimeUtc": "2022-05-14T16:23:15.0069415Z", "durationInMs": 0.0121},{"event": "ChannelAcquisitionStarted", "startTimeUtc": "2022-05-14T16:23:15.0069536Z", "durationInMs": 19.8772},{"event": "Pipelined", "startTimeUtc": "2022-05-14T16:23:15.0268308Z", "durationInMs": 5.2694},{"event": "Transit Time", "startTimeUtc": "2022-05-14T16:23:15.0321002Z", "durationInMs": 0.6716},{"event": "Received", "startTimeUtc": "2022-05-14T16:23:15.0327718Z", "durationInMs": 0.3268},{"event": "Completed", "startTimeUtc": "2022-05-14T16:23:15.0330986Z", "durationInMs": 0}],"requestSizeInBytes":516,"requestBodySizeInBytes":170,"responseMetadataSizeInBytes":239,"responseBodySizeInBytes":47},"TransportException":null}}],"HttpResponseStats":[{"StartTimeUTC":"2022-05-14T16:23:14.9649610Z","DurationInMs":9.8268,"RequestUri":"https://127.0.0.1:8081//addresses/?$resolveFor=dbs%2f0DAwAA%3d%3d%2fcolls%2f0DAwAKEhSb0%3d%2fdocs&$filter=protocol eq rntbd&$partitionKeyRangeIds=0","ResourceType":"Document","HttpMethod":"GET","ActivityId":"af83319b-ef2b-4abc-93ec-357f214a1f48","StatusCode":"OK"}]}}}]}]}]}]}]},{"name":"Create Trace","id":"d0954eb9-105e-490c-8973-fafc4b8a27a4","caller info":{"member":"FromResponseMessageAsync","file":"TransactionalBatchResponse.cs","line":214},"start time":"04:23:15:040","duration in milliseconds":18.2378}]}]}
We have serious trouble about it as well. Further more, the JsonProperty is not overrided what we are excpecting. To be clear, How can we use the default serializer with camelCase default options and taking the JsonProperty in account ?
How can we do that ??
var jsonSerializerSettings = new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver { NamingStrategy = new CamelCaseNamingStrategy() },
}
Because in our legacy model, we have a mixed of PascalCase and camelCase properties.
It starated working when I am using CosmosPropertyNamingPolicy.Default
builder.Services.AddCosmosRepository(options =>
{
options.SerializationOptions = new Microsoft.Azure.CosmosRepository.Options.RepositorySerializationOptions
{
PropertyNamingPolicy = CosmosPropertyNamingPolicy.Default
};
});
Closing this issue, as the matter of configuring serialization is the known solution.