Dify agent_v2 node error: base_url is required when creating a real Agent backend client
Why the Dify Agent node (agent_v2) fails in the default Docker stack, how to confirm the missing backend service, and what actually works.
The symptom
You add an Agent node to a Workflow or Chatflow, run it, and the run fails immediately with a single-line error:
base_url is required when creating a real Agent backend client
The node never reaches your model provider. There is no upstream 401, no timeout, no tool-call trace, and nothing in the model provider logs, because execution stops while the backend client is being constructed. The same failure appears regardless of which model, agent strategy, or MCP tool you attach to the node, which is the strongest hint that the problem sits below your node configuration.
The reporter observed this on a self-hosted Docker deployment of the version they listed, using the standard docker/dify Compose stack. If you are on a similar setup and the error text matches exactly, you are hitting the same path.
- Error shape: one line, mentioning base_url and a real Agent backend client.
- No outbound request to your model provider is recorded for the failed run.
- Changing the model, strategy, or tools does not change the outcome.
Why it happens
Ranked by how well the thread supports each explanation.
1. The Agent backend service is not running and its URL is not configured. This is the confirmed cause in the thread. The node delegates execution to a separate backend service, and its address comes from the AGENT_BACKEND_BASE_URL environment variable. In the default Compose stack that variable is absent and no such service is defined, so the client constructor has nothing to point at. Confirm it by checking the API container environment for AGENT_BACKEND_BASE_URL and by listing running services in your Compose project to see whether any agent backend container exists.
2. You set the variable but it is empty or unreachable. A variable defined with no value, or pointing at a host that the API container cannot resolve, produces the same class of failure. Confirm it by printing the variable inside the API container and attempting a request to that address from the same container.
3. The fake-client flag is being mistaken for a fix. Thread replies confirm that enabling the fake client makes the error disappear, but the node then returns a fixed response and never contacts the model, tools, or your database. Confirm it by checking whether the node output is identical on every run and whether your model provider records any request.
A note on what the thread did not settle: it reports that a backend image exists and was added to CI, but it does not confirm a supported way to wire that service into the default stack. Treat any specific compose snippet you find as a hypothesis until you verify it against your own deployment.
How to fix it
The smallest change depends on what you actually need. If you need real agent execution, the fake client is not a fix, and the thread does not confirm a one-line configuration change that delivers it.
- Confirm the diagnosis first: inspect the API container environment for AGENT_BACKEND_BASE_URL and list the services in your Compose project. If the variable is missing and no backend service is running, you have reproduced the reported cause.
- If you only need the workflow to complete for development or UI work, set AGENT_BACKEND_USE_FAKE=true and AGENT_BACKEND_FAKE_SCENARIO=success. Understand that this returns a hard-coded response: no model call, no MCP tool invocation, no database access. Do not ship this to production.
- If you need real execution, run the Agent backend service yourself and point AGENT_BACKEND_BASE_URL at it from the API container. Verify reachability from inside the API container before re-running the node, since a resolvable name on your host is not necessarily resolvable inside the container network.
- If you cannot run the backend, avoid the agent_v2 node for now and build the same logic with nodes that execute inside the main API process. This keeps the workflow functional while the backend wiring remains unsupported.
- Watch the upstream issue and its duplicates for an official compose override or documented environment contract before depending on the node in production.
When this is not the cause
The error text is specific. If you see something else, look elsewhere before touching the Agent backend configuration.
If the run fails with an authentication or quota error from your model provider, the node did reach the provider and the backend path is working; the problem is credentials or balance on the provider side.
If the run hangs and then times out rather than failing instantly, the client was constructed and the request went somewhere. Check network reachability and the backend service logs instead of the environment variable.
If only one specific tool or strategy fails while other agent runs succeed, the backend is reachable and the issue is in that tool's configuration or its own connectivity.
If the error appears only after an upgrade and your previous version worked, compare the environment of the old and new containers before assuming the service is missing.
How to apply this with Admesh
Admesh does not replace the Agent backend service, so it will not make this particular error disappear. What it does change is the model side of the equation: once your agent execution path is working, you point the model calls at one OpenAI-compatible base URL, https://api.admesh.ai/v1, or the Anthropic-compatible endpoint at https://api.admesh.ai/v1/messages, and use a single API key and balance across OpenAI, Anthropic, Google, DeepSeek, Qwen, Moonshot, Zhipu, and MiniMax families.
A practical sequence: keep the Agent backend diagnosis separate from model configuration. First get past the base_url error using the steps above, then configure your model provider inside Dify to use the Admesh base URL and your Admesh key. Because the endpoint is OpenAI-compatible, existing OpenAI-style provider settings carry over without a code change.
When you are choosing which model to attach to the agent, check the live catalog at https://admesh.ai/models rather than hard-coding a name from a blog post, and manage keys and balance at https://console.admesh.ai. Setup details are at https://docs.admesh.ai.
This separation matters for debugging: if a run fails with the base_url message, the model provider is irrelevant; if it fails with a provider error after that is resolved, you are now debugging credentials or model selection, and the Admesh console shows you which key and balance are in play.
FAQ
Does setting AGENT_BACKEND_USE_FAKE=true fix the Agent node?
Is the Agent backend service included in the default Docker Compose stack?
Can I run the backend image myself?
Will switching model providers to Admesh resolve this error?
References
Call these models through one gateway
Admesh provides a unified OpenAI-compatible API: one Base URL and one key for Claude, GPT, DeepSeek and more. New accounts get trial credit that never expires.
