{"record":{"id":"ae9870e5e374c9dc","repo":"invoke-ai/InvokeAI","slug":"problem-validating-graph-e","errorCode":null,"errorMessage":"Problem validating graph {e}","messagePattern":"Problem validating graph (.+?)","errorType":"exception","errorClass":"UnknownGraphValidationError","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/shared/graph.py","lineNumber":1903,"sourceCode":"        \"\"\"\n        Checks if the graph is valid.\n\n        Raises `UnknownGraphValidationError` if there is a problem validating the graph (not a validation error).\n        \"\"\"\n        try:\n            self.validate_self()\n            return True\n        except (\n            DuplicateNodeIdError,\n            NodeIdMismatchError,\n            NodeNotFoundError,\n            NodeFieldNotFoundError,\n            CyclicalGraphError,\n            InvalidEdgeError,\n        ):\n            return False\n        except Exception as e:\n            raise UnknownGraphValidationError(f\"Problem validating graph {e}\") from e\n\n    def _is_destination_field_Any(self, edge: Edge) -> bool:\n        \"\"\"Checks if the destination field for an edge is of type typing.Any\"\"\"\n        return get_input_field_type(self.get_node(edge.destination.node_id), edge.destination.field) == Any\n\n    def _is_destination_field_list_of_Any(self, edge: Edge) -> bool:\n        \"\"\"Checks if the destination field for an edge is of type typing.Any\"\"\"\n        return get_input_field_type(self.get_node(edge.destination.node_id), edge.destination.field) == list[Any]\n\n    def _get_edge_nodes(self, edge: Edge) -> tuple[BaseInvocation, BaseInvocation]:\n        try:\n            return self.get_node(edge.source.node_id), self.get_node(edge.destination.node_id)\n        except NodeNotFoundError:\n            raise InvalidEdgeError(f\"One or both nodes don't exist ({edge})\")\n\n    def _validate_edge_destination_uniqueness(self, edge: Edge, destination_node: BaseInvocation) -> None:\n        input_edges = self._get_input_edges(edge.destination.node_id, edge.destination.field)\n        if len(input_edges) > 0 and (","sourceCodeStart":1885,"sourceCodeEnd":1921,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/shared/graph.py#L1885-L1921","documentation":"UnknownGraphValidationError raised by the is_valid() path when validation throws an exception that is not one of the recognized validation errors (NodeNotFoundError, CyclicalGraphError, InvalidEdgeError). It means the graph validator itself hit something unexpected, not that the graph is merely invalid. The original message is embedded and the cause chained.","triggerScenarios":"Calling graph.is_valid() when validation code raises any non-whitelisted exception, e.g. a TypeError/KeyError from a malformed node payload, a missing field descriptor, or a bug/edge case in a custom node's field annotations.","commonSituations":"Corrupted or partially-migrated workflow JSON, a custom node pack with malformed field annotations, index-deserialization returning unexpected object shapes.","solutions":["Read the chained exception (__cause__) and its traceback to find the real failure","Inspect the node/field referenced in the message for malformed or missing field annotations","Fix the workflow JSON or custom node causing the underlying exception","Update InvokeAI and node packs; if reproducible on valid input, file a bug report"],"exampleFix":"// before\nvalid = graph.is_valid()  # wraps opaque TypeError\n// after\ntry:\n    graph.validate_self()\nexcept UnknownGraphValidationError as e:\n    logger.exception(\"underlying cause\", exc_info=e.__cause__)","handlingStrategy":"try-catch","validationCode":"def safe_is_valid(graph) -> bool:\n    try:\n        return graph.is_valid()\n    except UnknownGraphValidationError as e:\n        logger.exception(\"validator crashed\", exc_info=e.__cause__)\n        return False","typeGuard":"def is_known_validation_error(exc: Exception) -> bool:\n    return isinstance(exc, (NodeNotFoundError, CyclicalGraphError, InvalidEdgeError))","tryCatchPattern":"from invokeai.app.services.shared.graph import UnknownGraphValidationError\n\ntry:\n    ok = graph.is_valid()\nexcept UnknownGraphValidationError as e:\n    root = e.__cause__\n    logger.error(\"validator crashed: %r\", root)\n    # inspect the offending node/field or file a bug","preventionTips":["Check e.__cause__ first; it holds the real underlying exception","Keep InvokeAI and node packs updated to avoid validator edge cases","Sanitize workflow JSON (schema-validate) before deserializing"],"tags":["invokeai","graph-validation","unknown-error","bug"],"backgroundTag":"unknown-validation-error","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}