{"record":{"id":"c5ccbc8543754fa5","repo":"apache/beam","slug":"no-filesystem-found-for-scheme","errorCode":null,"errorMessage":"No filesystem found for scheme ","messagePattern":"No filesystem found for scheme ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java","lineNumber":558,"sourceCode":"    // Here, we just need the scheme, which is so circumscribed as to be\n    // very easy to extract with a regex.\n    Matcher matcher = FILE_SCHEME_PATTERN.matcher(spec);\n\n    if (!matcher.matches()) {\n      return DEFAULT_SCHEME;\n    } else {\n      return matcher.group(\"scheme\").toLowerCase();\n    }\n  }\n\n  /** Internal method to get {@link FileSystem} for {@code scheme}. */\n  @VisibleForTesting\n  static FileSystem getFileSystemInternal(String scheme) {\n    String lowerCaseScheme = scheme.toLowerCase();\n    Map<String, FileSystem> schemeToFileSystem = SCHEME_TO_FILESYSTEM.get();\n    FileSystem rval = schemeToFileSystem.get(lowerCaseScheme);\n    if (rval == null) {\n      throw new IllegalArgumentException(\"No filesystem found for scheme \" + scheme);\n    }\n    return rval;\n  }\n\n  /** ******************************** METHODS FOR REGISTRATION ********************************* */\n\n  /**\n   * Sets the default configuration in workers.\n   *\n   * <p>It will be used in {@link FileSystemRegistrar FileSystemRegistrars} for all schemes.\n   *\n   * <p>Outside of workers where Beam FileSystem API is used (e.g. test methods, user code executed\n   * during pipeline submission), consider use {@link #registerFileSystemsOnce} if initialize\n   * FileSystem of supported schema is the main goal.\n   */\n  @Internal\n  public static void setDefaultPipelineOptions(PipelineOptions options) {\n    checkNotNull(options, \"options cannot be null\");","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileSystems.java#L540-L576","documentation":"FileSystems.getFileSystemInternal looks up a registered FileSystem by URL scheme; if no provider is registered for that scheme it throws IllegalArgumentException 'No filesystem found for scheme X'. All FileSystems operations (match, create, open, rename) go through this lookup.","triggerScenarios":"Calling FileSystems.match/create/open/rename with a scheme (e.g. s3, gs, abfs) whose filesystem was never registered via FileSystems.setDefaultPipelineOptions + FileSystem registration, or using a misspelled/unsupported scheme.","commonSituations":"Using an S3 path in a pipeline without including beam-sdks-java-io-amazon-web-services dependency and registering S3FileSystem; running outside Dataflow/GCS where gs is not auto-registered; typos like 'filess://' or missing scheme ('/tmp/x' without a registered local scheme in some setups).","solutions":["Add the filesystem's Beam IO module dependency and ensure its FileSystem is registered (FileSystems.setDefaultPipelineOptions with proper options, or FileSystemRegistrar service loader)","Verify the scheme spelling in your path","Call FileSystems.getSchemeValidatedResource or pre-check with FileSystems.register... via SERVICE loader file META-INF/services/org.apache.beam.sdk.io.FileSystemRegistrar","For local files ensure 'file' scheme handling is available (it is registered by core)"],"exampleFix":"// before\nFileSystems.match(\"s3://my-bucket/data/*\"); // IllegalArgumentException\n// after\n// add dependency: org.apache.beam:beam-sdks-java-io-amazon-web-services\nS3Options s3Options = PipelineOptionsFactory.as(S3Options.class);\ns3Options.setAwsRegion(\"us-east-1\");\nFileSystems.setDefaultPipelineOptions(s3Options);\nFileSystems.match(\"s3://my-bucket/data/*\");","handlingStrategy":"validation","validationCode":"String scheme = RegisteredBarcode... ; // extract scheme from the path\nString scheme = path.substring(0, path.indexOf(\"://\"));\ntry {\n  FileSystems.getFileSystemInternal(scheme); // @VisibleForTesting; or attempt a cheap match\n} catch (IllegalArgumentException e) {\n  throw new IllegalStateException(\"Register a FileSystem for scheme: \" + scheme, e);\n}","typeGuard":"boolean isSupportedScheme(String path) {\n  try {\n    new URI(path).getScheme();\n    return Set.of(\"file\", \"gs\", \"s3\", \"s3a\", \"abfs\", \"adl\", \"hdfs\", \"http\", \"https\")\n        .contains(new URI(path).getScheme());\n  } catch (URISyntaxException e) { return false; }\n}","tryCatchPattern":"try {\n  return FileSystems.match(Collections.singletonList(spec));\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"No filesystem found for scheme\")) {\n    throw new IllegalStateException(\"Missing filesystem registration; add the Beam IO module\", e);\n  }\n  throw e;\n}","preventionTips":["Add and register the Beam IO module for every scheme you use (GCS, S3, Azure, HDFS)","Call FileSystems.setDefaultPipelineOptions with scheme-appropriate options at job startup","Validate path schemes in options validation (PipelineOptions#validate)","Document required schemes/dependencies for your pipeline users"],"tags":["java","apache-beam","filesystem","scheme","configuration"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}