different-ai/openwork · error

Failed to pull ${model}.

Error message

Failed to pull ${model}.

What it means

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.

Source

Thrown at apps/app/src/react-app/domains/settings/ollama-config.tsx:196

      let latestProgress: PullProgressUpdate = { status: "Starting pull..." };
      const updateProgress = (update: PullProgressUpdate) => {
        latestProgress = update;
        setProgress((current) => ({
          modelName: model,
          status: update.status,
          completed: update.completed ?? current?.completed,
          total: update.total ?? current?.total,
        }));
      };

      updateProgress(latestProgress);
      const ok = await pullOllamaModel(model, updateProgress);

      if (!ok) {
        if (latestProgress.status === "Starting pull...") {
          setProgress({ modelName: model, status: `Failed to pull ${model}.` });
        }
        throw new Error(`Failed to pull ${model}.`);
      }

      return model;
    },
    onSuccess: async (model) => {
      await queryClient.invalidateQueries({ queryKey: ["ollama", "tags"] });
      setProgress(null);
      options.onSuccess?.(model);
    },
  });

  return { pullModel, isPulling, progress };
}

export type OllamaConfigProps = {
  busy: boolean;
  status: string | null;
  error: string | null;

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Verify the model tag exists (e.g. check ollama.com/library) and is spelled correctly
  2. Confirm the Ollama server is running and reachable at the configured base URL
  3. Check the progress status / Ollama server logs for the specific pull error (auth, disk, network)
  4. Retry the pull once connectivity is restored

Example fix

// before
await pullModel("llamma3.2"); // typo -> failed pull
// after
await pullModel("llama3.2");
Defensive patterns

Strategy: try-catch

Validate before calling

const res = await fetch(`${ollamaBaseUrl}/api/tags`);
if (!res.ok) throw new Error("Ollama server unreachable");

Try / catch

try {
  await pullModel("llama3.2");
} catch (e) {
  if (e.message.startsWith("Failed to pull")) console.error("Check Ollama server and model tag:", e.message);
  else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Ollama not running or wrong host/port configured; model name misspelled or non-existent tag; registry auth required; disk space exhausted; offline machine.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/d933b6641b91d510. Report an issue: GitHub.