{"record":{"id":"1aa8aae5b486b63b","repo":"apache/beam","slug":"errorformissingscheme-scheme-path","errorCode":null,"errorMessage":"errorForMissingScheme(scheme, path)","messagePattern":"errorForMissingScheme\\(scheme, path\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/io/filesystem/filesystem.go","lineNumber":133,"sourceCode":"\tRename(ctx context.Context, oldpath, newpath string) error\n}\n\nfunc getScheme(path string) string {\n\tif index := strings.Index(path, \"://\"); index > 0 {\n\t\treturn path[:index]\n\t}\n\treturn \"default\"\n}\n\n// ValidateScheme panics if the given path's scheme does not have a\n// corresponding file system registered.\nfunc ValidateScheme(path string) {\n\tif strings.TrimSpace(path) == \"\" {\n\t\tpanic(\"empty file glob provided\")\n\t}\n\tscheme := getScheme(path)\n\tif _, ok := registry[scheme]; !ok {\n\t\tpanic(errorForMissingScheme(scheme, path))\n\t}\n}\n","sourceCodeStart":115,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/io/filesystem/filesystem.go#L115-L136","documentation":"ValidateScheme panics with errorForMissingScheme when the path's URI scheme (e.g. s3://, gs://, file://) has no filesystem registered in Beam's filesystem registry. Beam can only route I/O to schemes registered via filesystem.NewSchemeRegistrar or built-in init() registration. This fail-fast prevents an obscure nil filesystem later in the pipeline.","triggerScenarios":"Calling Read/Write/MatchFiles/TestFilesystem with a path whose scheme was never registered: using s3:// without importing the s3 package, a typo like httpx://, or an empty scheme from a malformed path like \"/no-scheme\" when no default filesystem applies.","commonSituations":"Forgetting to blank-import _ \"github.com/apache/beam/sdks/go/pkg/beam/io/filesystem/s3\" in a custom pipeline; switching storage backends without importing the new driver; path parsing producing an unexpected scheme.","solutions":["Blank-import the filesystem package for the scheme: _ \".../io/filesystem/filesystem/s3\"","Verify the scheme in your path is correct (lowercase, no typos)","Register a custom filesystem with filesystem.NewSchemeRegistrar if using a custom backend","Print getScheme(path) equivalent to confirm what scheme Beam extracted"],"exampleFix":"// before\nimport (\n    _ \"github.com/apache/beam/sdks/go/pkg/beam/io/filesystem/gcs\"\n)\nfilesystem.Read(ctx, s, \"s3://bucket/key\")\n// after\nimport (\n    _ \"github.com/apache/beam/sdks/go/pkg/beam/io/filesystem/gcs\"\n    _ \"github.com/apache/beam/sdks/go/pkg/beam/io/filesystem/s3\"\n)\nfilesystem.Read(ctx, s, \"s3://bucket/key\")","handlingStrategy":"validation","validationCode":"u, err := url.Parse(path)\nif err != nil || u.Scheme == \"\" { return fmt.Errorf(\"path %q has no scheme\", path) }\n// ensure the driver is imported for the scheme","typeGuard":null,"tryCatchPattern":"defer func() { if r := recover(); r != nil { log.Fatalf(\"unsupported scheme: %v\", r) } }()","preventionTips":["Blank-import every filesystem driver you use (s3, gcs)","Keep a central list of supported schemes and validate pipeline inputs against it","Test pipeline construction in CI so missing imports fail before deploy"],"tags":["go","beam-io","panic","filesystem","scheme"],"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-20T03:17:13.778Z"}