Document search in AnythingLLM depends on an embedding model that converts each file into vectors before a workspace can retrieve it. A blocked download of that model makes Save and Embed mark the document Failed, drop it from the workspace list and record fetch failed in the container log.

The default AnythingLLM Embedder runs on the server itself but ships without its model files, so its first embedding downloads all-MiniLM-L6-v2 from Hugging Face and, when that fails, from a fallback copy hosted by AnythingLLM. A firewall, proxy or DNS policy that blocks both sources stops every embedding, while a model that has downloaded once stays cached and does not need the network again.

Restoring that download keeps the default embedder and the files already in the document library, with no provider or vector database change. On an AnythingLLM Docker installation, the AnythingLLM server inside the container downloads the model, so the container's own network access decides whether it arrives, not the browser's. An Ollama embedder fails differently, with a message that its service could not be reached.

Steps to fix Fetch failed errors when embedding in AnythingLLM:

  1. Display the latest log lines from the AnythingLLM container after the failed embedding.
    $ docker logs --tail 20 anythingllm
    ##### snipped #####
    [NativeEmbedder] The native embedding model has never been run and will be downloaded right now. Subsequent runs will be faster. (~23MB)
    [NativeEmbedder] Downloading Xenova/all-MiniLM-L6-v2 from https://huggingface.co/
    [NativeEmbedder] Failed to download model from primary URL. Using fallback https://cdn.anythingllm.com/support/models/
    [NativeEmbedder] Downloading Xenova/all-MiniLM-L6-v2 from https://cdn.anythingllm.com/support/models/
    [VectorDB::LanceDb] addDocumentToNamespace fetch failed
    Failed to vectorize cedar-lantern-dispatch.txt
    ##### snipped #####

    anythingllm is the container name from the Docker installation. These lines show the built-in embedder failing to download its model from Hugging Face and from the fallback host. A log that reports Ollama service could not be reached instead points to the Ollama embedder connection, not the model download.

  2. Test whether the container can reach the Hugging Face model file.
    $ docker exec anythingllm curl -sSIL --connect-timeout 10 \
      -o /dev/null -w '%{http_code}\n' \
      https://huggingface.co/Xenova/all-MiniLM-L6-v2/resolve/main/onnx/model_quantized.onnx
    curl: (7) Failed to connect to huggingface.co port 443 after 0 ms: Couldn't connect to server
    000

    -I requests headers only and -L follows Hugging Face's redirect to its download host, so the check reads the final status without downloading the model. 000 means no HTTPS response arrived. A firewall that silently drops traffic ends the check after 10 seconds with Timeout was reached, and a DNS block reports Could not resolve host.

  3. Allow outbound HTTPS from the Docker host to huggingface.co and *.hf.co in the firewall or proxy that blocks them.

    Disabling the firewall is unnecessary and exposes the host. The model download needs only these destinations, and the documents themselves stay on the server.

    Hugging Face serves the model file from a download host under hf.co, such as us.aws.cdn.hf.co, so a rule for huggingface.co alone still blocks the download. On a managed network, the network administrator controls this rule.

  4. Rerun the Hugging Face check from inside the container.
    $ docker exec anythingllm curl -sSIL --connect-timeout 10 \
      -o /dev/null -w '%{http_code}\n' \
      https://huggingface.co/Xenova/all-MiniLM-L6-v2/resolve/main/onnx/model_quantized.onnx
    200

    200 confirms that the container now receives the model file's headers through the redirect. A 302 after a failure to connect to an hf.co host means huggingface.co is allowed but its download host is still blocked.

  5. Click the upload icon beside the workspace name in the sidebar.

    Cedar Lantern is the example workspace, and cedar-lantern-dispatch.txt stands for the document that failed.

  6. Expand the custom-documents folder with the arrow beside its name.

    A failed embedding leaves the processed file in the document library, so it does not need to be uploaded again.

  7. Select the checkbox beside the document that failed.
  8. Click Move to Workspace beneath the document list.
  9. Click Save and Embed beneath the workspace document list.

    The first successful embedding downloads the model before processing the document, so it can take longer than later embeddings.

  10. Confirm that the document shows a pin icon in the workspace list.

    The pin icon appears and Save and Embed disappears once the document is stored in the workspace. A document that shows Failed again and leaves the list means the download is still blocked, and the container log names the source that failed.

Share this guide