From 6a4430120ddc80993614eb9dc68a1f9245c9a498 Mon Sep 17 00:00:00 2001 From: djouallah Date: Sat, 30 May 2026 00:27:19 +1000 Subject: [PATCH 1/2] Strip trailing slash before DFS GetProperties (fixes OneLake 403) A trailing '/' is a directory hint, not part of the resource name, but it was passed straight into GetFileClient(parsed_url.path). OneLake's DFS endpoint rejects a GetProperties on a trailing-slash path with 403 AuthenticationFailed (the slash-less path returns 200), so any DirectoryExists/FileExists/glob on a directory fails. This breaks e.g. duckdb-delta partitioned writes, which probe the table directory. Strip a single trailing slash from the path used to build the file client. info.path is left untouched, so the directory-marker check in LoadRemoteFileInfo still works. Co-Authored-By: Claude Opus 4.8 --- src/azure_dfs_filesystem.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/azure_dfs_filesystem.cpp b/src/azure_dfs_filesystem.cpp index 2071257..9095a3e 100644 --- a/src/azure_dfs_filesystem.cpp +++ b/src/azure_dfs_filesystem.cpp @@ -139,8 +139,15 @@ unique_ptr AzureDfsStorageFileSystem::CreateHandle(const OpenFi auto storage_context = GetOrCreateStorageContext(opener, info.path, parsed_url); auto file_system_client = storage_context->As().GetDfsFileSystemClient(parsed_url.container); + // A trailing '/' is only a directory hint, not part of the resource name. Some DFS endpoints (e.g. OneLake) + // reject a GetProperties on a trailing-slash path with 403 AuthenticationFailed, so strip it for the client. + auto file_path = parsed_url.path; + if (file_path.size() > 1 && file_path.back() == '/') { + file_path.pop_back(); + } + auto handle = make_uniq(*this, info, flags, storage_context->read_options, - file_system_client.GetFileClient(parsed_url.path)); + file_system_client.GetFileClient(file_path)); if (!handle->PostConstruct()) { return nullptr; } From 206afe01e5545df02e9fec06f2ea14c951c164e0 Mon Sep 17 00:00:00 2001 From: ben fleis Date: Mon, 13 Jul 2026 20:15:23 +0200 Subject: [PATCH 2/2] fix name ref --- src/azure_dfs_filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure_dfs_filesystem.cpp b/src/azure_dfs_filesystem.cpp index c71ec54..1e7ec83 100644 --- a/src/azure_dfs_filesystem.cpp +++ b/src/azure_dfs_filesystem.cpp @@ -170,7 +170,7 @@ unique_ptr AzureDfsStorageFileSystem::CreateHandle(const OpenFi file_path.pop_back(); } - auto handle = make_uniq(*this, info, flags, storage_context->read_options, + auto handle = make_uniq(*this, info, flags, storage_context->options, file_system_client.GetFileClient(file_path)); if (!handle->PostConstruct()) { return nullptr;