Common Issues
MCP and agent error messages
These errors come from MCP servers, the protocol or the model, not from L2M's own setup. Each has its own page in the troubleshooting track:
- MCP error -32000: Connection closed
- spawn npx ENOENT
- MCP server can't see API keys or env variables
- MCP server connected but no tools show up
- Session not found (HTTP 404)
- Request timed out
- Unsupported protocol version
- -32601 Method not found
- -32602 Invalid params
- Tool result too large
- Filesystem server: path outside allowed directories
- OAuth invalid_client
- Failed to fetch authorization server metadata
- 403 insufficient_scope
- Model won't call tools
- Agent stuck calling the same tool in a loop
A template renders empty two steps away
{{nodeId.field}} and {{field}} read only the steps connected straight into the node. For a step further back, use {{results.<nodeId>.field}} (or {{ $node('<nodeId>').output.field }} in an expression), which reads any step that has already finished. A path that does not resolve renders empty with no warning, so also check the node id and the field path against the step's output. See Templates and expressions.
SECRET_MASTER_KEY_BASE64 environment variable is required
Set SECRET_MASTER_KEY_BASE64 in .env with a base64-encoded 32-byte value.
Webhook 404 with "code": "trigger_off"
The webhook (or form, chat or MCP trigger) is switched off, as a starter template's is until you turn it on. Open the trigger node, click Turn on and save. The editor's Run and Webhook run work while it is off; the /webhook-test/ URL answers the same 404 until you turn it on. A webhook with Auth Mode None, chat, forms and MCP triggers say so only to someone signed in who may edit the workflow; anyone else gets a plain 404.
Webhook 404 with no detail
Called without signing in, /webhook/:path answers a missing path and a wrong method with the same plain 404, and lists nothing. Call it signed in (or with an API key) to see the methods the path takes and the endpoints you may run. App webhooks (/api/webhooks/<app>/:workflowId) answer a plain 404 to anything their provider did not sign: check that the trigger's secret matches the provider's.
Webhook 404 on /webhook-test/:path
The test URL runs the draft, so it answers only someone who may edit the workflow: a signed-in session in the same browser, or an API key (Authorization: Bearer <key>, or X-API-Key: <key> when the webhook's own bearer token uses Authorization). Anyone else gets a plain 404 with "No webhook endpoint matches this path and method".
- Call it signed in, or with an API key of someone with edit access to the workflow.
- Ensure
webhook_inputnodepathmatches exactly. - Ensure workflow containing that webhook path is saved.
- An operator who may only run the workflow gets
403: call the webhook's own URL (/webhook/:path) instead.
MCP tool discovery returns unexpected tools
- Check MCP endpoint/base URL in
mcp_toolnode. - Re-run discovery after endpoint change.
- Verify you are not using stale node config.
Agent hits max iterations
- Reduce tool set size.
- Improve prompt constraints for tool usage and stop conditions.
- Increase context windowContext window: The most text, counted in tokens, that a model can take into account in one call: system prompt, conversation, tool definitions and tool results, plus the answer it writes./model limits where possible.
- Raise max iterationsMax iterations: The most rounds of model call and tool calls an agent may take in one run. When it is reached, the agent stops instead of looping on. only when needed.
Context-length/token overflow
- Do not expose very large tool catalogs to the model.
- Use selective tool inclusion.
- Keep tool descriptions and schemas concise.
- Keep
Persist Tool Messagesdisabled on memory unless you explicitly need full tool transcripts. - If you use attached MCP Tool nodes, remove legacy
agent_orchestrator.config.mcpServersentries from older workflows.
Local LLM crash / segmentation fault after tool-heavy runs
- This usually indicates context exhaustion in the local inference server.
- Reduce
Tool Message Max Charsand max iterations. - Limit attached tools to the minimum needed for the task.
- Clear old session history or use a fresh
session_idbefore retrying.
Follow-up prompt did not reuse previously fetched MCP data
- Ensure follow-up uses the same
session_id. - Ensure Agent has memory namespace stable across runs.
- Keep
persistToolMessagesoff unless you explicitly need raw tool transcripts in prompt context. - Runtime now provides
session_cache_listandsession_cache_get; follow-up prompts can explicitly ask agent to reuse cached results before making new MCP calls.
Output Parser fails with Invalid JSON even though response includes JSON
- In
Output Parser, keepmode=json_schemaand changeparsingMode:- start with
lenient - use
anything_goesonly when upstream outputs are highly inconsistent
- start with
- Set
inputKeyto a concrete path (or moustache path), for example:debug.agent_answer{{debug.agent_answer}}messages[5].content
- Inspect
parserTracein node output to see which parse strategy was attempted and why it failed.
Connector nodes run in demo fallback unexpectedly
- Check secret selection is not
None (demo fallback). - Validate required endpoint/index/database fields.
- Run
Test Connectionin node config.