continuedev/continue · error

Error fetching tags: ${e.message}

Error message

Error fetching tags: ${e.message}

What it means

Thrown inside the Ollama customFetch error path when a caught error's message references /api/tags — the local Ollama endpoint used to list models. Fetching http://localhost:11434/api/tags failed, usually because Ollama isn't running or reachable at that address.

Source

Thrown at core/llm/index.ts:481

          }

          const error = await this.parseError(resp);
          throw error;
        }

        return resp;
      } catch (e: any) {
        Logger.error(e, {
          context: "llm_fetch",
          url: String(input),
          method: init?.method || "GET",
          model: this.model,
          provider: this.providerName,
        });

        // Errors to ignore
        if (e.message.includes("/api/tags")) {
          throw new Error(`Error fetching tags: ${e.message}`);
        } else if (e.message.includes("/api/show")) {
          throw new Error(
            `HTTP ${e.response.status} ${e.response.statusText} from ${e.response.url}\n\n${e.response.body}`,
          );
        } else {
          if (!isAbortError(e)) {
            // Don't pollute console with abort errors. Check on name instead of instanceof, to avoid importing node-fetch here
            console.debug(
              `${e.message}\n\nCode: ${e.code}\nError number: ${e.errno}\nSyscall: ${e.erroredSysCall}\nType: ${e.type}\n\n${e.stack}`,
            );
          }
          if (
            e.code === "ECONNREFUSED" &&
            e.message.includes("http://127.0.0.1:11434")
          ) {
            const message = (await isOllamaInstalled())
              ? "Unable to connect to local Ollama instance. Ollama may not be running."
              : "Unable to connect to local Ollama instance. Ollama may not be installed or may not running.";

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Start Ollama (ollama serve or launch the app) and verify: curl http://localhost:11434/api/tags
  2. If OLLAMA_HOST is customized, ensure the client's apiBase matches it exactly
  3. For Docker/WSL, use host.docker.internal or the host's IP instead of 127.0.0.1
  4. Wait a moment after install/start for the server to bind

Example fix

# before
# Ollama not running; error: Error fetching tags: fetch failed
# after
ollama serve &
curl http://localhost:11434/api/tags  # returns {"models":[...]}
Defensive patterns

Strategy: retry

Validate before calling

const ok = await fetch('http://localhost:11434/api/tags').then(r => r.ok).catch(() => false); if (!ok) await startOrWaitForOllama();

Try / catch

catch (e) { if (e.message.includes('Error fetching tags')) { await ensureOllamaRunning(); retry(); } else throw e; }

Prevention

When it happens

Trigger: The configured Ollama connection can't serve /api/tags: Ollama not started, listening on a different host/port, or an OLLAMA_HOST override pointing somewhere unreachable.

Common situations: Fresh machines where Ollama isn't installed/started; OLLAMA_HOST set to a remote or custom port; Docker networking preventing localhost access; Ollama still booting.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/c356515e874897c5. Report an issue: GitHub.