[BUG] DataLakeFileSystemAsyncClient.createIfNotExists returns true when the file system already exists

Abierto
#51,145 2 comentarios 1 reacción 2 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@browndav-msft ya está trabajando en esto.

Desde el 6/11/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Client customer-reported needs-team-attention question Storage

Describe the bug
DataLakeFileSystemAsyncClient.createIfNotExists() emits true when the file system already exists (409). The sync DataLakeFileSystemClient.createIfNotExists() correctly returns false, and so does BlobContainerAsyncClient.createIfNotExists().

Root cause
In azure-storage-file-datalake 12.26.4, DataLakeFileSystemAsyncClient.createIfNotExistsWithResponse(Map, PublicAccessType) maps the result of BlobContainerAsyncClient.createIfNotExistsWithResponse(...) with a lambda equivalent to:

response -> new SimpleResponse<>(response, true)

So the value is always true. The status code of the wrapped response is still 409 when the file system already exists.

To Reproduce
Point the async DataLake client at a server that answers every request with 409 and call createIfNotExists().

Code Snippet

HttpServer server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0);
server.createContext("/", exchange -> { exchange.sendResponseHeaders(409, -1); exchange.close(); });
server.start();

DataLakeServiceClientBuilder builder = new DataLakeServiceClientBuilder()
    .endpoint("http://127.0.0.1:" + server.getAddress().getPort() + "/devstoreaccount1")
    .credential(new StorageSharedKeyCredential("devstoreaccount1",
        "Eby8vdM02xNOcqCfGfP/mkP3+rZTt5tF5If1fMvj08QzZLOiT4E5lZaz0smU4wFwbIsrpPoIQx=="));

System.out.println(builder.buildClient().getFileSystemClient("fs").createIfNotExists());                 // false
System.out.println(builder.buildAsyncClient().getFileSystemAsyncClient("fs").createIfNotExists().block()); // true

Expected behavior
The async client returns false when the file system already exists, matching the sync client and BlobContainerAsyncClient.

Workaround
Call createIfNotExistsWithResponse(null, null) and check getStatusCode() != 409.

Setup

  • OS: Ubuntu 20.04 (x86_64)
  • Library/Libraries: azure-storage-file-datalake 12.26.4, azure-storage-blob 12.36.0
  • Java version: 25 (GraalVM 25.0.4)
  • Frameworks: none

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
Lenguaje dominante
Java
Estrellas
2.6k
Forks
2.2k
Merge medio
2 d 2 h
PR fusionados (30 d)
257

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azure-sdk-for-java

Todos los issues de Azure/azure-sdk-for-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.