{"record":{"id":"cb281efa61f86b82","repo":"apache/beam","slug":"unable-to-parse-representation","errorCode":null,"errorMessage":"Unable to parse representation","messagePattern":"Unable to parse representation","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/options/ProxyInvocationHandler.java","lineNumber":611,"sourceCode":"  }\n\n  /**\n   * Uses a Jackson {@link ObjectMapper} to attempt type conversion.\n   *\n   * @param method The method whose return type you would like to return.\n   * @param propertyName The name of the property that is being returned.\n   * @return An object matching the return type of the method passed in.\n   */\n  private Object getValueFromJson(String propertyName, Method method) {\n    JsonNode jsonNode = jsonOptions.get(propertyName);\n    return getValueFromJson(jsonNode, method);\n  }\n\n  private static Object getValueFromJson(JsonNode node, Method method) {\n    try {\n      return PipelineOptionsFactory.deserializeNode(node, method);\n    } catch (IOException e) {\n      throw new RuntimeException(\"Unable to parse representation\", e);\n    }\n  }\n\n  /**\n   * Returns a default value for the method based upon {@code @Default} metadata on the getter to\n   * return values. If there is no {@code @Default} annotation on the getter, then a <a href=\n   * \"https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html\">default</a> as per\n   * the Java Language Specification for the expected return type is returned.\n   *\n   * @param proxy The proxy object for which we are attempting to get the default.\n   * @param method The getter method that was invoked.\n   * @return The default value from an {@link Default} annotation if present, otherwise a default\n   *     value as per the Java Language Specification.\n   */\n  @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n  private Object getDefault(PipelineOptions proxy, Method method) {\n    if (method.getReturnType().equals(RuntimeValueProvider.class)) {\n      throw new RuntimeException(","sourceCodeStart":593,"sourceCodeEnd":629,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/options/ProxyInvocationHandler.java#L593-L629","documentation":"When reading PipelineOptions back from a JSON representation (e.g., after template deserialization), ProxyInvocationHandler.getValueFromJson delegates to PipelineOptionsFactory.deserializeNode. If that throws an IOException (malformed or incompatible JSON for the option's type), it is rethrown as a RuntimeException with message 'Unable to parse representation'.","triggerScenarios":"Calling PipelineOptionsFactory/serialization APIs that populate options from a JSON tree where a property's JSON node cannot be deserialized to the getter's declared type — e.g., corrupted or hand-edited template JSON, or a mismatched type for a @Default Jackson-deserializable option.","commonSituations":"Loading a saved pipeline template whose JSON was edited or produced by a different Beam version; a custom JacksonDeserializable option whose serialized form no longer matches its class; passing non-JSON-serializable values through jsonFactory-based output.","solutions":["Inspect the wrapped cause (getCause()) to find the exact property and IOException.","Regenerate the template/JSON from the same Beam version instead of hand-editing it.","Ensure the getter type has a valid Jackson deserializer and matches the JSON shape in the node.","Remove or fix the offending property value in the JSON input."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate JSON node before feeding options deserialization\nif (node == null || node.isMissingNode()) {\n  throw new IllegalArgumentException(\"Missing options JSON node\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  MyOptions opts = PipelineOptionsFactory.fromArgs(...).create();\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Unable to parse representation\")) {\n    LOG.error(\"Bad options JSON\", e.getCause()); // inspect cause for property/type\n  }\n}","preventionTips":["Never hand-edit pipeline template JSON.","Keep the same Beam version for template creation and loading.","Ensure custom option types have matching Jackson (de)serializers.","Validate saved JSON against the options interface schema before loading."],"tags":["java","json","deserialization","apache-beam"],"backgroundTag":"json-unmarshal-failed","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"}