Back to Home
Dify v1.10 Ollama embedding 500 error after upgrade: how to fix
Troubleshooting7 min readSource: Admesh Engineering

Dify v1.10 Ollama embedding 500 error after upgrade: how to fix

Ollama text embedding fails with a 500 in Dify v1.10 though it worked in v1.9.2. Check the endpoint, Docker networking, and where the error is really raised.

The symptom

After upgrading a self-hosted Docker deployment to Dify v1.10 and configuring Ollama for text embedding, invoking the embedding model from the app fails. The model itself is unchanged and reportedly worked on v1.9.2.

The logs are misleading at first glance. The plugin daemon access log shows a successful dispatch call: a POST to the text_embedding invoke path returning 200. The worker then logs the HTTP request to the plugin daemon as 200 OK, and immediately afterwards an error from the stream-response handler for the plugin. That error is a JSON object with code -500 and a message field whose contents are themselves a JSON string containing args, a description, and a nested Bad Request Error with a 500 Server Error for a URL pointing at the Ollama host. In other words, the transport succeeded and the plugin reported a failure inside its own call to Ollama.

Because the outer status is 200, grepping for 500 in the plugin daemon logs finds nothing. The real failure is in the worker log line and in the nested description string.

  • Outer dispatch call: 200 OK from the plugin daemon.
  • Worker log: plugin error object with code -500.
  • Nested message: Bad Request Error plus 500 Server Error for the Ollama URL.

Why it happens

The thread does not converge on one confirmed root cause. Ranked by how well the evidence supports them:

1. The Ollama embed endpoint path or request shape is not what the plugin sends. A reply points at the difference between the older embeddings path and the current embed path and notes that the wrong one produces 4xx or 5xx responses. Confirm by calling the exact URL and body shape the plugin uses from inside the plugin daemon container, not from your laptop.

2. The plugin daemon container cannot reach Ollama at the address configured in the model settings. The nested description contains the URL the plugin actually tried; if it says localhost or 127.0.0.1, the container is calling itself. Confirm by reading that URL out of the log and then running a request to it from inside the plugin daemon container.

3. Ollama is bound only to loopback on the host, so containers cannot connect even though host-side curl works. The successful curl in the thread was run on the host against localhost, which does not test the container path. Confirm by checking what address Ollama listens on and whether the container can open a connection to the host gateway address.

4. A behavior change between v1.9.2 and v1.10 in how the plugin builds or validates the embedding request. This is plausible given the version correlation but is not demonstrated in the thread. Confirm by comparing the same model configuration and the same Ollama instance against both versions.

How to fix it

  1. Read the nested description in the worker log and extract the exact URL the plugin called. This single step separates a wrong-address problem from a wrong-endpoint problem.
  2. If that URL contains localhost or 127.0.0.1, change the base URL in the model configuration to an address reachable from inside the plugin daemon container, such as the Docker host gateway name or the Ollama container name on a shared network.
  3. Exec into the plugin daemon container and issue the same embedding request against that URL. If it fails there but succeeds on the host, the problem is networking or binding, not the Dify version.
  4. Make sure Ollama accepts connections from outside loopback, then re-test from the container. A host-only curl proves nothing about container reachability.
  5. If the URL is reachable from the container but still returns an error, check which Ollama embedding route the plugin targets and whether your Ollama build serves that route with the request body being sent. Test the route directly with the same body.
  6. Only after the container-level request succeeds, retry from the Dify UI. If it still fails, capture the new nested description; it will point at the next layer.
  7. If everything works on v1.9.2 with identical settings and fails on v1.10, treat it as a version regression and report it with the extracted URL, the container-level test result, and both version numbers.

When this is not the cause

If the nested description shows a URL that is reachable from the plugin daemon container and returns a valid embedding response when called directly with the same body, networking and endpoint selection are ruled out. Look instead at request construction: model name mismatch, input formatting, or response parsing.

If the failure appears only for some documents and not others, the cause is likely input size or content rather than connectivity, and the same 500 shape can appear for an oversized batch.

If the error mentions authentication or a missing model rather than a server error for the URL, the problem is credentials or model availability on the Ollama side, not the Dify upgrade.

The reporter disputed the networking explanation, noting the API container could also reach Ollama. That objection is reasonable and means networking should be tested rather than assumed; it does not by itself clear the plugin daemon container, which is a separate process.

How to apply this with Admesh

The failure above is specific to a self-hosted Ollama plugin, but the same class of problem, a provider URL that is only reachable from some containers, disappears when embeddings and chat both go through one gateway. Admesh exposes an OpenAI-compatible base URL at https://api.admesh.ai/v1 and an Anthropic-compatible endpoint at https://api.admesh.ai/v1/messages, with one API key and one balance across multiple model families.

In Dify, add a model provider that uses the OpenAI-compatible API, set the base URL to https://api.admesh.ai/v1, and paste your Admesh key. Because the endpoint is a public HTTPS host, the plugin daemon does not need host-gateway tricks or a shared Docker network with a local model server, which removes root causes 2 and 3 above entirely.

Before switching, confirm which embedding models your account can call and what they cost in the live catalog at https://admesh.ai/models rather than assuming a model name. Create and rotate keys in the console at https://console.admesh.ai, and check https://docs.admesh.ai for the current request and response shapes.

Keep the diagnostic habit from this article: when a call fails, read the innermost error message first. With a single gateway, that message names the upstream provider and the reason, so you are not decoding nested JSON strings from a plugin wrapper.

Admesh API docs →

FAQ

Is this a confirmed Dify v1.10 bug?
Not in this thread. The reporter shows a clear version correlation, working on v1.9.2 and failing on v1.10 with the same model, but no reply confirms a defect in Dify itself. Treat it as an open hypothesis and verify by reproducing with identical settings on both versions.
Why does the plugin daemon log 200 when the embedding fails?
The dispatch call between the worker and the plugin daemon completed successfully. The failure happened inside the plugin while calling Ollama, and that failure was returned as a payload with code -500. Read the worker log line, not just the access log.
My curl to Ollama works, so why does Dify still fail?
A curl from the host only tests host-to-Ollama connectivity. The plugin daemon runs in its own container and may resolve the configured URL differently. Repeat the request from inside that container using the exact URL from the error message.
Should I change the embedding endpoint path?
A reply suggests checking which Ollama embedding route is in use, since the wrong route yields 4xx or 5xx responses. Verify by sending the same request body to the route the plugin targets and comparing the result, rather than changing it blindly.

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.