{"record":{"id":"d933b6641b91d510","repo":"different-ai/openwork","slug":"failed-to-pull-model","errorCode":null,"errorMessage":"Failed to pull ${model}.","messagePattern":"Failed to pull (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/settings/ollama-config.tsx","lineNumber":196,"sourceCode":"      let latestProgress: PullProgressUpdate = { status: \"Starting pull...\" };\n      const updateProgress = (update: PullProgressUpdate) => {\n        latestProgress = update;\n        setProgress((current) => ({\n          modelName: model,\n          status: update.status,\n          completed: update.completed ?? current?.completed,\n          total: update.total ?? current?.total,\n        }));\n      };\n\n      updateProgress(latestProgress);\n      const ok = await pullOllamaModel(model, updateProgress);\n\n      if (!ok) {\n        if (latestProgress.status === \"Starting pull...\") {\n          setProgress({ modelName: model, status: `Failed to pull ${model}.` });\n        }\n        throw new Error(`Failed to pull ${model}.`);\n      }\n\n      return model;\n    },\n    onSuccess: async (model) => {\n      await queryClient.invalidateQueries({ queryKey: [\"ollama\", \"tags\"] });\n      setProgress(null);\n      options.onSuccess?.(model);\n    },\n  });\n\n  return { pullModel, isPulling, progress };\n}\n\nexport type OllamaConfigProps = {\n  busy: boolean;\n  status: string | null;\n  error: string | null;","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/ollama-config.tsx#L178-L214","documentation":"usePullOllamaModel throws this error when pullOllamaModel returns false, meaning the Ollama pull failed (network error, unknown model name, or the Ollama server rejected the request). The status toast shows a generic failure only if no more specific progress update arrived (still at \"Starting pull...\"). The mutation then rejects so callers can react via onError.","triggerScenarios":"Calling pullModel(name) where the Ollama server is unreachable, the model tag does not exist in the registry (typo, wrong tag), the pull is interrupted, or the Ollama daemon returns an error mid-stream.","commonSituations":"Ollama not running or wrong host/port configured; model name misspelled or non-existent tag; registry auth required; disk space exhausted; offline machine.","solutions":["Verify the model tag exists (e.g. check ollama.com/library) and is spelled correctly","Confirm the Ollama server is running and reachable at the configured base URL","Check the progress status / Ollama server logs for the specific pull error (auth, disk, network)","Retry the pull once connectivity is restored"],"exampleFix":"// before\nawait pullModel(\"llamma3.2\"); // typo -> failed pull\n// after\nawait pullModel(\"llama3.2\");","handlingStrategy":"try-catch","validationCode":"const res = await fetch(`${ollamaBaseUrl}/api/tags`);\nif (!res.ok) throw new Error(\"Ollama server unreachable\");","typeGuard":null,"tryCatchPattern":"try {\n  await pullModel(\"llama3.2\");\n} catch (e) {\n  if (e.message.startsWith(\"Failed to pull\")) console.error(\"Check Ollama server and model tag:\", e.message);\n  else throw e;\n}","preventionTips":["Verify the model tag on ollama.com before pulling","Health-check the Ollama server (/api/tags) before pulling","Monitor progress status for early failure signals","Ensure sufficient disk space and network connectivity"],"tags":["ollama","network","model-pull"],"backgroundTag":"model-pull-failed","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}