Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Connection Failure with Local Ollama Instance on Windows (HTTP 400 Bad Request)

Aperta
#1,616 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
ollama, python
Ambito
ai, backend

Direzione di ricerca

Start by tracing the workspace model settings connection check and its backend request handling; the issue names the /dashboard/[REDACTED_WORKSPACE_ID]/workspace-settings/models page and Ollama’s 11434 endpoint, but does not identify source files or tests. Reproduce with a native Windows Ollama instance and inspect the request and returned error to determine why valid local connections produce HTTP 400. Done means the desktop app connects successfully to the configured Ollama instance without reporting a misleading Docker-host error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Connection Failure with Local Ollama Instance on Windows (HTTP 400 Bad Request)

Bug Report

Describe what happened:
When attempting to connect the Surfsense Windows standalone desktop application (.exe) to a locally running Ollama instance, the application consistently throws an HTTP 400 BAD_REQUEST error.

Even though the local Ollama instance is verified as fully functional—listening properly on all interfaces (0.0.0.0:11434 / [::]:11434), responding successfully via web browsers, and explicitly configured with unrestricted CORS (OLLAMA_ORIGINS="*")—the Surfsense executable fails to establish a connection.

The application prompts the user to use host.docker.internal, suggesting it might be executing within an isolated runtime environment (such as a hardcoded Docker-like container context or a tightly sandboxed Node.js environment) that cannot resolve the host system's loopback addresses (localhost or 127.0.0.1). Standard networking workarounds (e.g., mapping host.docker.internal via the Windows hosts file, using the machine's local network IPv4 address, or trying alternative API endpoints like /v1 or /api) do not bypass the error.

Steps to Reproduce:

  1. Start Ollama natively on Windows with environment variables set to:
  • OLLAMA_HOST=0.0.0.0
  • OLLAMA_ORIGINS=*
  1. Confirm Ollama is running by accessing [http://127.0.0.1:11434](http://127.0.0.1:11434) via a standard web browser (returns "Ollama is running").
  2. Open the Surfsense .exe application and navigate to the Workspace Model Settings.
  3. Attempt to configure the base URL using http://localhost:11434, [http://127.0.0.1:11434](http://127.0.0.1:11434), or [http://host.docker.internal:11434](http://host.docker.internal:11434).
  4. Observe the connection failure and the resulting HTTP 400 error screen.

Expected Behavior:
The desktop executable should be able to communicate directly with the host machine's loopback network interface or respect the system's DNS routing to connect to native backend servers running outside of a containerized ecosystem.


Diagnostics (auto-filled)

  • Error code: BAD_REQUEST
  • Request ID: req_07853bf64ed4
  • HTTP status: 400
  • Message: All connection attempts failed. The backend is running inside Docker; localhost means the backend container. Use host.docker.internal and make sure the model server listens on 0.0.0.0.
  • Timestamp: 2026-07-19T14:36:39.533Z
  • Page: /dashboard/[REDACTED_WORKSPACE_ID]/workspace-settings/models
  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36

Additional Technical Context

Host System Environment (Ollama Server Status Log)

The backend server logs confirm that Ollama is initialized correctly with active GPU acceleration and open network bindings:

level=INFO source=routes.go:1947 msg="server config" env="map[... OLLAMA_HOST:http://0.0.0.0:11434 ... OLLAMA_ORIGINS:[* ...]]"
level=INFO source=routes.go:2004 msg="Listening on [::]:11434 (version 0.32.1)"
level=INFO source=types.go:32 msg="inference compute" id=0 library=CUDA name=CUDA0 description="NVIDIA GeForce RTX 5060 Laptop GPU"

Potential Causes for Investigation:
  1. Hardcoded Request Payloads: The BAD_REQUEST (400) status implies that a network handshake is occurring, but the JSON payload or the specific endpoint path (e.g., /api/chat vs /v1/chat/completions) expected by the standalone app's internal reverse proxy does not match Ollama's native routing layout.
  2. Internal Network Bridging: The application package might be dropping network packets when traversing from its internal runtime layer out to the host Windows network stack, incorrectly falling back to the generic Docker error wrapper.
Lingua principale
Python
Stelle
16.3k
Fork
1.6k
Merge medio
13h 35m
PR unite (30g)
267

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MODSetter/SurfSense

Tutte le issue di MODSetter/SurfSense

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.