invoke-ai/InvokeAI · error · UnknownGraphValidationError

Problem validating graph {e}

Error message

Problem validating graph {e}

What it means

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.

Source

Thrown at invokeai/app/services/shared/graph.py:1903

        """
        Checks if the graph is valid.

        Raises `UnknownGraphValidationError` if there is a problem validating the graph (not a validation error).
        """
        try:
            self.validate_self()
            return True
        except (
            DuplicateNodeIdError,
            NodeIdMismatchError,
            NodeNotFoundError,
            NodeFieldNotFoundError,
            CyclicalGraphError,
            InvalidEdgeError,
        ):
            return False
        except Exception as e:
            raise UnknownGraphValidationError(f"Problem validating graph {e}") from e

    def _is_destination_field_Any(self, edge: Edge) -> bool:
        """Checks if the destination field for an edge is of type typing.Any"""
        return get_input_field_type(self.get_node(edge.destination.node_id), edge.destination.field) == Any

    def _is_destination_field_list_of_Any(self, edge: Edge) -> bool:
        """Checks if the destination field for an edge is of type typing.Any"""
        return get_input_field_type(self.get_node(edge.destination.node_id), edge.destination.field) == list[Any]

    def _get_edge_nodes(self, edge: Edge) -> tuple[BaseInvocation, BaseInvocation]:
        try:
            return self.get_node(edge.source.node_id), self.get_node(edge.destination.node_id)
        except NodeNotFoundError:
            raise InvalidEdgeError(f"One or both nodes don't exist ({edge})")

    def _validate_edge_destination_uniqueness(self, edge: Edge, destination_node: BaseInvocation) -> None:
        input_edges = self._get_input_edges(edge.destination.node_id, edge.destination.field)
        if len(input_edges) > 0 and (

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Read the chained exception (__cause__) and its traceback to find the real failure
  2. Inspect the node/field referenced in the message for malformed or missing field annotations
  3. Fix the workflow JSON or custom node causing the underlying exception
  4. Update InvokeAI and node packs; if reproducible on valid input, file a bug report

Example fix

// before
valid = graph.is_valid()  # wraps opaque TypeError
// after
try:
    graph.validate_self()
except UnknownGraphValidationError as e:
    logger.exception("underlying cause", exc_info=e.__cause__)
Defensive patterns

Strategy: try-catch

Validate before calling

def safe_is_valid(graph) -> bool:
    try:
        return graph.is_valid()
    except UnknownGraphValidationError as e:
        logger.exception("validator crashed", exc_info=e.__cause__)
        return False

Type guard

def is_known_validation_error(exc: Exception) -> bool:
    return isinstance(exc, (NodeNotFoundError, CyclicalGraphError, InvalidEdgeError))

Try / catch

from invokeai.app.services.shared.graph import UnknownGraphValidationError

try:
    ok = graph.is_valid()
except UnknownGraphValidationError as e:
    root = e.__cause__
    logger.error("validator crashed: %r", root)
    # inspect the offending node/field or file a bug

Prevention

When it happens

Trigger: 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.

Common situations: Corrupted or partially-migrated workflow JSON, a custom node pack with malformed field annotations, index-deserialization returning unexpected object shapes.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/ae9870e5e374c9dc. Report an issue: GitHub.