{"record":{"id":"b268ba8003d73406","repo":"apache/beam","slug":"failed-to-convert-configuration-map-to-yaml-the-following","errorCode":null,"errorMessage":"Failed to convert configuration map to YAML. The following keys contain values that cannot be serialized: %s. Please ensure all configuration values are simple types (String, Number, Boolean) or properly structured Maps and Lists. Original error: %s","messagePattern":"Failed to convert configuration map to YAML\\. The following keys contain values that cannot be serialized: (.+?)\\. Please ensure all configuration values are simple types \\(String, Number, Boolean\\) or properly structured Maps and Lists\\. Original error: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/YamlUtils.java","lineNumber":190,"sourceCode":"            field ->\n                toBeamValue(\n                    field, map.get(maybeGetSnakeCase(field.getName(), toCamelCase)), toCamelCase))\n        .collect(toRow(rowSchema));\n  }\n\n  private static String maybeGetSnakeCase(String str, boolean getSnakeCase) {\n    return getSnakeCase ? CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, str) : str;\n  }\n\n  public static String yamlStringFromMap(@Nullable Map<String, Object> map) {\n    if (map == null || map.isEmpty()) {\n      return \"\";\n    }\n    try {\n      return new Yaml().dumpAsMap(map);\n    } catch (YAMLException e) {\n      List<String> problematicKeys = findNonSerializableKeys(map);\n      throw new IllegalArgumentException(\n          String.format(\n              \"Failed to convert configuration map to YAML. \"\n                  + \"The following keys contain values that cannot be serialized: %s. \"\n                  + \"Please ensure all configuration values are simple types (String, Number, Boolean) \"\n                  + \"or properly structured Maps and Lists. Original error: %s\",\n              problematicKeys, e.getMessage()),\n          e);\n    }\n  }\n\n  private static List<String> findNonSerializableKeys(Map<String, Object> map) {\n    List<String> problematicKeys = new ArrayList<>();\n    Yaml yaml = new Yaml();\n    for (Map.Entry<String, Object> entry : map.entrySet()) {\n      try {\n        yaml.dump(entry.getValue());\n      } catch (YAMLException e) {\n        problematicKeys.add(","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/YamlUtils.java#L172-L208","documentation":"Error \"Failed to convert configuration map to YAML. The following keys contain values that cannot be serialized: %s. Please ensure all configuration values are simple types (String, Number, Boolean) or properly structured Maps and Lists. Original error: %s\" thrown in apache/beam.","triggerScenarios":"Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/YamlUtils.java:190 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure all values in the configuration map are simple types (String, Number, Boolean) or nested Maps/Lists; convert custom objects to those shapes first.","Strip or stringify unsupported values (dates, enums, POJOs) before calling yamlStringFromMap.","Catch the YAMLException path and use the reported key list to locate and fix the offending entries, then retry the dump."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}