{"record":{"id":"df3353076f263dca","repo":"invoke-ai/InvokeAI","slug":"missinginputexception","errorCode":null,"errorMessage":"MissingInputException","messagePattern":"MissingInputException","errorType":"validation","errorClass":"MissingInputException","httpStatus":null,"severity":"error","filePath":"invokeai/app/invocations/baseinvocation.py","lineNumber":236,"sourceCode":"        \"\"\"\n        for field_name, field in type(self).model_fields.items():\n            if not field.json_schema_extra or callable(field.json_schema_extra):\n                # something has gone terribly awry, we should always have this and it should be a dict\n                continue\n\n            # Here we handle the case where the field is optional in the pydantic class, but required\n            # in the `invoke()` method.\n\n            orig_default = field.json_schema_extra.get(\"orig_default\", PydanticUndefined)\n            orig_required = field.json_schema_extra.get(\"orig_required\", True)\n            input_ = field.json_schema_extra.get(\"input\", None)\n            if orig_default is not PydanticUndefined and not hasattr(self, field_name):\n                setattr(self, field_name, orig_default)\n            if orig_required and orig_default is PydanticUndefined and getattr(self, field_name) is None:\n                if input_ == Input.Connection:\n                    raise RequiredConnectionException(type(self).model_fields[\"type\"].default, field_name)\n                elif input_ == Input.Any:\n                    raise MissingInputException(type(self).model_fields[\"type\"].default, field_name)\n\n        # skip node cache codepath if it's disabled\n        if services.configuration.node_cache_size == 0:\n            return self.invoke(context)\n\n        output: BaseInvocationOutput\n        if self.use_cache:\n            key = services.invocation_cache.create_key(self)\n            cached_value = services.invocation_cache.get(key)\n            if cached_value is None:\n                services.logger.debug(f'Invocation cache miss for type \"{self.get_type()}\": {self.id}')\n                output = self.invoke(context)\n                services.invocation_cache.save(key, output)\n                return output\n            else:\n                services.logger.debug(f'Invocation cache hit for type \"{self.get_type()}\": {self.id}')\n                return cached_value\n        else:","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/invocations/baseinvocation.py#L218-L254","documentation":"MissingInputException is raised in invoke_internal when a required field with no default is None at execution time and its declared input kind is Input.Any (not strictly Input.Connection). Unlike RequiredConnectionException, the value could have come from a direct assignment or a connection, but neither supplied one.","triggerScenarios":"A node whose required Input.Any field has neither an incoming edge nor an explicit direct value; calling run_node directly on a partially constructed invocation; graph deserialization dropping a field value.","commonSituations":"Programmatic graph building where a required prompt/string input was omitted; older saved workflows whose schema changed so the field no longer deserializes; testing harnesses instantiating invocations without setting required fields.","solutions":["Provide a value for the missing field, either via an edge or a direct input on the node.","Check for schema/version drift: re-open and re-save the workflow in the current InvokeAI version so defaults are applied.","Give the field a default in its InputField declaration if a sensible default exists.","When testing with run_node, set every required field on the invocation instance."],"exampleFix":"// before\nnode = DenoiseLatents(id=\"dn\")  # positive_conditioning never set\n\n// after\nnode = DenoiseLatents(\n  id=\"dn\",\n  positive_conditioning=prompt_field,\n  negative_conditioning=neg_prompt_field,\n  latents=latents_field,\n)","handlingStrategy":"validation","validationCode":"# check all required no-default fields are set before running\nfor node in graph.nodes.values():\n    for name, field in type(node).model_fields.items():\n        extra = field.json_schema_extra or {}\n        if extra.get(\"orig_required\", True) and field.is_required() and getattr(node, name, None) is None:\n            raise ValueError(f\"node {node.id}: required input '{name}' is missing\")","typeGuard":null,"tryCatchPattern":"try:\n    result = run_node(node, context)\nexcept MissingInputException as e:\n    logger.error(\"node %s missing input %s\", e.node_id, e.field_name)","preventionTips":["Set every required field when constructing invocations programmatically","Re-save old workflows in the current version to apply schema migrations","Use graph validation endpoints before execution"],"tags":["invocation-graph","missing-input","input-validation"],"backgroundTag":"missing-required-input","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}