{"record":{"id":"3c6cc4c5f041c783","repo":"apache/iceberg","slug":"invalid-scan-planning-mode-s-valid-values-are","errorCode":null,"errorMessage":"Invalid scan planning mode: %s. Valid values are: %s","messagePattern":"Invalid scan planning mode: (.+?)\\. Valid values are: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/rest/RESTCatalogProperties.java","lineNumber":90,"sourceCode":"    REFS\n  }\n\n  public enum ScanPlanningMode {\n    CLIENT,\n    SERVER;\n\n    public String modeName() {\n      return name().toLowerCase(Locale.ROOT);\n    }\n\n    public static ScanPlanningMode fromString(String mode) {\n      for (ScanPlanningMode planningMode : values()) {\n        if (planningMode.modeName().equalsIgnoreCase(mode)) {\n          return planningMode;\n        }\n      }\n\n      throw new IllegalArgumentException(\n          String.format(\n              \"Invalid scan planning mode: %s. Valid values are: %s\",\n              mode,\n              Arrays.stream(values())\n                  .map(ScanPlanningMode::modeName)\n                  .collect(Collectors.joining(\", \"))));\n    }\n  }\n\n  /**\n   * The base URI of the remote signer endpoint. Optional, defaults to {@link\n   * CatalogProperties#URI}.\n   *\n   * @deprecated since 1.12.0, will be removed in 1.13.0; there is no replacement\n   */\n  @Deprecated public static final String SIGNER_URI = \"signer.uri\";\n\n  /**","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/rest/RESTCatalogProperties.java#L72-L108","documentation":"ScanPlanningMode.fromString resolves a configured mode name (e.g. sync vs async scan planning) to the enum. After a case-insensitive comparison against each mode's modeName() fails, it throws IllegalArgumentException listing the valid values.","triggerScenarios":"Setting the REST catalog property for scan planning mode to a misspelled or unsupported value (e.g. 'asynchronous' instead of the accepted mode names); copying a property value from docs of a different Iceberg version.","commonSituations":"Config typos in catalog properties; switching client versions where mode names changed; IDE-less hand-edited properties files.","solutions":["Use one of the listed valid mode names from the error message","Check the ScanPlanningMode enum in your Iceberg version for exact modeName() values","Match case-insensitively is supported, but fix spelling, not casing","Upgrade/downgrade the library if the mode you need is genuinely missing"],"exampleFix":"// before\nMap.of(\"type\", \"rest\", \"rest.scan.planning-mode\", \"asynchronous\")\n// after\nMap.of(\"type\", \"rest\", \"rest.scan.planning-mode\", \"async\")","handlingStrategy":"validation","validationCode":"String mode = conf.get(\"rest.scan.planning-mode\");\nif (mode != null && Arrays.stream(ScanPlanningMode.values()).noneMatch(m -> m.modeName().equalsIgnoreCase(mode))) {\n  throw new IllegalArgumentException(\"Unknown scan planning mode: \" + mode);\n}","typeGuard":null,"tryCatchPattern":"try {\n  planningMode = ScanPlanningMode.fromString(cfgValue);\n} catch (IllegalArgumentException e) {\n  planningMode = ScanPlanningMode.SYNC; // explicit default after logging\n}","preventionTips":["Copy mode values from the ScanPlanningMode enum or docs of your exact version","Validate catalog properties at configuration load time","Avoid free-form strings for mode config; centralize constants","Check the error message's list of valid values"],"tags":["configuration","enum","rest-catalog"],"backgroundTag":"invalid-config-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}