{"record":{"id":"e6fdb2ac42a8e4e9","repo":"apache/hadoop","slug":"error-in-instantiating-yarnclient","errorCode":null,"errorMessage":"Error in instantiating YarnClient","messagePattern":"Error in instantiating YarnClient","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java","lineNumber":181,"sourceCode":"   this(conf, resMgrDelegate, new ClientCache(conf, resMgrDelegate));\n  }\n\n  /**\n   * Similar to {@link YARNRunner#YARNRunner(Configuration, ResourceMgrDelegate)}\n   * but allowing injecting {@link ClientCache}. Enable mocking and testing.\n   * @param conf the configuration object\n   * @param resMgrDelegate the resource manager delegate\n   * @param clientCache the client cache object.\n   */\n  public YARNRunner(Configuration conf, ResourceMgrDelegate resMgrDelegate,\n      ClientCache clientCache) {\n    this.conf = conf;\n    try {\n      this.resMgrDelegate = resMgrDelegate;\n      this.clientCache = clientCache;\n      this.defaultFileContext = FileContext.getFileContext(this.conf);\n    } catch (UnsupportedFileSystemException ufe) {\n      throw new RuntimeException(\"Error in instantiating YarnClient\", ufe);\n    }\n  }\n  \n  @Private\n  /**\n   * Used for testing mostly.\n   * @param resMgrDelegate the resource manager delegate to set to.\n   */\n  public void setResourceMgrDelegate(ResourceMgrDelegate resMgrDelegate) {\n    this.resMgrDelegate = resMgrDelegate;\n  }\n  \n  @Override\n  public void cancelDelegationToken(Token<DelegationTokenIdentifier> arg0)\n      throws IOException, InterruptedException {\n    throw new UnsupportedOperationException(\"Use Token.renew instead\");\n  }\n","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java#L163-L199","documentation":"Thrown from the YARNRunner constructor when FileContext.getFileContext(conf) raises UnsupportedFileSystemException — the URI scheme of the configured default filesystem (fs.defaultFS) has no FileSystem implementation available. It is wrapped in a RuntimeException with this message and fails the whole job-submission path because YARNRunner needs a FileContext to stage job files. This is a configuration/classpath problem, not a cluster-side one.","triggerScenarios":"Constructing YARNRunner (normally via JobClient/Cluster with mapreduce.framework.name=yarn) when fs.defaultFS is unset (falls back to file:/ semantics issues), malformed, or names a scheme (e.g. s3a:, abfs:, viewfs:) whose JARs are absent from the client classpath.","commonSituations":"fs.defaultFS still defaulting to file:/// because core-site.xml is not on the client classpath; Upgrading Hadoop where a scheme moved out of hadoop-common (e.g. s3n removal) and stale config points at it; Typo in the scheme: hdfs:// vs hdfs:/, or viewfs:// with missing mount-table config","solutions":["Set fs.defaultFS correctly in core-site.xml (e.g. hdfs://namenode:8020) and confirm the file is on the client classpath","Verify the scheme resolves: hdfs fs -ls / (or a tiny FileContext.getFileContext(conf) smoke test) with the same classpath the job uses","Add the connector JARs for the scheme (hadoop-aws for s3a, hadoop-azure for abfs) to the client classpath","Check for scheme typos and that any viewfs mount table config is present"],"exampleFix":"<!-- before: scheme has no impl on classpath -->\n<property><name>fs.defaultFS</name><value>abfs://container@acct.dfs.core.windows.net/</value></property>\n\n<!-- after -->\n<property><name>fs.defaultFS</name><value>hdfs://nn.example.com:8020</value></property>\n<!-- plus ensure core-site.xml is on the client classpath -->","handlingStrategy":"validation","validationCode":"Configuration conf = new Configuration();\nURI u = FileSystem.getDefaultUri(conf);\ntry {\n  java.nio.file.Path impl = null; // smoke-test the scheme resolves\n  org.apache.hadoop.fs.FileContext.getFileContext(conf);\n} catch (org.apache.hadoop.fs.UnsupportedFileSystemException e) {\n  throw new IllegalStateException(\"fs.defaultFS \" + u\n      + \" has no filesystem implementation on the classpath\", e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set fs.defaultFS (hdfs://nn:8020) in core-site.xml and ship core-site.xml on the client classpath","Smoke-test FileContext.getFileContext(conf) in a bootstrap check before creating the Cluster/JobClient","Keep scheme connector JARs (hadoop-aws, hadoop-azure) matched to the Hadoop version when using object stores","After upgrades, grep configs for removed schemes (s3n, etc.) that no longer have implementations"],"tags":["hadoop","mapreduce","yarn","filesystem","configuration","classpath","client-setup"],"backgroundTag":"unsupported-filesystem","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}