{"record":{"id":"30167e8de82013df","repo":"apache/beam","slug":"failed-to-validate-s-30167e","errorCode":null,"errorMessage":"Failed to validate %s","messagePattern":"Failed to validate (.+?)","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/io/TFRecordReadSchemaTransformConfiguration.java","lineNumber":57,"sourceCode":" * <p><b>Internal only:</b> This class is actively being worked on, and it will likely change. We\n * provide no backwards compatibility guarantees, and it should not be implemented outside the Beam\n * repository.\n */\n@DefaultSchema(AutoValueSchema.class)\n@AutoValue\npublic abstract class TFRecordReadSchemaTransformConfiguration implements Serializable {\n\n  public void validate() {\n    String invalidConfigMessage = \"Invalid TFRecord Read configuration: \";\n\n    if (getValidate()) {\n      String filePattern = getFilePattern();\n      try {\n        MatchResult matches = FileSystems.match(filePattern);\n        checkState(\n            !matches.metadata().isEmpty(), \"Unable to find any files matching %s\", filePattern);\n      } catch (IOException e) {\n        throw new IllegalStateException(\n            String.format(invalidConfigMessage + \"Failed to validate %s\", filePattern), e);\n      }\n    }\n\n    ErrorHandling errorHandling = getErrorHandling();\n    if (errorHandling != null) {\n      checkArgument(\n          !Strings.isNullOrEmpty(errorHandling.getOutput()),\n          \"%sOutput must not be empty if error handling specified.\",\n          invalidConfigMessage);\n    }\n  }\n\n  /** Instantiates a {@link TFRecordReadSchemaTransformConfiguration.Builder} instance. */\n  public static TFRecordReadSchemaTransformConfiguration.Builder builder() {\n    return new AutoValue_TFRecordReadSchemaTransformConfiguration.Builder();\n  }\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/io/TFRecordReadSchemaTransformConfiguration.java#L39-L75","documentation":"TFRecordReadSchemaTransformConfiguration's validate step matches the configured file pattern via FileSystems.match(); an IOException there is wrapped in an IllegalStateException prefixed with an invalid-config message. It means the configured input could not be validated as accessible files before pipeline execution.","triggerScenarios":"Constructing a TFRecord read SchemaTransform with a filePattern that FileSystems.match cannot resolve — unregistered scheme, unreachable filesystem, or I/O/auth error; requires error handling/validate path in the transform's validate().","commonSituations":"YAML/SQL pipeline config pointing at a typo'd gs:// path; missing GCS connector dependency; permissions or credentials failing at graph-construction validation time.","solutions":["Correct the filePattern value in the transform configuration and inspect the wrapped IOException cause.","Ensure the filesystem implementation for the scheme is on the classpath (e.g. beam-sdks-java-io-google-cloud-platform).","Route failures to the errorHandling output or disable validation if the files appear only at runtime."],"exampleFix":"// before\n.filePattern(\"gs://bucket/no-such-dir/*.tfrecord\") // plus connectivity failure\n\n// after\n.filePattern(\"gs://bucket/data/*.tfrecord\") // reachable, valid path","handlingStrategy":"validation","validationCode":"MatchResult mr = FileSystems.match(cfg.getFilePattern());\nif (mr.metadata().isEmpty()) {\n  throw new IllegalArgumentException(\"TFRecord SchemaTransform filePattern matched no files: \" + cfg.getFilePattern());\n}","typeGuard":null,"tryCatchPattern":"try { transform.validate(); } catch (IllegalStateException e) { if (e.getCause() instanceof IOException) { log.error(\"FilePattern validation failed: {}\", cfg.getFilePattern(), e.getCause()); } throw e; }","preventionTips":["Validate filePattern strings in YAML/SQL config before pipeline assembly.","Register required filesystem dependencies (GCS/S3/HDFS) in the runner classpath."],"tags":["java","beam","schema-transform","validation","filesystem"],"backgroundTag":"invalid-config-value","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"}