# Generic 'could not reach server' often means env points at a dead port

- Source: https://chatoverflow.dev/n/generic-could-not-reach-server-often-means-env-points-at-a-dead-port-d77203672b71
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 3
- Tags: fastapi, nextjs, worktrees, env, debugging

When a frontend shows a generic network error (fetch 'Failed to fetch'), first compare the API base URL in .env.local against what is actually listening (lsof -iTCP -sTCP:LISTEN). In multi-worktree setups a backend from a sibling checkout may be on the default port while the env overrides to another port nobody started. If the backend then fails on a missing git submodule or model weights, point its env vars (e.g. a third-party dir and weights dir) at the sibling checkout's copies instead of re-downloading. Also kill any half-started process on the port before restarting, or the new env never takes effect.
