{"record":{"id":"8623f36e010e7b4d","repo":"apache/flink","slug":"cannot-support-file-system-for-fsuri-getscheme","errorCode":null,"errorMessage":"Cannot support file system for '${fsUri.getScheme()}' via Hadoop, because Hadoop is not in the classpath, or some classes are missing from the classpath.","messagePattern":"Cannot support file system for '(.+?)' via Hadoop, because Hadoop is not in the classpath, or some classes are missing from the classpath\\.","errorType":"exception","errorClass":"UnsupportedFileSystemSchemeException","httpStatus":null,"severity":"error","filePath":"flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFsFactory.java","lineNumber":187,"sourceCode":"            } catch (UnknownHostException e) {\n                String message =\n                        \"The Hadoop file system's authority (\"\n                                + initUri.getAuthority()\n                                + \"), specified by either the file URI or the configuration, cannot be resolved.\";\n\n                throw new IOException(message, e);\n            }\n\n            HadoopFileSystem fs = new HadoopFileSystem(hadoopFs);\n\n            // create the Flink file system, optionally limiting the open connections\n            if (flinkConfig != null) {\n                return limitIfConfigured(fs, scheme, flinkConfig);\n            } else {\n                return fs;\n            }\n        } catch (ReflectiveOperationException | LinkageError e) {\n            throw new UnsupportedFileSystemSchemeException(\n                    \"Cannot support file system for '\"\n                            + fsUri.getScheme()\n                            + \"' via Hadoop, because Hadoop is not in the classpath, or some classes \"\n                            + \"are missing from the classpath.\",\n                    e);\n        } catch (IOException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new IOException(\"Cannot instantiate file system for URI: \" + fsUri, e);\n        }\n    }\n\n    private static String getMissingAuthorityErrorPrefix(URI fsURI) {\n        return \"The given file system URI (\"\n                + fsURI.toString()\n                + \") did not describe the authority \"\n                + \"(like for example HDFS NameNode address/port or S3 host). \"\n                + \"The attempt to use a configured default authority failed: \";","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFsFactory.java#L169-L205","documentation":"While loading/instantiating the Hadoop filesystem, a ReflectiveOperationException or LinkageError occurred, meaning Hadoop classes could not be loaded at all or are inconsistent on the classpath. Flink wraps this in UnsupportedFileSystemSchemeException telling you Hadoop is missing (or partially missing) from the classpath.","triggerScenarios":"Any reflection failure or LinkageError (NoSuchMethodError, NoClassDefFoundError, ClassNotFoundException) while getting/instantiating the FileSystem class in HadoopFsFactory.create; e.g. hadoop-common present but hadoop-hdfs absent, or mixed Hadoop versions.","commonSituations":"Multiple Hadoop jars of different versions in lib/ and user jars; a user-fat-jar bundling Hadoop with relocation conflicts; missing dependency of the chosen connector (e.g. hadoop-aws without matching hadoop-common); running on a Hadoop-free Flink distribution without adding any Hadoop filesystem jar.","solutions":["Clean the classpath: keep exactly one consistent set of Hadoop jars (or one Flink filesystem plugin) in Flink lib/ and remove Hadoop classes from user fat-jars","Use the prebuilt flink-shaded-hadoop or the scheme-specific Flink plugins (flink-s3-fs-hadoop, flink-gs-fs-hadoop, ...) matching your Flink version","Inspect the suppressed cause in the exception to identify the exact missing class and add that dependency","Verify no duplicate classes with `mvn dependency:tree` or by listing Hadoop jars: ls lib/*hadoop*"],"exampleFix":"# before: mixed jars\nlib/hadoop-common-2.8.5.jar lib/hadoop-hdfs-3.3.4.jar\n# after: one consistent set\nlib/flink-shaded-hadoop-2-uber-2.8.3-1.8.3-10.0.jar","handlingStrategy":"try-catch","validationCode":"// pre-flight: can we load Hadoop's FileSystem at all?\ntry {\n    Class.forName(\"org.apache.hadoop.fs.FileSystem\", false, Thread.currentThread().getContextClassLoader());\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Hadoop not on classpath\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    fs = FileSystem.get(uri);\n} catch (UnsupportedFileSystemSchemeException e) {\n    // inspect cause: LinkageError/ReflectiveOperationException => classpath conflict,\n    // fix jars; this is not retryable as-is\n}","preventionTips":["Keep a single consistent Hadoop/plugin jar set in lib/","Exclude hadoop-* from user fat-jars (provided scope)","Automate a classpath audit for duplicate hadoop classes in CI"],"tags":["hdfs","classpath","dependency-conflict","linkage-error"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}