mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-10-17 05:14:19 +02:00
Ollama's /api/pull returns HTTP 200 and reports failures IN-BAND, as a JSON
line inside the NDJSON stream body:
HTTP_STATUS=200
{"status":"pulling manifest"}
{"error":"pull model manifest: file does not exist"}
The stream handler only ever read completed/total/digest off each line and
silently dropped everything else, including that error line. The stream then
ended normally, on('end') resolved unconditionally, and we logged the model as
downloaded successfully. on('error') never fires for this, because at the HTTP
layer the request succeeded.
Every failed model pull, for any reason, was reported as a success. On #1071
that surfaced as an ~800 GB fp16 model "downloading" in two seconds and nothing
being installed, which had been triaged twice as disk space or a stale blob.
Those explanations produce workarounds that cannot work, since the pull never
reaches the disk at all.
Three changes:
- Check parsed.error in the data handler and destroy the stream with it, so the
existing catch reports a real failure.
- Verify the model is actually in getModels() before returning success. This is
the load-bearing half: it catches silent failures we have not anticipated,
not only the ones Ollama labels. includeEmbeddings must be true or
nomic-embed-text fails verification after a good pull, and names are
normalised because Ollama resolves a bare name to ":latest".
- Treat an in-band "model does not exist" as permanent. It was retryable, so a
bad model name spun through attempts: 10 on exponential backoff and the user
watched a delayed job for hours instead of being told the name was wrong.
Verified on NOMAD3 against the shipped v1.34.0 build, which carries the same
defect:
- bogus tag, before: 'Model "..." downloaded successfully.'
- bogus tag, after: 'Failed to download model "...": pull model manifest:
file does not exist', and the job stops at 1 attempt instead of retrying
- real model (qwen2.5:0.5b): still succeeds, passes verification, and is
present in `ollama list`
Fixes #1273
Refs #1071
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LtGWCVMPYn6qPWVYiycK74
|
||
|---|---|---|
| .. | ||
| app_auto_update_service.ts | ||
| auto_update_service.ts | ||
| benchmark_service.ts | ||
| benchmark_telemetry.ts | ||
| chat_service.ts | ||
| collection_manifest_service.ts | ||
| collection_update_service.ts | ||
| condition_service.ts | ||
| container_registry_service.ts | ||
| content_auto_update_service.ts | ||
| context_window_service.ts | ||
| countries_service.ts | ||
| creator_pack_service.ts | ||
| custom_app_guard.ts | ||
| docker_service.ts | ||
| docs_service.ts | ||
| download_service.ts | ||
| drug_reference_service.ts | ||
| eval_corpus_service.ts | ||
| eval_generation_service.ts | ||
| eval_report_service.ts | ||
| eval_retrieval_service.ts | ||
| kiwix_catalog_service.ts | ||
| kiwix_library_service.ts | ||
| map_service.ts | ||
| nomad_md_service.ts | ||
| ollama_service.ts | ||
| queue_service.ts | ||
| rag_pipeline_service.ts | ||
| rag_service.ts | ||
| system_service.ts | ||
| system_update_service.ts | ||
| token_calibration_service.ts | ||
| zim_extraction_service.ts | ||
| zim_service.ts | ||