{"record":{"id":"61e5bd8d212c1ece","repo":"apache/hadoop","slug":"failed-to-determine-account-type","errorCode":null,"errorMessage":"Failed to determine account type","messagePattern":"Failed to determine account type","errorType":"validation","errorClass":"InvalidConfigurationValueException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java","lineNumber":1689,"sourceCode":"  protected String getUserAgent() {\n    return userAgent;\n  }\n\n  /**\n   * Checks if the namespace is enabled.\n   * Filesystem init will fail if namespace is not correctly configured,\n   * so instead of swallowing the exception, we should throw the exception\n   * in case namespace is not configured correctly.\n   *\n   * @return True if the namespace is enabled, false otherwise.\n   * @throws AzureBlobFileSystemException if the conversion fails.\n   */\n  public boolean getIsNamespaceEnabled() throws AzureBlobFileSystemException {\n    try {\n      return getAbfsConfiguration().getIsNamespaceEnabledAccount().toBoolean();\n    } catch (TrileanConversionException ex) {\n      LOG.error(\"Failed to convert namespace enabled account property to boolean\", ex);\n      throw new InvalidConfigurationValueException(\"Failed to determine account type\", ex);\n    }\n  }\n\n  protected boolean isRenameResilience() {\n    return renameResilience;\n  }\n\n  /**\n   * Parses response of Listing API from server based on Endpoint used.\n   * @param result AbfsHttpOperation of list Operation.\n   * @param uri to be used for the path conversion.\n   * @return {@link ListResponseData} containing the list of entries.\n   * @throws IOException if parsing fails\n   */\n  public abstract ListResponseData parseListPathResults(AbfsHttpOperation result, URI uri) throws IOException;\n\n  /**\n   * Parses response of Get Block List from server based on Endpoint used.","sourceCodeStart":1671,"sourceCodeEnd":1707,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java#L1671-L1707","documentation":"getIsNamespaceEnabled() converts the account's hierarchical-namespace Trilean to a boolean; conversion failed (TrileanConversionException, i.e. the value is unknown), and is rethrown as InvalidConfigurationValueException 'Failed to determine account type'. The client could not determine whether the account is HNS-enabled at a point where a definite answer is required.","triggerScenarios":"fs.azure.account.hns.enabled is not set and the client never resolved the account type (e.g. account-property probing did not run or was not permitted under the auth mode), leaving the Trilean as unknown when toBoolean() is called.","commonSituations":"SAS-auth or OAuth setups where account-property calls are restricted; configurations copied between HNS and non-HNS accounts without the explicit hns flag; embedded/test usage that skips full filesystem initialization.","solutions":["Set fs.azure.account.hns.enabled explicitly (true for hierarchical-namespace accounts, false for flat accounts) in core-site or the job configuration.","Verify the value matches the actual account — a wrong explicit value causes different failures downstream.","If authenticating with SAS/user-delegation keys, always pin the hns flag since probing may be unavailable."],"exampleFix":"# before\n<property><name>fs.azure.account.hns.enabled</name><value/></property>\n# after (HNS-enabled account)\n<property>\n  <name>fs.azure.account.hns.enabled</name>\n  <value>true</value>\n</property>","handlingStrategy":"validation","validationCode":"String hns = conf.get(\"fs.azure.account.hns.enabled\");\nif (!\"true\".equals(hns) && !\"false\".equals(hns)) {\n  throw new IllegalArgumentException(\n      \"Set fs.azure.account.hns.enabled to true or false for this account\");\n}","typeGuard":null,"tryCatchPattern":"catch (InvalidConfigurationValueException ex) {\n  if (\"Failed to determine account type\".equals(ex.getMessage())) {\n    // set fs.azure.account.hns.enabled explicitly, then re-create the FileSystem\n  } else throw ex;\n}","preventionTips":["Always set fs.azure.account.hns.enabled explicitly, especially with SAS or user-delegation auth where probing may be restricted.","Template account configs per account type (HNS vs flat) so the flag is never omitted.","Validate the flag in deployment checks before jobs run."],"tags":["azure","abfs","configuration","hns","account-type"],"backgroundTag":"invalid-configuration-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}