{"record":{"id":"e683bc6c6269e218","repo":"apache/flink","slug":"failed-to-get-the-filesystem-of-artifact-artifact","errorCode":null,"errorMessage":"Failed to get the FileSystem of artifact {artifactFilePath}.","messagePattern":"Failed to get the FileSystem of artifact (.+?)\\.","errorType":"exception","errorClass":"CompletionException","httpStatus":null,"severity":"error","filePath":"flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java","lineNumber":428,"sourceCode":"\n                            for (Map.Entry<String, DistributedCache.DistributedCacheEntry>\n                                    artifacts : executionPlan.getUserArtifacts().entrySet()) {\n                                final Path artifactFilePath =\n                                        new Path(artifacts.getValue().filePath);\n                                try {\n                                    // Only local artifacts need to be uploaded.\n                                    if (!artifactFilePath.getFileSystem().isDistributedFS()) {\n                                        artifactFileNames.add(\n                                                new JobSubmitRequestBody.DistributedCacheFile(\n                                                        artifacts.getKey(),\n                                                        artifactFilePath.getName()));\n                                        filesToUpload.add(\n                                                new FileUpload(\n                                                        Paths.get(artifactFilePath.getPath()),\n                                                        RestConstants.CONTENT_TYPE_BINARY));\n                                    }\n                                } catch (IOException e) {\n                                    throw new CompletionException(\n                                            new FlinkException(\n                                                    \"Failed to get the FileSystem of artifact \"\n                                                            + artifactFilePath\n                                                            + \".\",\n                                                    e));\n                                }\n                            }\n\n                            final JobSubmitRequestBody requestBody =\n                                    new JobSubmitRequestBody(\n                                            executionPlanFile.getFileName().toString(),\n                                            jarFileNames,\n                                            artifactFileNames);\n\n                            return Tuple2.of(\n                                    requestBody, Collections.unmodifiableCollection(filesToUpload));\n                        });\n","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java#L410-L446","documentation":"Thrown when RestClusterClient.submitJob cannot resolve the FileSystem for a distributed-cache artifact path. Before uploading local artifacts, the client calls artifactFilePath.getFileSystem() to check isDistributedFS(). If the artifact path uses an unrecognized or unsupported scheme (e.g., s3:// without the S3 filesystem plugin loaded), this IOException is caught and wrapped in a FlinkException.","triggerScenarios":"An artifact registered via DistributedCache uses a path with a scheme like 's3://' or 'hdfs://' but the corresponding FileSystem plugin is not on the client classpath; the artifact path is malformed; the FileSystem factory for the scheme is not registered.","commonSituations":"Registering a distributed-cache file with an HDFS path but not including flink-hadoop-fs or the S3 plugin JARs in the client lib directory; artifact path uses a custom scheme whose plugin JAR is missing from Flink's lib/ folder; typo in the artifact path scheme.","solutions":["If the artifact is local, use a local file:// path or a plain filesystem path instead of a distributed FS scheme.","Add the missing filesystem plugin JAR (e.g., flink-s3-fs-hadoop or flink-hadoop-fs) to Flink's lib/ directory and the client classpath.","Verify the artifact path is well-formed and the scheme is supported by checking FileSystem.get(URI) manually.","Ensure all required Hadoop or cloud-storage configuration (core-site.xml, flink-conf.yaml) is on the client."],"exampleFix":"// before — artifact path uses scheme without plugin\nenv.registerCachedFile(\"s3://my-bucket/artifact.dat\", \"artifact\");\n// after — use local path or ensure plugin is loaded\nenv.registerCachedFile(\"file:///opt/artifacts/artifact.dat\", \"artifact\");","handlingStrategy":"validation","validationCode":"// Validate artifact path FileSystem before submission\nPath artifactPath = new Path(artifactFilePath);\ntry {\n    FileSystem fs = artifactPath.getFileSystem();\n    if (!fs.isDistributedFS()) {\n        // local — OK, will be uploaded\n    }\n} catch (IOException e) {\n    throw new IllegalArgumentException(\"Artifact path '\" + artifactFilePath + \"' has an unresolvable filesystem scheme\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.submitJob(executionPlan).get();\n} catch (ExecutionException e) {\n    Throwable cause = ExceptionUtils.stripExecutionException(e);\n    if (cause.getMessage().contains(\"Failed to get the FileSystem of artifact\")) {\n        // check for missing FS plugin, switch to local path\n    }\n}","preventionTips":["Prefer local file:// paths for distributed-cache artifacts.","Include all required filesystem plugin JARs in Flink lib/ directory.","Test artifact path resolution with FileSystem.get(URI) before submission."],"tags":["filesystem","job-submission","distributed-cache","rest-client"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}