{"record":{"id":"1dac8269d1e630bf","repo":"apache/beam","slug":"no-files-matching-pattern-q","errorCode":null,"errorMessage":"no files matching pattern %q","messagePattern":"no files matching pattern %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/io/fileio/match.go","lineNumber":152,"sourceCode":") error {\n\tif strings.TrimSpace(glob) == \"\" {\n\t\treturn nil\n\t}\n\n\tfs, err := filesystem.New(ctx, glob)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer fs.Close()\n\n\tfiles, err := fs.List(ctx, glob)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(files) == 0 {\n\t\tif !allowEmptyMatch(glob, fn.EmptyTreatment) {\n\t\t\treturn fmt.Errorf(\"no files matching pattern %q\", glob)\n\t\t}\n\t\treturn nil\n\t}\n\n\tmetadata, err := metadataFromFiles(ctx, fs, files)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, md := range metadata {\n\t\temit(md)\n\t}\n\n\treturn nil\n}\n\nfunc allowEmptyMatch(glob string, treatment emptyTreatment) bool {\n\tswitch treatment {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/io/fileio/match.go#L134-L170","documentation":"fileio.MatchAll's ProcessElement expands the glob against the filesystem and, when zero files match and EmptyTreatment does not allow an empty match, fails with this error. It exists to surface likely-mistyped paths/permissions instead of silently producing an empty pipeline.","triggerScenarios":"len(files) == 0 after Match(ctx, fs, glob) and allowEmptyMatch(glob, fn.EmptyTreatment) is false (match.go:152) — i.e. EmptyTreatment is EmptyTreatmentDisallow (default) or EmptyTreatmentIfNonEmptyMatch semantics.","commonSituations":"Typo in the glob or path; input directory empty because the upstream producer hasn't run; files stored on a filesystem view the worker can't see (wrong container/FS registration); date-partitioned path for the wrong day.","solutions":["Fix the glob pattern — test it with filesystem.Match or gsutil/ls locally against the same paths","Set EmptyTreatment: fileio.EmptyTreatmentAllow in the MatchAll options when an empty match is legitimate","Verify the upstream job that produces the files completed and wrote to the expected location","Check filesystem/permissions: the worker must be able to list the containing directory"],"exampleFix":"// before\nmatches := fileio.MatchAll(s, fileio.MatchAllEmptyTreatment(0), glob)\n// after: allow legitimately empty matches\nmatches := fileio.MatchAll(s, fileio.MatchAllEmptyTreatment(fileio.EmptyTreatmentAllow), glob)","handlingStrategy":"fallback","validationCode":"matched, _ := fs.List(context.Background(), pattern)\nif len(matched) == 0 {\n\t// verify upstream producer ran, or switch EmptyTreatment to Allow\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n\tif r := recover(); r != nil {\n\t\tlog.Printf(\"glob %q matched nothing; check upstream producer or EmptyTreatmentAllow\", glob)\n\t}\n}()","preventionTips":["Test globs locally with filesystem.Match against the real store before running the pipeline","Use EmptyTreatmentAllow when an empty input is a valid state (e.g. hourly partitions)","Verify the upstream job finished and paths exist from the worker's network/permissions"],"tags":["filesystem","glob","file-not-found","beam-io"],"backgroundTag":"file-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"}