{"record":{"id":"feafc6c54c382694","repo":"apache/hadoop","slug":"dtfetcher-for-service-service-does-not-allow-a","errorCode":null,"errorMessage":"DtFetcher for service '{service}' does not allow aliasing.  Cannot apply alias '{alias}'.  Drop alias flag to get token for this service.","messagePattern":"DtFetcher for service '(.+?)' does not allow aliasing\\.  Cannot apply alias '(.+?)'\\.  Drop alias flag to get token for this service\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/DtFileOperations.java","lineNumber":216,"sourceCode":"        if (!fetcher.isTokenRequired()) {\n          String message = \"DtFetcher for service '\" + service +\n              \"' does not require a token.  Check your configuration.  \" +\n              \"Note: security may be disabled or there may be two DtFetcher \" +\n              \"providers for the same service designation.\";\n          LOG.error(message);\n          throw new IllegalArgumentException(message);\n        }\n        token = fetcher.addDelegationTokens(conf, creds, renewer,\n                                            stripPrefix(url));\n      }\n    }\n    if (alias != null) {\n      if (token == null) {\n        String message = \"DtFetcher for service '\" + service + \"'\" +\n            \" does not allow aliasing.  Cannot apply alias '\" + alias + \"'.\" +\n            \"  Drop alias flag to get token for this service.\";\n        LOG.error(message);\n        throw new IOException(message);\n      }\n      Token<?> aliasedToken = token.copyToken();\n      aliasedToken.setService(alias);\n      creds.addToken(alias, aliasedToken);\n      LOG.info(\"Add token with service \" + alias);\n    }\n    doFormattedWrite(tokenFile, fileFormat, creds, conf);\n  }\n\n  /** Alias a token from a file and save back to file in the local filesystem.\n   *  @param tokenFile a local File object to hold the input and output.\n   *  @param fileFormat a string equal to FORMAT_PB or FORMAT_JAVA, for output\n   *  @param alias overwrite service field of fetched token with this text.\n   *  @param service only apply alias to tokens matching this service text.\n   *  @param conf Configuration object passed along.\n   *  @throws IOException raised on errors performing I/O.\n   */\n  public static void aliasTokenFile(File tokenFile, String fileFormat,","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/DtFileOperations.java#L198-L234","documentation":"Error \"DtFetcher for service '{service}' does not allow aliasing.  Cannot apply alias '{alias}'.  Drop alias flag to get token for this service.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/DtFileOperations.java:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not request aliasing for this service: drop the alias flag and fetch the token for '{service}' directly, because the DtFetcher for this service does not support aliasing to '{alias}'."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}