ollama/ollama · error · Error

Failed to disconnect user

Error message

Failed to disconnect user

What it means

Thrown by disconnectUser() when POST {API_BASE}/api/signout returns a non-OK status. Unlike other helpers it does not include the response body or status, so the server logs are the only source of detail. It means the server received the signout request but refused or failed to process it.

Source

Thrown at app/ui/app/src/api.ts:100

    const data = await response.json();
    if (data.signin_url) {
      return data.signin_url;
    }
  }

  throw new Error("Failed to fetch connect URL");
}

export async function disconnectUser(): Promise<void> {
  const response = await fetch(`${API_BASE}/api/signout`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
  });

  if (!response.ok) {
    throw new Error("Failed to disconnect user");
  }
}

export async function getChats(): Promise<ChatsResponse> {
  const response = await fetch(`${API_BASE}/api/v1/chats`);
  const data = await response.json();
  return new ChatsResponse(data);
}

export async function getChat(chatId: string): Promise<ChatResponse> {
  const response = await fetch(`${API_BASE}/api/v1/chat/${chatId}`);
  const data = await response.json();
  return new ChatResponse(data);
}

export async function getModels(query?: string): Promise<Model[]> {
  try {
    const { models: modelsResponse } = await ollama.list();

View on GitHub (pinned to e5a81899d0)

Solutions

  1. Confirm the route exists on the server: curl -X POST http://localhost:11434/api/signout -o /dev/null -w '%{http_code}'
  2. Update the Ollama server/app to matching versions
  3. Check server logs for the underlying signout failure
  4. If the server is unreachable for auth, the local session can often be cleared by restarting the app after the server recovers
Defensive patterns

Strategy: try-catch

Try / catch

try { await disconnectUser(); }
catch (e) { console.warn('signout failed', e); /* keep local signed-out state anyway */ }

Prevention

When it happens

Trigger: POST /api/signout returning 4xx/5xx (session backend down, auth provider unreachable, invalid/expired session token causing 400); API_BASE pointing to a stale server that predates the /api/signout route (404).

Common situations: Version mismatch where the UI is newer than the local server and /api/signout does not exist yet; ollama.com auth endpoint outage making the server unable to revoke the session; signing out while offline.

Related errors


AI-assisted analysis of ollama/ollama@e5a81899d0 (2026-08-15). Data as JSON: /api/errors/fcf29e8d14f57eb6. Report an issue: GitHub.