Troubleshooting¶
This guide covers the most common issues when using
azure-functions-durable-graph in Azure Functions Python v2 apps with Durable Functions.
If you are still setting up, read Installation and Quickstart first.
Fast triage checklist¶
Before deep debugging, confirm:
- Python 3.10+
- Pydantic v2 installed
azure-functionsandazure-functions-durableinstalled- Azure Functions Python v2 decorator model in use
host.jsonincludes Durable Functions extension bundleapp = runtime.function_appis the module-level variable infunction_app.py
Import and environment issues¶
ImportError: No module named 'azure_functions_durable_graph'¶
Cause:
- package not installed in active environment
Fix:
- reinstall package in the same interpreter used by the function host
- verify environment activation before running host
ImportError: No module named 'azure.durable_functions'¶
Cause:
azure-functions-durabledependency missing
Fix:
- add
azure-functions-durableto dependencies - ensure local and deployment environments both include it
Pydantic version mismatch¶
Symptoms:
- attribute errors or model behavior inconsistent with v2
Cause:
- Pydantic v1 installed transitively
Fix:
- pin and install
pydantic>=2,<3
Version drift
If local tests pass but deployed runtime fails, compare the lockfile and the deployed package set.
Graph registration issues¶
Problem: ValueError: graph 'X' is already registered¶
Cause:
- calling
register_registration()twice with the same graph name
Fix:
- ensure each graph name is unique across all registrations
Problem: ValueError: entrypoint must be set before building the manifest¶
Cause:
- calling
builder.build()withoutbuilder.set_entrypoint(...)
Fix:
- call
builder.set_entrypoint("node_name")beforebuild()
Problem: ValueError: entrypoint must reference a registered node¶
Cause:
- entrypoint name doesn't match any node added via
add_node
Fix:
- verify node names match exactly (case-sensitive)
Problem: ValueError: terminal nodes cannot define next_node or route_handler_name¶
Cause:
add_node(..., terminal=True, next_node="something")
Fix:
- terminal nodes should not have
next_nodeorroute
Runtime issues¶
Problem: orchestration fails immediately¶
Possible causes:
host.jsonmissing Durable Functions extension bundle- Azure Functions host version incompatibility
Fix:
- ensure
host.jsoncontains:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
Problem: node handler exception causes orchestration failure¶
Cause:
- unhandled exception in a node or route handler
Fix:
- add error handling in your handlers
- use Durable Functions retry policies for transient failures
Problem: KeyError: unknown graph 'X'¶
Cause:
- requesting a graph name that was not registered
Fix:
- verify graph name in API request matches
graph_namein the manifest
Problem: external event not received¶
Cause:
- event name mismatch between route decision and HTTP request
- wrong instance ID
Fix:
- verify
event_nameinRouteDecision.wait_for_event()matches the URL path - verify
instance_idin the URL matches the running orchestration
State issues¶
Problem: state fields not updating¶
Cause:
- handler returning
None(state unchanged) - handler returning wrong key names
Fix:
- return a dict with keys matching the state model field names
- verify dict keys are correct
Problem: TypeError: unsupported state merge result¶
Cause:
- handler returning an unsupported type (not dict, BaseModel, or None)
Fix:
- return
dict,BaseModelinstance, orNonefrom handlers
Testing issues¶
Problem: DurableGraphApp is None in tests¶
Cause:
azure-functionsorazure-functions-durablenot installed in test environment
Fix:
- install Azure dependencies in dev environment
- or test manifest building and handler logic separately (without
DurableGraphApp)
Problem: RuntimeError: no running event loop in async tests¶
Cause:
- async handler test executed in sync-only test context
Fix:
- configure
asyncio_mode = "auto"inpyproject.toml(already configured) - or use
@pytest.mark.asyncio
Still stuck?¶
- Compare behavior with examples in
examples/ - Confirm your handler signatures match docs exactly
- Review Configuration parameter semantics
- Review Usage patterns