Azure / Azure/azure-sdk-for-java
[BUG] CosmosRepository.saveAll() logs the error in the log file but does not return an exception to the calling Application
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 2.2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 178
Description
**Describe the bug**
The customer is encountering a 403 Forbidden error when attempting to write data to a specific partition key (MACLIENT8) due to the partition key size limit. Unfortunately, this error is not being communicated to the calling application, as only the 403 status code is available without the sub-status code '1014'.
***Exception or Stack Trace***
The is the Error message seen in the log.
14:02:47.938
process-trans-job-spec-lb-psr-01
[process-trans-job-spec-lb-psr-01][ERROR] HandleTransactionalBatchOperationResult - Fail, PKRange 8, Response Status Code 403, Operation Status Code 403, ItemOperation[Type: UPSERT, PK: ['MACLIENT8'], id: null], Context: BulkExecutor-415[n/a] Thread[Name: bulk-executor-bounded-elastic-11,Group: main, isDaemon: true, Id: 208]
14:02:47.940
process-trans-job-spec-lb-psr-01
[process-trans-job-spec-lb-psr-01][ERROR] HandleTransactionalBatchOperationResult - Fail, PKRange 8, Response Status Code 403, Operation Status Code 403, ItemOperation[Type: UPSERT, PK: ['MACLIENT8'], id: null], Context: BulkExecutor-415[n/a] Thread[Name: bulk-executor-bounded-elastic-11,Group: main, isDaemon: true, Id: 208]
**To Reproduce**
Steps to reproduce the behavior:
***Code Snippet***
Add the code snippet that causes the issue.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Setup (please complete the following information):**
- OS: [e.g. iOS]
- IDE: [e.g. IntelliJ]
- Library/Libraries: [e.g. com.azure:azure-core:1.16.0 (groupId:artifactId:version)]
- Java version: [e.g. 8]
- App Server/Environment: [e.g. Tomcat, WildFly, Azure Function, Apache Spark, Databricks, IDE plugin or anything special]
- Frameworks: [e.g. Spring Boot, Micronaut, Quarkus, etc]
If you suspect a dependency version mismatch (e.g. you see `NoClassDefFoundError`, `NoSuchMethodError` or similar), please check out [Troubleshoot dependency version conflict article](https://aka.ms/azsdk/java/dependency/troubleshoot) first. If it doesn't provide solution for the problem, please provide:
- verbose dependency tree (`mvn dependency:tree -Dverbose`)
- exception message, full stack trace, and any available logs
**Additional context**
Add any other context about the problem here.
**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ ] Bug Description Added
- [ ] Repro Steps Added
- [ ] Setup information Added
Contributor guide
Assessment
This issue has not been assessed yet.