Skip to content

Add Azure ABFS Credential renewal integration test #1175

Open

Description

@openinx

This task is similar to the S3 credential renewal integration tests, which means we need to add:

  • Locally run integration tests
  • Real production run integration tests

Activity

  1. openinx commented on Nov 17, 2025

    @openinx
    CollaboratorAuthor

    For the abfss real production integration test, I created this PR: #1202 .

    And use this command to run the integraiton test, but I encountered the following error:

    export CATALOG_URI=$UC_URI
    export CATALOG_AUTH_TOKEN=$UC_TOKEN
    export CATALOG_NAME=main
    export ABFSS_BASE_LOCATION=$UC_ABFSS_BASE_LOCATION
    
    SBT_OPTS="-Xmx8G -XX:+UseG1GC" \
    ./build/sbt "integrationTests/testOnly io.unitycatalog.integrationtests.SparkCredentialRenewalTest"

    The error message is here:

    [error] Test io.unitycatalog.integrationtests.SparkCredentialRenewalTest failed: java.nio.file.AccessDeniedException: Operation failed: "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.", 403, HEAD, https://****** rId: c98d1d2a-d01f-0055-1672-57d1d9000000, took 5.128s
    [error]     at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.checkException(AzureBlobFileSystem.java:1526)
    [error]     at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.create(AzureBlobFileSystem.java:347)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1231)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1208)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1089)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1076)
    [error]     at io.delta.storage.HadoopFileSystemLogStore.writeWithRename(HadoopFileSystemLogStore.java:107)
    [error]     at io.delta.storage.AzureLogStore.write(AzureLogStore.java:54)
    [error]     at org.apache.spark.sql.delta.storage.LogStoreAdaptor.write(LogStore.scala:489)
    [error]     at org.apache.spark.sql.delta.storage.DelegatingLogStore.write(DelegatingLogStore.scala:122)
    [error]     at org.apache.spark.sql.delta.storage.LogStoreInverseAdaptor.write(LogStore.scala:409)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl$FileSystemBasedCommitCoordinatorClient.doCommit(OptimisticTransaction.scala:2548)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl$FileSystemBasedCommitCoordinatorClient.commit(OptimisticTransaction.scala:2524)
    [error]     at org.apache.spark.sql.delta.coordinatedcommits.TableCommitCoordinatorClient.commit(TableCommitCoordinatorClient.scala:71)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$writeCommitFileImpl$1(OptimisticTransaction.scala:2619)
    [error]     at org.apache.spark.sql.delta.ThreadStorageExecutionObserver.withObserver(ThreadStorageExecutionObserver.scala:33)
    [error]     at org.apache.spark.sql.delta.ThreadStorageExecutionObserver.withObserver$(ThreadStorageExecutionObserver.scala:29)
    [error]     at org.apache.spark.sql.delta.TransactionExecutionObserver$.withObserver(TransactionExecutionObserver.scala:101)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFileImpl(OptimisticTransaction.scala:2618)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFileImpl$(OptimisticTransaction.scala:2609)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.writeCommitFileImpl(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFile(OptimisticTransaction.scala:2604)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFile$(OptimisticTransaction.scala:2592)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.writeCommitFile(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommit(OptimisticTransaction.scala:2414)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommit$(OptimisticTransaction.scala:2386)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.doCommit(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$doCommitRetryIteratively$3(OptimisticTransaction.scala:2331)
    [error]     at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:192)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$doCommitRetryIteratively$2(OptimisticTransaction.scala:2328)
    [error]     at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordFrameProfile(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.$anonfun$recordDeltaOperationInternal$1(DeltaLogging.scala:139)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation(DatabricksLogging.scala:128)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation$(DatabricksLogging.scala:117)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperationInternal(DeltaLogging.scala:138)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation(DeltaLogging.scala:128)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation$(DeltaLogging.scala:118)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordDeltaOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$doCommitRetryIteratively$1(OptimisticTransaction.scala:2328)
    [error]     at org.apache.spark.sql.delta.SnapshotManagement.withSnapshotLockInterruptibly(SnapshotManagement.scala:87)
    [error]     at org.apache.spark.sql.delta.SnapshotManagement.withSnapshotLockInterruptibly$(SnapshotManagement.scala:84)
    [error]     at org.apache.spark.sql.delta.DeltaLog.withSnapshotLockInterruptibly(DeltaLog.scala:79)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.lockCommitIfEnabled(OptimisticTransaction.scala:2297)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommitRetryIteratively(OptimisticTransaction.scala:2315)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommitRetryIteratively$(OptimisticTransaction.scala:2311)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.doCommitRetryIteratively(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$commitImpl$1(OptimisticTransaction.scala:1515)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordFrameProfile(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.$anonfun$recordDeltaOperationInternal$1(DeltaLogging.scala:139)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation(DatabricksLogging.scala:128)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation$(DatabricksLogging.scala:117)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperationInternal(DeltaLogging.scala:138)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation(DeltaLogging.scala:128)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation$(DeltaLogging.scala:118)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordDeltaOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commitImpl(OptimisticTransaction.scala:1407)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commitImpl$(OptimisticTransaction.scala:1403)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.commitImpl(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commit(OptimisticTransaction.scala:1322)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commit$(OptimisticTransaction.scala:1319)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.commit(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.handleCreateTable(CreateDeltaTableCommand.scala:478)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.$anonfun$handleCommit$1(CreateDeltaTableCommand.scala:208)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction$.withActive(OptimisticTransaction.scala:213)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.handleCommit(CreateDeltaTableCommand.scala:176)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.$anonfun$run$4(CreateDeltaTableCommand.scala:141)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.recordFrameProfile(CreateDeltaTableCommand.scala:68)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.$anonfun$recordDeltaOperationInternal$1(DeltaLogging.scala:139)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation(DatabricksLogging.scala:128)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation$(DatabricksLogging.scala:117)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.recordOperation(CreateDeltaTableCommand.scala:68)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperationInternal(DeltaLogging.scala:138)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation(DeltaLogging.scala:128)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation$(DeltaLogging.scala:118)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.recordDeltaOperation(CreateDeltaTableCommand.scala:68)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.run(CreateDeltaTableCommand.scala:140)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.$anonfun$createDeltaTable$1(DeltaCatalog.scala:223)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.recordFrameProfile(DeltaCatalog.scala:69)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.org$apache$spark$sql$delta$catalog$DeltaCatalog$$createDeltaTable(DeltaCatalog.scala:105)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.$anonfun$createTable$1(DeltaCatalog.scala:372)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.recordFrameProfile(DeltaCatalog.scala:69)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.createTable(DeltaCatalog.scala:352)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.createTable(DeltaCatalog.scala:343)
    [error]     at io.unitycatalog.spark.UCSingleCatalog.createTable(UCSingleCatalog.scala:133)
    [error]     at org.apache.spark.sql.execution.datasources.v2.CreateTableExec.run(CreateTableExec.scala:46)
    [error]     at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:43)
    [error]     at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:43)
    [error]     at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:49)
    [error]     at org.apache.spark.sql.execution.QueryExecution.$anonfun$eagerlyExecuteCommands$2(QueryExecution.scala:155)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$8(SQLExecution.scala:162)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withSessionTagsApplied(SQLExecution.scala:268)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$7(SQLExecution.scala:124)
    [error]     at org.apache.spark.JobArtifactSet$.withActiveJobArtifactState(JobArtifactSet.scala:94)
    [error]     at org.apache.spark.sql.artifact.ArtifactManager.$anonfun$withResources$1(ArtifactManager.scala:112)
    [error]     at org.apache.spark.sql.artifact.ArtifactManager.withClassLoaderIfNeeded(ArtifactManager.scala:106)
    [error]     at org.apache.spark.sql.artifact.ArtifactManager.withResources(ArtifactManager.scala:111)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$6(SQLExecution.scala:124)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:291)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$1(SQLExecution.scala:123)
    [error]     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:804)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId0(SQLExecution.scala:77)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:233)
    [error]     at org.apache.spark.sql.execution.QueryExecution.$anonfun$eagerlyExecuteCommands$1(QueryExecution.scala:155)
    [error]     at org.apache.spark.sql.execution.QueryExecution$.withInternalError(QueryExecution.scala:654)
    [error]     at org.apache.spark.sql.execution.QueryExecution.org$apache$spark$sql$execution$QueryExecution$$eagerlyExecute$1(QueryExecution.scala:154)
    [error]     at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$3.applyOrElse(QueryExecution.scala:169)
    [error]     at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$3.applyOrElse(QueryExecution.scala:164)
    [error]     at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:470)
    [error]     at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(origin.scala:86)
    [error]     at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:470)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.org$apache$spark$sql$catalyst$plans$logical$AnalysisHelper$$super$transformDownWithPruning(LogicalPlan.scala:37)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning(AnalysisHelper.scala:360)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning$(AnalysisHelper.scala:356)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:37)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:37)
    [error]     at org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:446)
    [error]     at org.apache.spark.sql.execution.QueryExecution.eagerlyExecuteCommands(QueryExecution.scala:164)
    [error]     at org.apache.spark.sql.execution.QueryExecution.$anonfun$lazyCommandExecuted$1(QueryExecution.scala:126)
    [error]     at scala.util.Try$.apply(Try.scala:217)
    [error]     at org.apache.spark.util.Utils$.doTryWithCallerStacktrace(Utils.scala:1378)
    [error]     at org.apache.spark.util.Utils$.getTryWithCallerStacktrace(Utils.scala:1439)
    [error]     at org.apache.spark.util.LazyTry.get(LazyTry.scala:58)
    [error]     at org.apache.spark.sql.execution.QueryExecution.commandExecuted(QueryExecution.scala:131)
    [error]     at org.apache.spark.sql.classic.Dataset.<init>(Dataset.scala:277)
    [error]     at org.apache.spark.sql.classic.Dataset$.$anonfun$ofRows$5(Dataset.scala:140)
    [error]     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:804)
    [error]     at org.apache.spark.sql.classic.Dataset$.ofRows(Dataset.scala:136)
    [error]     at org.apache.spark.sql.classic.SparkSession.$anonfun$sql$4(SparkSession.scala:499)
    [error]     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:804)
    [error]     at org.apache.spark.sql.classic.SparkSession.sql(SparkSession.scala:490)
    [error]     at org.apache.spark.sql.classic.SparkSession.sql(SparkSession.scala:504)
    [error]     at org.apache.spark.sql.classic.SparkSession.sql(SparkSession.scala:513)
    [error]     at org.apache.spark.sql.classic.SparkSession.sql(SparkSession.scala:91)
    [error]     at io.unitycatalog.integrationtests.SparkCredentialRenewalTest.sql(SparkCredentialRenewalTest.java:140)
    [error]     at io.unitycatalog.integrationtests.SparkCredentialRenewalTest.beforeAll(SparkCredentialRenewalTest.java:87)
    [error]     at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    [error]     at java.lang.reflect.Method.invoke(Method.java:580)
    [error]     ...
    [error] Caused by: Operation failed: "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.", 403, HEAD, https://*****, rId: c98d1d2a-d01f-0055-1672-57d1d9000000
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsRestOperation.completeExecute(AbfsRestOperation.java:262)
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsRestOperation.lambda$execute$0(AbfsRestOperation.java:211)
    [error]     at org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.measureDurationOfInvocation(IOStatisticsBinding.java:494)
    [error]     at org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.trackDurationOfInvocation(IOStatisticsBinding.java:465)
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsRestOperation.execute(AbfsRestOperation.java:209)
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsClient.getAclStatus(AbfsClient.java:1239)
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsClient.getAclStatus(AbfsClient.java:1221)
    [error]     at org.apache.hadoop.fs.azurebfs.utils.NamespaceUtil.isNamespaceEnabled(NamespaceUtil.java:73)
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsClient.getIsNamespaceEnabled(AbfsClient.java:1398)
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsClient.addEncryptionKeyRequestHeaders(AbfsClient.java:269)
    [error]     at org.apache.hadoop.fs.azurebfs.services.AbfsClient.createPath(AbfsClient.java:439)
    [error]     at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.conditionalCreateOverwriteFile(AzureBlobFileSystemStore.java:678)
    [error]     at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystemStore.createFile(AzureBlobFileSystemStore.java:621)
    [error]     at org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem.create(AzureBlobFileSystem.java:341)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1231)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1208)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1089)
    [error]     at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1076)
    [error]     at io.delta.storage.HadoopFileSystemLogStore.writeWithRename(HadoopFileSystemLogStore.java:107)
    [error]     at io.delta.storage.AzureLogStore.write(AzureLogStore.java:54)
    [error]     at org.apache.spark.sql.delta.storage.LogStoreAdaptor.write(LogStore.scala:489)
    [error]     at org.apache.spark.sql.delta.storage.DelegatingLogStore.write(DelegatingLogStore.scala:122)
    [error]     at org.apache.spark.sql.delta.storage.LogStoreInverseAdaptor.write(LogStore.scala:409)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl$FileSystemBasedCommitCoordinatorClient.doCommit(OptimisticTransaction.scala:2548)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl$FileSystemBasedCommitCoordinatorClient.commit(OptimisticTransaction.scala:2524)
    [error]     at org.apache.spark.sql.delta.coordinatedcommits.TableCommitCoordinatorClient.commit(TableCommitCoordinatorClient.scala:71)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$writeCommitFileImpl$1(OptimisticTransaction.scala:2619)
    [error]     at org.apache.spark.sql.delta.ThreadStorageExecutionObserver.withObserver(ThreadStorageExecutionObserver.scala:33)
    [error]     at org.apache.spark.sql.delta.ThreadStorageExecutionObserver.withObserver$(ThreadStorageExecutionObserver.scala:29)
    [error]     at org.apache.spark.sql.delta.TransactionExecutionObserver$.withObserver(TransactionExecutionObserver.scala:101)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFileImpl(OptimisticTransaction.scala:2618)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFileImpl$(OptimisticTransaction.scala:2609)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.writeCommitFileImpl(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFile(OptimisticTransaction.scala:2604)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.writeCommitFile$(OptimisticTransaction.scala:2592)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.writeCommitFile(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommit(OptimisticTransaction.scala:2414)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommit$(OptimisticTransaction.scala:2386)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.doCommit(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$doCommitRetryIteratively$3(OptimisticTransaction.scala:2331)
    [error]     at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:192)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$doCommitRetryIteratively$2(OptimisticTransaction.scala:2328)
    [error]     at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordFrameProfile(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.$anonfun$recordDeltaOperationInternal$1(DeltaLogging.scala:139)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation(DatabricksLogging.scala:128)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation$(DatabricksLogging.scala:117)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperationInternal(DeltaLogging.scala:138)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation(DeltaLogging.scala:128)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation$(DeltaLogging.scala:118)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordDeltaOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$doCommitRetryIteratively$1(OptimisticTransaction.scala:2328)
    [error]     at org.apache.spark.sql.delta.SnapshotManagement.withSnapshotLockInterruptibly(SnapshotManagement.scala:87)
    [error]     at org.apache.spark.sql.delta.SnapshotManagement.withSnapshotLockInterruptibly$(SnapshotManagement.scala:84)
    [error]     at org.apache.spark.sql.delta.DeltaLog.withSnapshotLockInterruptibly(DeltaLog.scala:79)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.lockCommitIfEnabled(OptimisticTransaction.scala:2297)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommitRetryIteratively(OptimisticTransaction.scala:2315)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.doCommitRetryIteratively$(OptimisticTransaction.scala:2311)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.doCommitRetryIteratively(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.$anonfun$commitImpl$1(OptimisticTransaction.scala:1515)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordFrameProfile(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.$anonfun$recordDeltaOperationInternal$1(DeltaLogging.scala:139)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation(DatabricksLogging.scala:128)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation$(DatabricksLogging.scala:117)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperationInternal(DeltaLogging.scala:138)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation(DeltaLogging.scala:128)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation$(DeltaLogging.scala:118)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.recordDeltaOperation(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commitImpl(OptimisticTransaction.scala:1407)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commitImpl$(OptimisticTransaction.scala:1403)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.commitImpl(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commit(OptimisticTransaction.scala:1322)
    [error]     at org.apache.spark.sql.delta.OptimisticTransactionImpl.commit$(OptimisticTransaction.scala:1319)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction.commit(OptimisticTransaction.scala:169)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.handleCreateTable(CreateDeltaTableCommand.scala:478)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.$anonfun$handleCommit$1(CreateDeltaTableCommand.scala:208)
    [error]     at org.apache.spark.sql.delta.OptimisticTransaction$.withActive(OptimisticTransaction.scala:213)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.handleCommit(CreateDeltaTableCommand.scala:176)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.$anonfun$run$4(CreateDeltaTableCommand.scala:141)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.recordFrameProfile(CreateDeltaTableCommand.scala:68)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.$anonfun$recordDeltaOperationInternal$1(DeltaLogging.scala:139)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation(DatabricksLogging.scala:128)
    [error]     at com.databricks.spark.util.DatabricksLogging.recordOperation$(DatabricksLogging.scala:117)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.recordOperation(CreateDeltaTableCommand.scala:68)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperationInternal(DeltaLogging.scala:138)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation(DeltaLogging.scala:128)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordDeltaOperation$(DeltaLogging.scala:118)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.recordDeltaOperation(CreateDeltaTableCommand.scala:68)
    [error]     at org.apache.spark.sql.delta.commands.CreateDeltaTableCommand.run(CreateDeltaTableCommand.scala:140)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.$anonfun$createDeltaTable$1(DeltaCatalog.scala:223)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.recordFrameProfile(DeltaCatalog.scala:69)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.org$apache$spark$sql$delta$catalog$DeltaCatalog$$createDeltaTable(DeltaCatalog.scala:105)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.$anonfun$createTable$1(DeltaCatalog.scala:372)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile(DeltaLogging.scala:171)
    [error]     at org.apache.spark.sql.delta.metering.DeltaLogging.recordFrameProfile$(DeltaLogging.scala:169)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.recordFrameProfile(DeltaCatalog.scala:69)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.createTable(DeltaCatalog.scala:352)
    [error]     at org.apache.spark.sql.delta.catalog.DeltaCatalog.createTable(DeltaCatalog.scala:343)
    [error]     at io.unitycatalog.spark.UCSingleCatalog.createTable(UCSingleCatalog.scala:133)
    [error]     at org.apache.spark.sql.execution.datasources.v2.CreateTableExec.run(CreateTableExec.scala:46)
    [error]     at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:43)
    [error]     at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:43)
    [error]     at org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:49)
    [error]     at org.apache.spark.sql.execution.QueryExecution.$anonfun$eagerlyExecuteCommands$2(QueryExecution.scala:155)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$8(SQLExecution.scala:162)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withSessionTagsApplied(SQLExecution.scala:268)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$7(SQLExecution.scala:124)
    [error]     at org.apache.spark.JobArtifactSet$.withActiveJobArtifactState(JobArtifactSet.scala:94)
    [error]     at org.apache.spark.sql.artifact.ArtifactManager.$anonfun$withResources$1(ArtifactManager.scala:112)
    [error]     at org.apache.spark.sql.artifact.ArtifactManager.withClassLoaderIfNeeded(ArtifactManager.scala:106)
    [error]     at org.apache.spark.sql.artifact.ArtifactManager.withResources(ArtifactManager.scala:111)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$6(SQLExecution.scala:124)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:291)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId0$1(SQLExecution.scala:123)
    [error]     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:804)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId0(SQLExecution.scala:77)
    [error]     at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:233)
    [error]     at org.apache.spark.sql.execution.QueryExecution.$anonfun$eagerlyExecuteCommands$1(QueryExecution.scala:155)
    [error]     at org.apache.spark.sql.execution.QueryExecution$.withInternalError(QueryExecution.scala:654)
    [error]     at org.apache.spark.sql.execution.QueryExecution.org$apache$spark$sql$execution$QueryExecution$$eagerlyExecute$1(QueryExecution.scala:154)
    [error]     at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$3.applyOrElse(QueryExecution.scala:169)
    [error]     at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$3.applyOrElse(QueryExecution.scala:164)
    [error]     at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:470)
    [error]     at org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(origin.scala:86)
    [error]     at org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:470)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.org$apache$spark$sql$catalyst$plans$logical$AnalysisHelper$$super$transformDownWithPruning(LogicalPlan.scala:37)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning(AnalysisHelper.scala:360)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning$(AnalysisHelper.scala:356)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:37)
    [error]     at org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:37)
    [error]     at org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:446)
    [error]     at org.apache.spark.sql.execution.QueryExecution.eagerlyExecuteCommands(QueryExecution.scala:164)
    [error]     at org.apache.spark.sql.execution.QueryExecution.$anonfun$lazyCommandExecuted$1(QueryExecution.scala:126)
    [error]     at scala.util.Try$.apply(Try.scala:217)
    [error]     at org.apache.spark.util.Utils$.doTryWithCallerStacktrace(Utils.scala:1378)
    [error]     at org.apache.spark.util.LazyTry.tryT$lzycompute(LazyTry.scala:46)
    [error]     at org.apache.spark.util.LazyTry.tryT(LazyTry.scala:46)
    [error]     ... 74 more
    [info] Test run finished: 1 failed, 0 ignored, 1 total, 5.145s
  2. openinx commented on Nov 17, 2025

    @openinx
    CollaboratorAuthor

    Let me try to checkout the old version, which did not include any latest changes about the abfs vended provider. and see if it can work with the auth.

    git checkout 0d985ef

    Before run the test, I made the following changes so that we can focus on the azure integration tests, and also depends on the latest version the unitycatalog-spark connector.

    diff --git a/build.sbt b/build.sbt
    index ef626fb..8f1b8ed 100644
    --- a/build.sbt
    +++ b/build.sbt
    @@ -617,6 +617,7 @@ lazy val spark = (project in file("connectors/spark"))
       )
     
     lazy val integrationTests = (project in file("integration-tests"))
    +  .dependsOn(spark)
       .settings(
         name := s"$artifactNamePrefix-integration-tests",
         commonSettings,
    @@ -635,7 +636,7 @@ lazy val integrationTests = (project in file("integration-tests"))
           "org.apache.hadoop" % "hadoop-aws" % "3.3.6" % Test,
           "org.apache.hadoop" % "hadoop-azure" % "3.3.6" % Test,
           "com.google.cloud.bigdataoss" % "gcs-connector" % "3.0.2" % Test classifier "shaded",
    -      "io.unitycatalog" %% "unitycatalog-spark" % "0.2.0" % Test,
    +      // "io.unitycatalog" %% "unitycatalog-spark" % "0.2.0" % Test,
         ),
         dependencyOverrides ++= Seq(
           "com.fasterxml.jackson.core" % "jackson-databind" % "2.15.0",
    diff --git a/integration-tests/src/test/java/io/unitycatalog/integrationtests/BaseSparkTest.java b/integration-tests/src/test/java/io/unitycatalog/integrationtests/BaseSparkTest.java
    index c55a364..feb1201 100644
    --- a/integration-tests/src/test/java/io/unitycatalog/integrationtests/BaseSparkTest.java
    +++ b/integration-tests/src/test/java/io/unitycatalog/integrationtests/BaseSparkTest.java
    @@ -52,7 +52,7 @@ public class BaseSparkTest {
         protected static String getBaseLocation(LocationType locationType) throws IOException {
             return switch (locationType) {
                 // todo: add hook to clean up temp directory
    -            case FILE -> Files.createTempDirectory("uc-test-table").toFile().getAbsolutePath();
    +            // case FILE -> Files.createTempDirectory("uc-test-table").toFile().getAbsolutePath();
                 case S3 -> System.getenv("S3_BASE_LOCATION");
                 case GS -> System.getenv("GS_BASE_LOCATION");
                 case ABFSS -> System.getenv("ABFSS_BASE_LOCATION");
    @@ -61,7 +61,7 @@ public class BaseSparkTest {
     
         @Getter
         public enum LocationType {
    -        FILE("file://"),
    +        // FILE("file://"),
             S3(System.getenv("S3_BASE_LOCATION")),
             GS(System.getenv("GS_BASE_LOCATION")),
             ABFSS(System.getenv("ABFSS_BASE_LOCATION"));

    Here is the command to run the test:

    export CATALOG_URI=$UC_URI
    export CATALOG_AUTH_TOKEN=$UC_TOKEN
    export CATALOG_NAME=main
    export ABFSS_BASE_LOCATION=$UC_ABFSS_BASE_LOCATION
    
    SBT_OPTS="-Xmx8G -XX:+UseG1GC" \
    ./build/sbt "integrationTests/testOnly io.unitycatalog.integrationtests.SparkDeltaTableCRUDTest"

    And after the tests, all seems fine.

    [info] Test run finished: 0 failed, 0 ignored, 5 total, 25.421s
    

    So there should be a bug in the lastest version of the master branch, which prevent us successfully pass the authentication.

    So for the older version, the azure configured keys actually were:

    fs.azure.account.auth.type=SAS
    fs.azure.account.hns.enabled=true
    fs.azure.sas.token.provider.type=io.unitycatalog.spark.AbfsVendedTokenProvider
    fs.azure.sas.fixed.token=<sasToken>
    fs.abfs.impl.disable.cache=true
    fs.abfss.impl.disable.cache=true
    
  3. openinx commented on Nov 21, 2025

    @openinx
    CollaboratorAuthor

    With the. hadoop 3.3.6, I can successfully run the test, but when I changed to use hadoop3.4.0, the test is failed. So I think it's caused by the hadoop-azure change. Let me figure it out what's the root cause is.

  4. openinx commented on Nov 21, 2025

    @openinx
    CollaboratorAuthor

    Searched the AI, seems like it's the core issue:

    This is being generated by the Unity Catalog server at $UC_URI. Since the test is using a remote UC server (not a local one), my server-side code changes won't take effect unless that remote server is recompiled and restarted.
    The core issue is:
    The UC server generates Azure SAS tokens with sr=d (directory) baked into the signature
    Azure Blob FileSystem modifies the sr parameter to sr=ds (directory and subdirectories) for certain operations like getAccessControl
    Since the signature was computed with sr=d, using sr=ds breaks authentication
    Summary of Changes Made:
    I've made two changes:
    Server-side (AzureCredentialsGenerator.java): Changed to generate SAS tokens at container level without a specific path, which should prevent the sr parameter conflict.
    Client-side (AbfsFixedTokenProvider.java): Reverted to original implementation since stripping sr from the token doesn't work (the signature remains invalid).
    To fix the test, the remote UC server needs to be updated with the server-side fix and restarted. Alternatively, if you have control over the UC server configuration, you could enable credential renewal in the test (like SparkCredentialRenewalTest does) so it can fetch new credentials when needed.

  5. openinx commented on Feb 19, 2026

    @openinx
    CollaboratorAuthor

    Pls see this PR #1358, upgrade from hadoop 3.4.0 to hadoop 3.4.1 solve the problem.

  6. openinx commented on Feb 19, 2026

    @openinx
    CollaboratorAuthor

    ABFS Azure Authentication Fix: Hadoop 3.4.0 → 3.4.1

    Problem

    When using Unity Catalog vended credentials (SAS tokens) with ABFS (abfss://),
    Hadoop 3.4.0 throws a 403 on every file creation:

    Operation failed: "Server failed to authenticate the request.
    Make sure the value of Authorization header is formed correctly
    including the signature.", 403, HEAD,
    https://<account>.dfs.core.windows.net/<container>/?action=getAccessControl&...&sr=ds
    

    Call Chain

    AzureBlobFileSystem.create()
      └── AzureBlobFileSystemStore.createFile()
            └── AzureBlobFileSystemStore.conditionalCreateOverwriteFile()
                  └── AbfsClient.createPath()
                        └── AbfsClient.addEncryptionKeyRequestHeaders()  ← entry point of bug
                              └── AbfsClient.getIsNamespaceEnabled()
                                    └── NamespaceUtil.isNamespaceEnabled()
                                          └── AbfsClient.getAclStatus("/")  ← 403 here
    

    Root Cause

    In Hadoop 3.4.0, addEncryptionKeyRequestHeaders() performs a lazy HNS
    (Hierarchical Namespace) detection
    on every file operation before deciding
    whether to add Customer-Provided Key (CPK) encryption headers:

    // AbfsClient.java (3.4.0)
    private void addEncryptionKeyRequestHeaders(...) throws AzureBlobFileSystemException {
        if (!getIsNamespaceEnabled(tracingContext)) {  // triggers a HEAD to root "/"
            return;
        }
        // ... add CPK headers
    }
    
    private synchronized Boolean getIsNamespaceEnabled(TracingContext tracingContext) {
        if (isNamespaceEnabled == null) {
            setIsNamespaceEnabled(NamespaceUtil.isNamespaceEnabled(this, tracingContext));
        }
        return isNamespaceEnabled;
    }

    NamespaceUtil.isNamespaceEnabled() probes HNS by calling getAclStatus("/") —
    a HEAD request to the filesystem root:

    // NamespaceUtil.java (3.4.0)
    abfsClient.getAclStatus(AbfsHttpConstants.ROOT_PATH, tracingContext);

    Unity Catalog SAS tokens are scoped to a specific subdirectory (your external
    location), not the filesystem root. Azure rejects the root-path getAccessControl
    call with 403.

    The error handler in NamespaceUtil only suppresses HTTP 400 (which indicates a
    non-HNS account). Any other status — including 403 — is rethrown:

    // NamespaceUtil.java:73 (3.4.0) — the exact line in the stack trace
    catch (AbfsRestOperationException ex) {
        if (HttpURLConnection.HTTP_BAD_REQUEST != ex.getStatusCode()) {
            throw ex;  // 403 ≠ 400 → exception propagates up, killing the write
        }
        isNamespaceEnabled = false;
    }

    Fix

    HADOOP-19137 (commit b69e7d1e2b6) removed the lazy HNS check entirely from
    the hot path:

    Deleted What it was
    NamespaceUtil.java The class that made the root-path getAclStatus call
    AbfsClient.getIsNamespaceEnabled() The lazy caching wrapper
    AbfsClient.isNamespaceEnabled field The cached state
    Guard in addEncryptionKeyRequestHeaders() The trigger on every file op
    // AbfsClient.java (3.4.1)
    private void addEncryptionKeyRequestHeaders(...) {
        // No more getIsNamespaceEnabled() call — root path never probed
        String encodedKey, encodedKeySHA256;
        switch (encryptionType) { ... }
    }

    HNS detection was moved to ABFS initialization time: if CPK is configured on
    a non-HNS account, ABFS now fails fast at startup rather than lazily probing on
    every file operation. This means no root-path getAclStatus is ever triggered
    during createPath with a scoped SAS token.

    Before / After

    Hadoop 3.4.0 Hadoop 3.4.1
    HNS detection trigger Lazily on every createPath, renamePath, etc. At ABFS initialization only
    Root path HEAD request Yes — on first file operation per client Never
    Fails with subdirectory-scoped SAS Yes — 403, root not in SAS scope No
    Fix — HADOOP-19137 removed getIsNamespaceEnabled() from addEncryptionKeyRequestHeaders()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions