{"record":{"id":"30a21708aa6c02f6","repo":"apache/beam","slug":"invalid-starting-strategy-valid-values-are-values","errorCode":null,"errorMessage":"Invalid starting strategy. Valid values are: {values}","messagePattern":"Invalid starting strategy\\. Valid values are: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergCdcReadSchemaTransformProvider.java","lineNumber":101,"sourceCode":"        return SchemaRegistry.createDefault()\n            .getToRowFunction(Configuration.class)\n            .apply(configuration)\n            .sorted()\n            .toSnakeCase();\n      } catch (NoSuchSchemaException e) {\n        throw new RuntimeException(e);\n      }\n    }\n\n    @Override\n    public PCollectionRowTuple expand(PCollectionRowTuple input) {\n      @Nullable String strategyStr = configuration.getStartingStrategy();\n      StartingStrategy strategy = null;\n      if (strategyStr != null) {\n        Optional<StartingStrategy> optional =\n            Enums.getIfPresent(StartingStrategy.class, strategyStr.toUpperCase());\n        if (!optional.isPresent()) {\n          throw new IllegalArgumentException(\n              \"Invalid starting strategy. Valid values are: \"\n                  + Arrays.toString(StartingStrategy.values()));\n        }\n        strategy = optional.get();\n      }\n\n      IcebergIO.ReadRows readRows =\n          IcebergIO.readRows(configuration.getIcebergCatalog())\n              .withCdc()\n              .from(IcebergUtils.parseTableIdentifier(configuration.getTable()))\n              .fromSnapshot(configuration.getFromSnapshot())\n              .toSnapshot(configuration.getToSnapshot())\n              .fromTimestamp(configuration.getFromTimestamp())\n              .toTimestamp(configuration.getToTimestamp())\n              .withStartingStrategy(strategy)\n              .streaming(configuration.getStreaming())\n              .keeping(configuration.getKeep())\n              .dropping(configuration.getDrop())","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergCdcReadSchemaTransformProvider.java#L83-L119","documentation":"IcebergCdcReadSchemaTransformProvider.expand parses the starting_strategy configuration string into the StartingStrategy enum. If the provided value (uppercased) does not match any enum constant, IllegalArgumentException is thrown listing the valid values. This validates user-supplied configuration before building the CDC read.","triggerScenarios":"Setting starting_strategy in the IcebergCdcReadSchemaTransform configuration to a string other than the enum constants of StartingStrategy (e.g. a typo or unsupported casing of a word) at expand() time, IcebergCdcReadSchemaTransformProvider.java:101.","commonSituations":"Typo in YAML/JSON pipeline options (e.g. 'startAt' instead of a valid value); passing a value valid in a different Beam version that was renamed; constructing config programmatically with an unvalidated string.","solutions":["Set starting_strategy to one of the valid StartingStrategy values (as printed in the error message).","Validate the option string against StartingStrategy values before submitting the pipeline.","Use Enums.getIfPresent with a default in programmatic construction, or rely on the enum constants in code rather than free-form strings.","Check the Beam version's StartingStrategy enum for the exact accepted names."],"exampleFix":"// before\nconfig.setStartingStrategy(\"startFromSnapshot\");\n\n// after (valid enum constant, e.g.)\nconfig.setStartingStrategy(\"INCLUSIVE\"); // must match StartingStrategy.values()","handlingStrategy":"validation","validationCode":"boolean valid = strategyStr == null\n    || Enums.getIfPresent(StartingStrategy.class, strategyStr.toUpperCase()).isPresent();\nif (!valid) throw new IllegalArgumentException(\"bad starting_strategy: \" + strategyStr);","typeGuard":null,"tryCatchPattern":"try {\n  transform.expand(input);\n} catch (IllegalArgumentException e) {\n  LOG.error(\"Invalid starting_strategy: {}\", e.getMessage());\n}","preventionTips":["Copy enum names directly from StartingStrategy.values().","Validate config strings before pipeline submission.","Pin and read the docs for your Beam version's accepted values.","Avoid hand-typed strategy strings in templates."],"tags":["java","iceberg","cdc","enum-validation","config"],"backgroundTag":"invalid-enum-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"}