This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.36k
stars
2k
forks
source link
[BUG][JAVA SDK] CloudBlobClient.ListBlobsSegmented Method list the deleted files too. #43103
Describe the bug
Our application uses the Method ListBlobsSegmented to list all the files in a container at a specific path. We observed that this method also lists the deleted files every time. so when we go for deletion of the files based on the output received by the call(ListBlobsSegmented) Azure throws an error mentioned below.
**_BlobBatchStorageException: Error Code: BlobPathConflict, Request Status Code: 409, Service Message <?xml version="1.0" encoding="utf-8"?>
BlobPathConflictThe specified path, or an element of the path, exists and its resource type is invalid for this operation.
RequestId:25930ad6-301e-0078-4a6a-1f327a1e29c1
Time:2024-10-16T01:28:03.9939930Z^M_**
***Exception or Stack Trace***
BlobBatchStorageException: Error Code: BlobPathConflict, Request Status Code: 409, Service Message BlobPathConflictThe specified path, or an element of the path, exists and its resource type is invalid for this operation.
RequestId:25930ad6-301e-0078-4a6a-1f327a1e29c1
Time:2024-10-16T01:28:03.9939930Z^M
**To Reproduce**
We found the error in our customer environment.
***Code Snippet***
cloudBlobContainer.listBlobsSegmented(prefix, true, null, null, null, null, null);
cloudBlobContainer.listBlobsSegmented(prefix, true, null, null, token, null, null);
**Expected behavior**
It should not list the deleted files.
**Screenshots**
When we checked the Portal, there were no files present, but when we made the call, it listed the files.
**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] java 17
- App Server/Environment: [e.g. Tomcat, WildFly, Azure Function, Apache Spark, Databricks, IDE plugin or anything special] azure-storage-8.6.6
- 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
Describe the bug Our application uses the Method ListBlobsSegmented to list all the files in a container at a specific path. We observed that this method also lists the deleted files every time. so when we go for deletion of the files based on the output received by the call(ListBlobsSegmented) Azure throws an error mentioned below.
**_BlobBatchStorageException: Error Code: BlobPathConflict, Request Status Code: 409, Service Message<?xml version="1.0" encoding="utf-8"?>
BlobPathConflict
BlobPathConflict